Sigma Php Ajax framework, Ajax Components, GUI Builder
May 23, 2012, 12:45:39 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: SetValue for TextBox with DataBinder in customAppend function fails  (Read 594 times)
ludwigl
Sr. Member
****
Posts: 47


View Profile
« on: August 12, 2010, 02:26:10 AM »

Hello linb,

I am using V3.0 R964.

In my application I open a dialog in which I want to display data in a textbox.
To do this, I fill the databinder, which is connected to the dialog, in the customappend function with a value and use resetValue to set the data to the ui controls. Unfortunately this does not work for the textbox, although it works for other ui controls like input.

Firefox (3.6.Cool  just hangs and IE8 shows an error in ths file adv_debug.js in line 463.

      _setCtrlValue:function(value){
            if(_.isNull(value) || !_.isDefined(value))value='';
            return this.each(function(profile){
                var node=profile.getSubNode('INPUT').get(0);
463                if(node.value.replace(/(\r\n|\r)/g, "\n")!=value.replace(/(\r\n|\r)/g, "\n")){
                       var st=node.scrollTop;
                       node.value=value;
                       node.scrollTop=st;
                }
            });
        },

The problem is that node is not defined, which might be caused by the fact that the UI control does not yet exist.

So my question is, should I initialize the ui control values differently/later or is it possible to fix this bug?

Please find the source code files (index.js and MyDialog.js) of my example attached.
(please click the button "ShowDialogWithTextBoxInit" to reproduce the problem)

Thanks a lot in advance for your help,

Ludwig
Logged
linb
Administrator
Hero Member
*****
Posts: 435


View Profile
« Reply #1 on: August 12, 2010, 02:51:10 AM »

in customAppend, call "this.render()" first.
Logged
ludwigl
Sr. Member
****
Posts: 47


View Profile
« Reply #2 on: August 12, 2010, 04:51:54 AM »

Hello Linb,

thank you for the workaround and the fix in R966  Wink.

With best regards,

Ludwig
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!