Announcement

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

    Databound ListGrid and SelectItem

    SmartGWT: v8.2p_2012-10-11/PowerEdition Deployment on IE 8

    Hello,

    I have several UI Components (mostly dynamic forms and listgrids) that make up a Record that is eventually sent back to the server via a DMI add call.

    One of these components is a databound listgrid that includes a selectItem.

    The listgrid is bound to
    Code:
    <DataSource ID="carsDS" serverType="generic">
    
    	<fields>
    		<field name="carId" type="long" primaryKey="true" />
    		<field name="brand" type="text" />
    		<field name="licensePlate" type="text" />
    		<field name="ticket" type="select" optionDataSource="ticketDS"
    			displayField="description" valueField="ticketId"/>
    	</fields>
    
    </DataSource>
    and this is the ticket datasource (select item option data source)
    Code:
    <DataSource ID="ticketDS" serverType="generic"  cacheAllData="true">
        
        <fields>   
        	<field name="ticketId" type="text" hidden="true"/>
        	<field name="description" type="text"/> 
        </fields>
    
    	<operationBindings>
    		<binding operationType="fetch" serverMethod="getTickets">
    			<serverObject lookupStyle="spring" bean="dmi" />
    		</binding>
    	</operationBindings>
    
    </DataSource>
    When the required user input is typed in, I gather the data from each component, build a Record and make a DMI add call.

    The problem occurs when data is gathered from the ListGrid in question. I get the records from that ListGrid by calling the getDataAsRecordList() method. However, I can see that the user input on the ListGrid's SelecteItem is not included in the DSRequest.

    The console output includes a DSRequest of:
    Code:
    cars:[
                {
                    brand:"brand1",
                    carId:1,
                    licensePlate:"license plate 1",
                    _selection_1:false
                },
                {
                    brand:"brand2",
                    carId:2,
                    licensePlate:"license plate 2",
                    _selection_1:true
                }
    while the developer's console has:
    Code:
     "cars":[
                {
                    "brand":"brand1", 
                    "carId":1, 
                    "licensePlate":"license plate 1"
                }, 
                {
                    "brand":"brand2", 
                    "carId":2, 
                    "licensePlate":"license plate 2"
                }
            ],
    Please find both full output files attached

    Is this supposed to work or did I take a wrong approach ?

    Any hints would be appreciated.
    Attached Files

    #2
    See the Grid Editing overview, paying special attention to editValues vs the values in Records.

    Comment


      #3
      Thank you !

      Comment

      Working...
      X