Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Dynamic form, valuesManager and arraylist of data

    SmartClient Version: SC_SNAPSHOT-2010-08-03/EVAL Deployment (expires 2010.10.02_09.35.33) Licensed to: Isomorphic Software (#ISC_EVAL_NIGHTLY)

    In a nutshell:

    I have a valuesmanager linked to my main datasource (called sessDTO)
    this datasource contains 3 array lists of other datasources.

    I couple this main datasource to a valuesManager and the valuesManager to each component I create. Each component is then also set to the correct sub-datasource and using setDataPath the data is retrieved from the main datasource.

    When calling the executeFetch on the valuesManager and using ListGrids for all sub-datasources, it works (in other words: the data is binded to the components).

    Using the same setup, but changing one of the listgrids into a DynamicForm no data is displayed in the form?

    So my question boils down to: how do I get record[0] from my arraylist into the form? Keep in mind that I am using a valuesManager. To be honest, this seems pretty trivial, but there doesn't seem to be a straight forward way to do this.

    Regards,
    Bart

    Code:
    <DataSource ID="SessDTO" dropExtraFields="true">
    <fields>
    <field name="selection" type="selectionDS" javaClass="selection.SelectionDTO" multiple="true" />
    <field name="conditionItems" type="conditionItemDS" javaClass="selection.ConditionItemDTO" multiple="true" />
    <field name="displayItems" type="displayItemDS" javaClass="selection.DisplayItemDTO" multiple="true" />
    </fields>
    <serverObject ID="SearchSessStore" lookupStyle="new" className="server.stores.search.SearchSessStore"/>
    </DataSource>
    Code:
    public class SearchPanel extends Canvas {
    
    	public SearchPanel() {
    		
    		valueMgr = new ValuesManager();
    		this.setValuesManager(valueMgr);
    
    
    		DynamicForm selection = new DynamicForm();
    		selection.setValuesManager(valueMgr);
    		selection.setDataPath("selection");
                              selection.setDataSource("selectionDS");
    				
    		ListGrid conditions = new ListGrid();		
    		conditions.setValuesManager(valueMgr);
    		conditions.setDataPath("conditionItems");
                              conditions.setDataSource("conditionItemDS");
    		
    		ListGrid displayitems = new ListGrid();			
    		displayitems.setValuesManager(valueMgr);
    		displayitems.setDataPath("displayItems");
                              displayitems.setDataSource("displayItemDS");
    
                             valueMgr.setDataSource("sessDTO");
                             
                              ...
    
                             valueMgr.fetchData();
    
                 }
    
    }
    Last edited by bade; 31 Aug 2010, 04:55.

    #2
    Can you show the data delivered to the browser as shown in the RPC tab, and the version of the code which works?

    What are you hoping will happen - that the form begins editing the first record in an Array? What should happen to the rest of the data?

    Why are you taking this approach over having separate DataSources? That's usually better, and more flexible.

    Comment


      #3
      What are you hoping will happen - that the form begins editing the first record in an Array?
      Maybe I'm a bit naive but, yes, I was hoping that the form begins editing the first record.

      What should happen to the rest of the data?
      I should think that the rest of the data is there, but not "displayed".

      I was thinking of implementing a mechanism to navigate trough the rest of the data via a previous/next-button (or something).

      Why are you taking this approach over having separate DataSources? That's usually better, and more flexible.
      We are working with a backend that already takes care of saving the data "in the right order", so this approach eliminates the need to implement queueing.
      Something that would be necessary if we would work with seperate datasources.

      Comment


        #4
        You should take a second look at implementing separate DataSources. You're starting down a more challenging path usually reserved for legacy situations and WSDL web services, and you seem to have a misconception that you would need to "implementing queuing" whereas queuing is actually automatic if you just implement DataSources that are capable of each CRUD operation.

        Comment

        Working...
        X