Announcement

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

    Restdatasource not sending/generating detail/hidden Fields

    SmartGWT Version: v8.1p_2012-06-12/LGPL Development Only

    Browser: Google Chrome Version 24.0.1312.57 m

    3. The problem is client side

    i'm having the problem, that if i set a DataSourceTextField in my ListGrid to "hidden" or "detail" (it's some kind of generic id which i send from my server to the client) and want to implement a new Row with a generated Record.

    When i'm using "detail" as Type for the DataSourceTextField the Record i created inserts nothing for the Id Field and transfers "null" to the Server,if the field is visible to the ListGrid everything works correct.

    if i set the DataSourceTextField to "hidden", the id field doesn't even appear in the Request being sent to the server.

    Thanks, d2k

    #2
    What do value you expect the hidden field to have when sent to the server if nothing is entered?

    Comment


      #3
      some more informations...

      i have a grid with the Fields "addid" and some other fields,
      addid is a id generated by the server and sent by him to the client(it's just because i got problems with add/update stuff when i'm using embedded id's).
      this field is either set to "hidden" or "detail" so that it won't be displayed to the user in the client.

      for instance when i add a new row with:

      Code:
      HashMap<String, String> map = new HashMap<String, String>();
      		for (ListGridField field : fields) {
      			all += field.getName() + "";
      			if (field.getName().equalsIgnoreCase("addid")) {
      				map.put(field.getName(), String.valueOf(num));
      				num++;
      			} else
      				map.put(field.getName(), "");
      
      		}
      
      		Record reco = new Record(map);
      
      		KGrid.this.startEditingNew(reco);
      	KGrid.this.selectSingleRecord(KGrid.this.getDataAsRecordList().last());
      like this it generates me a new record, and the value "num" is written into the line. if i enable setHidden or setDetail, it inserts inte the record "null" for the addid - the same problem if i change the visibility of the fields via rmb in the filter menu.

      Comment


        #4
        Be sure to add the hidden field to the ListGrid fields definition or set useAllDataSourceFields on the ListGrid. Any field that will receive an edit value must be part of the grid. If marked hidden it will not show as part of the UI.

        Comment

        Working...
        X