Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Hint in TextItem and markForRedraw results in empty FormItem

$
0
0
Hey guys,

I want to set a hint in a TextItem, if the set value is an empty string.
This works fine, except when the same event, which sets the value, calls a "markForRedraw" on the form of the TextItem.

You can repduce this behaviour if you click the button 1 and after that the button 2.

Here is an example:
Code:

isc.VLayout.create({
        "width" : "100%",
        "members" : [
                isc.ToolStrip.create({
                        "width" : "100%",
                        "members" :
                        [isc.Button.create({
                                        "width" : 200,
                                        "click" : function () {
                                                theTextItem.setValue("");
                                                theTextItem2.setValue("you pushed button 1");
                                        },
                                        "title" : "Button 1 (without markForRedraw)",
                                }),
                                isc.Button.create({
                                        "width" : 200,
                                        "click" : function () {
                                                theTextItem.setValue("you pushed button 2");
                                                theTextItem2.setValue("");
                                                theForm.markForRedraw();
                                        },
                                        "title" : "Button 2 (with markForRedraw)",
                                })
                        ]
                }),
                isc.DynamicForm.create({
                        "ID" : "theForm",
                        "width" : "100%",
                        "fields" :
                        [{
                                        "ID" : "theTextItem",
                                        "title" : "Textitem 1",
                                        "type" : "text",
                                        "hint" : "this is the hint",
                                        "showHintInField" : true
                                }, {
                                        "ID" : "theTextItem2",
                                        "title" : "Textitem 2",
                                        "type" : "text",
                                        "hint" : "this is the hint",
                                        "showHintInField" : true
                                }
                        ],
                        "values" : {
                                "theTextItem" : "",
                                "theTextItem2" : "",
                        }
                })
        ]
})

This issue is reproducible with the latest nightly SmartClient_v100p_2015-04-21_Pro and all current browser versions (Firefox, Chrome and IE).

Best regards

Viewing all articles
Browse latest Browse all 4756

Trending Articles