PDA

View Full Version : FormBinding RFE or work around (SOLVED)



Shawn.in.Tokyo
27 Jul 2009, 6:34 PM
How can I make a RFE or find a work around to allow for multiple forms -- i.e., I want more than one FormBinding?

How can I work around
formBindings.setStore((Store) grid.getStore());
to allow more the one formBindings?

:D

simple solution is to just have one formBinding and control display of the the panel

panel.getItemByItemId("whatever_the_id_is").hide();
panel.getItemByItemId("whatever_the_id_is").show();



For example -- using the GridStoreBindingExample,

private FormBinding formBindings;
private FormBinding formBindings2; //my addition

FormPanel panel = new FormPanel();
FormPanel panel2 = new FormPanel2();//my addition


formBindings = new FormBinding(panel, true);
formBindings.setStore((Store) grid.getStore());

formBindings2 = new FormBinding(panel2, true); //my addition
formBindings2.setStore((Store) grid.getStore()); //my addition


this won't work...
formBindings2.bind((ModelData) be.getSelection().get(0));

only this works...
formBindings.bind((ModelData) be.getSelection().get(0));

If I don't call
//formBindings.setStore((Store) grid.getStore()); -- edited out
then it works now
formBindings2.bind((ModelData) be.getSelection().get(0));

basically my model has data that I won't show in the grid. However, depending on the data available, I want to show different forms.

Ex. model is Government. If there is no parliment, my form won't include fields for that. If there is no president, no field for that. I have set Gov types and everything works fine except for displaying which form.

How can I work around
formBindings.setStore((Store) grid.getStore());
to allow more the one formBindings? Can I override or extend something??????

I can use different grids for different gov types. All the Govts in Asia must display together.