Announcement

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

    Create a new Record from a Record : warning skipping __ref

    Hi Isomorphic,

    For a specific behavior I need to create a record from an existing record and remove a specific attribute to skip the validation on this field.

    I create the record with the constructor record(Map)

    Code:
    Map map = getMasterRecord().toMap();
    map.remove(DSOperator.LOGIN);		
    DSRequest req = new DSRequest(DSOperationType.UPDATE, null,new Record(map));
    req.setValidationMode(ValidationMode.PARTIAL);
    statusForm.saveData(new DSCallback() {
    ...				
    }, req);
    When creating the new record I got a warning "WARN:Log:JSO::convertMapToJavascriptObject : skipping __ref in map"

    Is there a way to avoid this warning?
    What is the __ref attribute in a record? What does it means?
    Is there a better way to create a new record from an existing record?

    Regards

    Ju

    #2
    The warning is just letting you know that some internal properties have been removed - it shouldn't cause a problem in your code. We're looking into how it can be suppressed in this situation.

    Comment


      #3
      Can you provide more details on what object getMasterRecord() is retrieving? Given that it contains internal Framework properties, there are a few possibilities, but some of them would have resulted in an infinite loop inside toMap().
      Last edited by Isomorphic; 9 Jan 2015, 12:24.

      Comment


        #4
        The object getMasterRecord() is an object coming from the database.

        Code:
        __ref : com.smartgwt.client.data.Record@d
        NAME : Guest
        rowID : 3
        DESCRIPTION : This is the guest operator. To be used for testing only.
        CONNECTED : false
        APPROVED : true
        BUNIT_NAME : Default
        CREATED : Fri Jan 09 11:51:04 CET 2015
        ENABLED : true
        CREATED_BY : 1
        LAST_LOGIN : Tue Jan 13 11:31:09 CET 2015
        LOGIN : Guest
        UPDATED_BY : 1
        LANGUAGE_CODE : en
        UPDATED : Fri Jan 09 11:51:04 CET 2015
        ID : 4
        BUNIT_ID : 3
        ACTIVE : 1
        LOCKED : false
        _selection_2 : true

        Comment


          #5
          We've added code to Record.toMap() in SGWT 5.1d to skip internal properties such as __ref, which should eliminate the warning. If you provide your SGWT version, we may be able to port it back to that.

          However, we'd appreciate it if you could provide us with some repro code for this, as it's not immediately clear to us why the Record you obtain should have a __ref property in the first place, as it's normally cleared when the Record is built.

          Comment

          Working...
          X