Topic: createInput doesn't work

Hi, I'm having problems using the 0.5 RC1 createInput method.

First I create a div using 'create' method, and then I use it as parent for an input using 'createInput' method:

[code=php]
$objResponse = new xajaxResponse();
$objResponse->create ('container','div','inputDiv');
$objResponse->createInput ('inputDiv','checkbox','select_01','select_01');

return $objResponse;
[/code]

Using the code from above the div is created correctly but the input isn't created, as if I hadn't used the createInput method.

To reach my objective I have to use the 'create' method also for the input. I think this is not the good way, it's much better to use 'createInput', but for an unknown reason it doesn't work. This is the code that works for me:

[code=php]
$objResponse = new xajaxResponse();
$objResponse->create ('container','div','inputDiv');
$objResponse->create ('inputDiv','input','select_01');
$objResponse->assign ('select_01','type','checkbox');
[/code]

Could it be a xajax bug?

Thank you very much.

Regards.

Re: createInput doesn't work

Hi ggpascual,

yep, you've hit a bug! Thanks for reporting this issue. I've fixed the issue in SVN now. smile

3 (edited by ggpascual 2008-08-12 12:23:05 PM)

Re: createInput doesn't work

Hi, thank you for your fast reply. I'd like to say something about my previous post. The provisional "solution" that I gave using the method "create" instead of "createInput" does not work properly in Internet Explorer. The input is created, but the "type" attribute is not correctly interpreted by IE, so IE shows it as a text type input.

Thank you very much.

Regards.

Re: createInput doesn't work

Hi again, I've downloaded these files from SVN:

http://xajax.svn.sourceforge.net/viewvc … ax_core.js
http://xajax.svn.sourceforge.net/viewvc … pressed.js

I've replaced the original 0.5 RC1 files with the files I've just downloaded but I have still the same problem. Maybe I forgot something?

Regards.

Re: createInput doesn't work

That's odd..the files are correct. Please make sure that you don't have an old JS file in your browser cache. I took your example function and put it in my testing script here Does that one work for you?

Re: createInput doesn't work

You were right. It works perfect now! Your example and my own script are running without problems. Thank you very much for your great work.

Regards.

Re: createInput doesn't work

I'm glad to hear that it's now working smile

Re: createInput doesn't work

I cannot get xajax.forms.createInput to work. The script is as simple as this:

xajax.forms.createInput('test', 'text', 'testname', 'myId');

Using RC2

Re: createInput doesn't work

After examining the code, it works like this:

xajax.forms.createInput({id:'ft', type:'text', data:'testname', prop:'myId'});

What is with that change from beta 4???

Re: createInput doesn't work

That's correct, the syntax has changed since beta4. Ctc changed some function calls, I would have to make a diff between beta4/rc2 to name all, sorry.