Hi,
I am using the VisualBuilder (SmartClient_SC_SNAPSHOT-2011-07-27) to edit our screens and I recently tried to Incorporate a ValuesManager into one of these screens. VisualBuilder does not include support for a ValuesManager, so I tried adding one by editing the xml directly with a text editor. The result was interesting but ultimately unsuccessful.
The problems can be illustrated using the example from the reference manual. Start by loading the example into VB:
VB rearranges to code so that it looks like this:
Various elements have been re-arranged, which is fair enough, and the screen works as expected. So far, so good - everything is cool. The problems begin if you then try to load second version of the screen back into VB. It modifies the code again to look like this:
The ValuesManager element has been removed and the references to it in the DynamicForms have been replaced by constructs that create a separate ValuesManager object for each DynamicForm. The ValuesManager in this screen returns values for only one of the forms, which is not useful.
If you then try to load this third version of the screen into VB, it gets worse. The xml is mangled yet again, this time into something that is not valid XML:
You can't load this into VB at all.
It would be fantastic if VisualBuilder allowed me to to add and configure a ValuesManager (I'll have to post that to the Wishlist forum). If that's not feasible, would it be possible to fix VisualBuilder so that it doesn't destroy elements like ValuesManager that are added manually? It seems like it is almost there.
Andrew
I am using the VisualBuilder (SmartClient_SC_SNAPSHOT-2011-07-27) to edit our screens and I recently tried to Incorporate a ValuesManager into one of these screens. VisualBuilder does not include support for a ValuesManager, so I tried adding one by editing the xml directly with a text editor. The result was interesting but ultimately unsuccessful.
The problems can be illustrated using the example from the reference manual. Start by loading the example into VB:
Code:
<ValuesManager ID="vm"/> <VLayout width="400" height="300" membersMargin="10"> <members> <TabSet ID="theTabs" height="250"> <tabs> <tab title="Item"> <pane> <DynamicForm ID="form0" valuesManager="vm"> <fields> <field name="itemName" type="text" title="Item"/> <field name="description" type="textArea" title="Description"/> <field name="price" type="float" title="Price" defaultValue="low"/> </fields> </DynamicForm> </pane> </tab> <tab title="Stock"> <pane> <DynamicForm ID="form1" valuesManager="vm"> <fields> <field name="inStock" type="checkbox" title="In Stock"/> <field name="nextShipment" type="date" title="Next Shipment" useTextField="true" defaultValue="256"/> </fields> </DynamicForm> </pane> </tab> </tabs> </TabSet> <Button title="Submit"> <click> vm.validate(); if (form1.hasErrors()) theTabs.selectTab(1); else theTabs.selectTab(0); </click> </Button> </members> </VLayout>
Code:
<ValuesManager> <ID>vm</ID> </ValuesManager> <DynamicForm ID="form0" autoDraw="false"> <fields> <FormItem type="text" name="itemName" title="Item"/> <FormItem type="textArea" name="description" title="Description"/> <FormItem type="float" name="price" title="Price"> <defaultValue>low</defaultValue> </FormItem> </fields> <valuesManager>vm</valuesManager> </DynamicForm> <DynamicForm ID="form1" autoDraw="false"> <fields> <FormItem type="checkbox" name="inStock" title="In Stock"/> <FormItem type="date" name="nextShipment" title="Next Shipment"> <defaultValue>256</defaultValue> <useTextField>true</useTextField> </FormItem> </fields> <valuesManager>vm</valuesManager> </DynamicForm> ...
Code:
<DynamicForm ID="form0" autoDraw="false"> <fields> <FormItem type="text" name="itemName" title="Item"/> <FormItem type="textArea" name="description" title="Description"/> <FormItem type="float" name="price" title="Price"> <defaultValue>low</defaultValue> </FormItem> </fields> <valuesManager constructor="ValuesManager"> <ID>vm</ID> </valuesManager> </DynamicForm> <DynamicForm ID="form1" autoDraw="false"> <fields> <FormItem type="checkbox" name="inStock" title="In Stock"/> <FormItem type="date" name="nextShipment" title="Next Shipment"> <defaultValue>256</defaultValue> <useTextField>true</useTextField> </FormItem> </fields> <valuesManager constructor="ValuesManager"> <ID>vm</ID> </valuesManager> </DynamicForm> ...
If you then try to load this third version of the screen into VB, it gets worse. The xml is mangled yet again, this time into something that is not valid XML:
Code:
<DynamicForm ID="form0" autoDraw="false"> <fields> <FormItem type="text" name="itemName" title="Item"/> <FormItem type="textArea" name="description" title="Description"/> <FormItem type="float" name="price" title="Price"> <defaultValue>low</defaultValue> </FormItem> </fields> <valuesManager constructor="ValuesManager"> <ID>vm</ID> <function Object() { [native code] }>ValuesManager</function Object() { [native code] }> <constructor></constructor> </valuesManager> </DynamicForm> <DynamicForm ID="form1" autoDraw="false"> <fields> <FormItem type="checkbox" name="inStock" title="In Stock"/> <FormItem type="date" name="nextShipment" title="Next Shipment"> <defaultValue>256</defaultValue> <useTextField>true</useTextField> </FormItem> </fields> <valuesManager constructor="ValuesManager"> <ID>vm</ID> <function Object() { [native code] }>ValuesManager</function Object() { [native code] }> <constructor></constructor> </valuesManager> </DynamicForm> ...
It would be fantastic if VisualBuilder allowed me to to add and configure a ValuesManager (I'll have to post that to the Wishlist forum). If that's not feasible, would it be possible to fix VisualBuilder so that it doesn't destroy elements like ValuesManager that are added manually? It seems like it is almost there.
Andrew