Announcement

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

    Error in custom dialog in SmartClient 8.1 with FF

    Hello,
    I have a custom dialog which used to work in 8.0, but now it doesn't behave the same. Also, I've noticed the following exception in the console:

    Code:
    00:00:55.378:MUP4:WARN:Log:TypeError: this.messageIcon is undefined
        unnamed("Remove [<b>ToBeRemoved</b>]?", {Obj})
        unnamed("Remove [<b>ToBeRemoved</b>]?", "say", "", {Obj})
        unnamed("Remove [<b>ToBeRemoved</b>]?", "", {Obj})
        confirmRemove("ToBeRemoved") @ dialog.htm:178
        unnamed({Obj}, undef) @ dialog.htm:65
        StatefulCanvas.handleActivate(_1=>{Obj},  _2=>undef)
        StatefulCanvas.handleClick(_1=>{Obj},  _2=>undef)
        [c]EventHandler.bubbleEvent(_1=>{Obj},  _2=>"click")
        [c]EventHandler.handleClick(_1=>{Obj})
        EventHandler._handleMouseUp([object MouseEvent], undef)
        [c]EventHandler.handleMouseUp(_1=>[object MouseEvent])
        [c]EventHandler.dispatch(_1=>isc_c_EventHandler_handleMouseUp,  _2=>[object MouseEvent])
        anonymous([object MouseEvent])
        unnamed() @ :0
        unnamed() @
    The test code is the following:
    Code:
                   isc.Button.create({
    			title : "Remove",
    			click : function() {
    				confirmRemove("ToBeRemoved");
    			},
    			position : "absolute",
    			top : 50,
    			left : 200
    		});
    
    		function confirmRemove(name) {
    			var dialogBtns = new Array();
    			dialogBtns[0] = {
    				title : "Yes",
    				width : 70,
    				click : "dialogRemove.hide();alert('Some remove action');"
    			};
    			dialogBtns[1] = {
    				title : "No",
    				width : 70,
    				click : "dialogRemove.hide();"
    			};
    
    			isc.say("Remove [<b>" + name + "</b>]?", "", {
    				ID : "dialogRemove",
    				title : "Remove",
    				toolbarButtons : dialogBtns,
    				isModal : true
    			});
    		}
    What is the proper way to do it now? Also, it would be nice to have an example of custom dialogs in Samples page.

    Thank you

    Edit: After the dialog box is closed, clicking on Remove button, it won't open the dialog again.
    Last edited by zeratus; 5 Sep 2011, 13:14.

    #2
    It's an error to try to set a global ID for the dialog produced by isc.say(). This would also have caused problems in 8.0, perhaps just not as obviously.

    Comment


      #3
      Thank you for your reply.

      I'm still puzzled on how to to this correctly. How do I close the dialog after the user clicks on a button, without having the ID of the dialog?

      Comment


        #4
        Create your own Dialog - the required code is about the same.

        Comment


          #5
          For those who are looking to create a custom dialog, here is an example

          isc.say like dialog
          Code:
          var dialogBtns = new Array();
          		dialogBtns[0] = {
          		                   title : "Yes",
          		                   width : 70,
          		                   click : "myDialog.hide();alert('Some remove action');"
          		 		  };
          		dialogBtns[1] = {
          		                   title : "No",
          		                   width : 70,
          		                   click : "myDialog.hide();"
          		 		  };
          
          		isc.Dialog.create({
          			ID:"myDialog",
          			message:"Remove [<b>" + name + "</b>]?",
          		    title : "Remove",
          		    toolbarButtons : dialogBtns,
          			isModal : true
          		});
          isc.ask like dialog
          Code:
          var dialogBtns = new Array();
          		dialogBtns[0] = {
          				title : "Ok",
          				width : 70,
          				click :  "myDialogRename.hide();alert(textfil.getValue())"
          						
          		};
          		dialogBtns[1] = {
          				title : "Cancel",
          				width : 70,
          				click : "myDialogRename.hide();"
          		};
          
          		isc.Dialog.create({
          			ID:"myDialogRename",
          			items : [
          				isc.DynamicForm.create(
          						{
          							numCols:1,
          							padding:3,
          							fields: [{ID:"textfil",title:"Rename [<b>" + rename + "</b>]?", type:"text", titleOrientation:"top"}],
          							saveOnEnter:true
          							})
          			],
          		    title : "Rename",
          		    toolbarButtons : dialogBtns,
          		    canDragReposition:true,
          			isModal : true,
          			width:200,
          			height:20,
          			//autoCenter:true,
          			bodyProperties:{overflow:"visible"},
          			overflow:"visible"
          		});
          Cheers ;)

          Comment

          Working...
          X