SmartGWT 2.2 GPL
Firefox
Netbeans 6.9.1
SmartGWT 2.0.4
I have two tables parent/child with a relashionship N:N, so a child is linked to many parents.
I have a foreign key DataSourceField that is multiple:
Parent:
Child:
Parent selection refresh handler, which should show all the children bound to the selected parent:
Well, this way of updating works only if the child has one only parent, in fact your representation of an array field with one only entry is equal to the representation of a single field, where on the other side criteria generated by default on the record passed won't match any comma-separated values put in a string.
Is there a way to fetchRelatedData with a foreign key fieldset as multiple?
Thank you in advance.
yary
Firefox
Netbeans 6.9.1
SmartGWT 2.0.4
I have two tables parent/child with a relashionship N:N, so a child is linked to many parents.
I have a foreign key DataSourceField that is multiple:
Parent:
Code:
DataSourceTextField projectID = new DataSourceTextField( "projectID", "ID" ); projectID.setPrimaryKey( true ); projectID.setValueXPath( "projectID" );
Code:
DataSourceTextField projects = new DataSourceTextField( "projects", "Project List"); projects.setValueXPath( "projects/projectID" ); projects.setMultiple( true ); projects.setTypeAsDataSource( pds ); projects.setForeignKey( pds.getID() + ".projectID" );
Code:
addChangedHandler( new ChangedHandler(){ @Override public void onChanged(ChangedEvent event) { String projectID = ( String ) event.getValue(); if ( projectID == null ){ SC.warn( "value selected was: " + event.getValue() + ", whose" + " class is " + event.getValue().getClass() + "." ); return; } final Record project = getSelectedRecord(); dt.fetchRelatedData( project, pds, new DSCallback(){ @Override public void execute(DSResponse response, Object rawData, DSRequest request) { dt.markForRedraw(); String attributes = ""; for ( String attribute : request.getCriteria().getAttributes() ) attributes += attribute + ": " + request.getCriteria().getAttribute( attribute ) + "\n"; SC.say(attributes); } }, null ); } } );
Is there a way to fetchRelatedData with a foreign key fieldset as multiple?
Thank you in advance.
yary
Comment