Announcement

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

    Hint in TextItem and markForRedraw results in empty FormItem

    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

    #2
    The workaround here would seem to be just to not call markForRedraw(), which is unnecessary here anyway.

    We'll queue this up to be reviewed anyway, but just to set expectations, it's going to be marked very low priority since there doesn't appear to be a use case where a sequence of calls like this would be needed and would create an issue.

    Comment


      #3
      Hi,
      thank you for your fast reply. You are right, in the example shown previously, the markForRedraw was unnecessary (since it was only an example). But there are situations, where it is necessary.

      For example if there are two options for the user to choose.
      Choosing the first option, the user only needs to enter information into the first TextItem -> the second TextItem would be hidden (= causes the form automatically to redraw).
      For option 2 the user needs to enter further information into both TextItems -> the second textitem will be shown again, which again causes the form to redraw automatically.

      Hopefully i could show the usecase - in fact that is a usecase in our application.

      Here is the adapted 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("");
      					theTextItem2.hide();					
      				},
      				"title" : "Option 1",
      			}),
      			isc.Button.create({
      				"width" : 200,
      				"click" : function () {
      					theTextItem.setValue("");
      					theTextItem2.setValue("");
      					theTextItem2.show();
      				},
      				"title" : "Option 2",
      			})
      			]
      		}),
      		isc.DynamicForm.create({
      			"ID":"theForm",
      			"width" : "100%",
      			"readOnlyDisplay" : "static",
      			"fields":
      			[
      				{
      				"ID" : "theTextItem",
      				"title" : "Information 1",
      				"type" : "text",
      				"hint" : "this is the hint",
      				"showHintInField" : true
      				},
      				{
      				"ID" : "theTextItem2",
      				"title" : "Information 2",
      				"type" : "text",
      				"hint" : "this is the hint",
      				"showHintInField" : true
      				}
      			],
      				"values" : {
      					"theTextItem" : "",
      					"theTextItem2" : "",
      				}
      		})
      	]
      })
      Best regards

      Comment


        #4
        We've made a change to address this issue. Please try the next nightly build dated April 23 or above

        Regards
        Isomorphic Software

        Comment


          #5
          Thanks, confirmed for build v10.0p_2015-04-24 and after :)

          Regards

          Comment

          Working...
          X