dear smartGWT community members,
I'm following the GWT-RPC based datasource implementation thread and examples trying to evaluate usability of SmartGWT for my purposes.
Currently I'm trying to create a grid that would display information composed of two model objects linked by foreign key reference and I'm lost.
Probably I'm missing something very important about the whole concept..
I have following code:
EXAM DS:
with appropriate field in referenced datasource and some additional data field inherent to referenced PATIENT DS:
now I'd like to display a grid displaying list of EXAM objects but for each displaying also patient name.
thus within the grid I add new field
expecting that by some miracle the framework will fetch the collection inherent to the other datasource, find patient referenced by fk and display the name.
obviously it fails, but to be honest I don't know how to proceed - e.g. where to study or find examples for this particular situation.
what strikes me is, that in the GWTRPC thread examples the datasources are created based upon single model object (e.g. ExamBean..) - therefore if I'd like to keep my model facade logical and clean and work woth these concepts I'll inevitably run into this foreign key situation - surely I wouldn't want to define a new model object for every grid I want to display, but rather define up the object model according to the DB structure underneath!
Is there any comment you'd find usable for me - e.g. how should I preceed or where should I look for inspiration?
thank you very much, yours,
-- peter
I'm following the GWT-RPC based datasource implementation thread and examples trying to evaluate usability of SmartGWT for my purposes.
Currently I'm trying to create a grid that would display information composed of two model objects linked by foreign key reference and I'm lost.
Probably I'm missing something very important about the whole concept..
I have following code:
EXAM DS:
Code:
DataSourceField patientFkField = new DataSourceSequenceField("patientFk"); patientFkField.setForeignKey("patient.patientPk");
Code:
DataSourceSequenceField patientPkField = new DataSourceSequenceField("patientPk"); patientPkField.setPrimaryKey(true); DataSourceTextField patientNameField = new DataSourceTextField("patientName");
thus within the grid I add new field
Code:
ListGridField patientName = new ListGridField("patientName", "Patient Name");
obviously it fails, but to be honest I don't know how to proceed - e.g. where to study or find examples for this particular situation.
what strikes me is, that in the GWTRPC thread examples the datasources are created based upon single model object (e.g. ExamBean..) - therefore if I'd like to keep my model facade logical and clean and work woth these concepts I'll inevitably run into this foreign key situation - surely I wouldn't want to define a new model object for every grid I want to display, but rather define up the object model according to the DB structure underneath!
Is there any comment you'd find usable for me - e.g. how should I preceed or where should I look for inspiration?
thank you very much, yours,
-- peter
Comment