Announcement

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

    defaultToFirstOption NOT WORK in v11.0 for input type Select with optionDataSource

    Dear all,
    I faced an issue when i try to create an combobox, with data from DataSource where get from dataUrl. on v11.0 of isomorphic smartclient
    Please support to fix the problem, or to understand where is my fault.

    ISSUE description :
    Select option isn't auto-selected to first element if I use optionDataSource instead of valueMap array
    the code below

    Using Browser:
    • Firefox

    Test framework:
    • isc_version=v11.0p_2016-05-14 - not work
    • isc_version=v9.1 working corectly
    Also test on (with add defaultToFirstOption: true and run the example) :
    Code:
    /* //returned requested data to DataSource
    [
        {
            "profile_id": "2317",
            "profile_name": "Main Switch",
            "profile_src_number": "xxxxxxxxxxx",
            "profile_port": "5060",
            "profile_ip": "3.3.3.3"
        },
        {
            "profile_id": "3702",
            "profile_name": "Second Switch",
            "profile_src_number": "31625397988",
            "profile_port": "5060",
            "profile_ip": "2.2.2.2"
        },
        {
            "profile_id": "3312",
            "profile_name": "Test Switch",
            "profile_src_number": "xxxxxxxxxxx",
            "profile_port": "5060",
            "profile_ip": "1.1.1.1"
        }
    ]*/
    
    
    isc.DataSource.create({
        ID: "dsNormalProfiles",
        clientOnly:true,
        dataFormat:"json",
        dataURL: "/data/xmlrpc/get_icall_settings/,
        defaultTextMatchStyle: "substring",
        fields:[
            {name:"profile_id", primaryKey:true},
            {name:"profile_name", type: "text"},
            {name:"profile_src_number", type: "text"},
            {name:"profile_port", type:"text"},
            {name:"profile_ip", type:"text"}
        ]
    });
    
    isc.DynamicForm.create({
        ID: "form_normal_profiles",
        valuesManager:"vm_normal",
        wrapItemTitles: false,
        titleOrientation: "top",
        padding: 10,
        isGroup:true, groupTitle:"Select Profile",
        numCols:1,
        autoDraw: true,
        fields: [
    
            /*--- defaultToFirstOption: true NOT WORK on Select with optionDataSource ----*/
    
            {name:'selProfile2', showTitle: false, width: "*", titleAlign: "left",
                autoFetchData: true, defaultToFirstOption: true,editorType:"select",
                optionDataSource: "dsNormalProfiles", displayField:"profile_name", valueField:"profile_id"
            },
    
            /*---- defaultToFirstOption:true is work on Select with simple valueMap ----*/
    
            {name:'selProfile3', showTitle: false, width: "*", titleAlign: "left",
                autoFetchData: true, defaultToFirstOption: true, editorType:"select",
                valueMap: ["firs", "second", "third"]
            }
        ]
    });
    I think I found a bug in Smart GWT

    #2
    We're showing this feature working as expected, and your code can't be run as is. Try making it self-contained by using a clientOnly DataSource with data provided inline. At that point, when the feature works, you should look carefully at your DataSource - it's probably not returning the data you think it is.

    Comment


      #3
      Dear Administrator,
      I can't provide you access to local webserver for give the requested data, and what I mean is too clear
      please also refer to example as below and screenshots, is example fro your official website
      link:
      Also test on (with add defaultToFirstOption: true and run the example) :
      in edit mode please paste below code instead and run that example on both version, and you will observe bug in ISC Framework
      Code:
      isc.DynamicForm.create({
          top: 25,
          width: 500,
          numCols: 4,
          autoDraw: true,
          fields: [
              {name:"categoryName", title:"Category", editorType:"select", 
               optionDataSource:"supplyCategory", changed:"form.clearValue('itemName');" ,[U] defaultToFirstOption: true[/U] }
          ]
      });
      Attached Files

      Comment


        #4
        We've just made a change which may address this issue for you.
        Please try the next nightly build, dated June 7 or above.
        If the problem persists, please let us know

        Regards
        Isomorphic Software

        Comment

        Working...
        X