Announcement

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

    Possible bug in Select FormItem

    Hello,
    We are using SmartClient_80_Pro.
    I have a value map for a select form item, where the display of one item equals the value of another item:
    var map = new Object();
    map["39"]="144";
    map["144"]="ARM"
    When "ARM" is selected, the selectItem.getValue() will show "39" instead of "144".

    Here is a test case:
    <HTML><HEAD>
    <SCRIPT>var isomorphicDir="../isomorphic/";</SCRIPT>
    <SCRIPT SRC=../isomorphic/system/modules/ISC_Core.js></SCRIPT>
    <SCRIPT SRC=../isomorphic/system/modules/ISC_Foundation.js></SCRIPT>
    <SCRIPT SRC=../isomorphic/system/modules/ISC_Containers.js></SCRIPT>
    <SCRIPT SRC=../isomorphic/system/modules/ISC_Grids.js></SCRIPT>
    <SCRIPT SRC=../isomorphic/system/modules/ISC_Forms.js></SCRIPT>
    <SCRIPT SRC=../isomorphic/system/modules/ISC_DataBinding.js></SCRIPT>
    <SCRIPT SRC=../isomorphic/skins/TreeFrog/load_skin.js></SCRIPT>
    </HEAD><BODY>
    <SCRIPT>
    try {
    sfsForm.show();
    } catch (err) {
    isc.DynamicForm.create({
    autoDraw:true,
    cellPadding:2,
    cellBorder:0,
    numCols:3,
    ID:"sfsForm",
    titleOrientation:"top",
    wrapItemTitles:false,
    fields: [
    {name: "sfsFormType",
    ID:"sfsFormType",
    title:"Form Type",
    defaultToFirstOption:true,
    type:"select",
    multiple:true,
    multipleAppearance:"grid",
    width:240,
    height:100,
    startRow:false,
    endRow:true
    },
    {
    name:"sfsSubmitBtn",
    ID: "sfsSubmitBtn",
    title:"Search",
    _constructor:"SubmitItem",
    startRow:false,
    endRow:true,
    width:80,
    click: function(){
    alert(sfsFormType.getValue());
    alert(sfsFormType.getDisplayValue());
    },
    showTitle:false
    }
    ]
    });
    }
    var map = new Object();
    map["39"]="144";
    map["144"]="ARM"
    sfsFormType.setValueMap(map);
    </SCRIPT>
    </BODY></HTML>


    Any suggestions on how to get around this?

    Thanks!

    #2
    This is a known limitation resolved after 8.0. If you need to work around it in 8.0 you can modify the data so te condition doesn't arise, for example, prefix all the IDs and remove the prefix later when saving.

    Comment

    Working...
    X