Forum OpenACS Development: Re: Ajax Helper load error

Collapse
3: Re: Ajax Helper load error (response to 2)
Posted by Eduardo Santos on
Hi Hamilton,

Thank you for the answer. I can understand know a little bit more about the new templates, but I guess we have a major problem here.

I've managed to put your new blank-master to work, but the dotlrn toolbar and the ds where being repeated forever. Checking your code I could see that blank-master.adp has the following lines:

list name="header">
@header;noquote@
/list>
slave>
list name="footer">
@footer;noquote@
/list>

This list tag makes no sense to me, and it was making the header and footer to be repeated. I've removed this tag and the page loaded OK. The new lines where like this:

@header;noquote@
slave>
@footer;noquote@

Anyway, my Ajax still don't work. I'm facing this error right now:

$(form) has no properties
getElements("catalog")prototype.js (line 2649)
serialize("catalog", undefined)prototype.js (line 2645)
onkeyup(keyup charCode=0, keyCode=65)add-edit (line 1)
[Break on this error] return $A($(form).getElementsByTagName('*')).inject([],

Firebug tells me that this error comes from the prototype.js file in line 2649. My JavaScript knowledge is poor, but can we use dolar quoting to indicate that it's a var (I mean $var) as we do in TCL? Do you think this issue has something to do with this error or are we facing another problem?

I still have another concern. Checking out HEAD version of OpenACS template files, I can see your files and OpenACS files are very different and it affects the entire system. Take a look at this diff (I know it's a little messy, but you can get my point from there):

http://www.softwarepublico.gov.br/dotlrn/file-storage/download/blank-master.diff?file%5fid=2925174

There are a lot of vars in OpenACS version wich are not in your file and your files also have big differences, mostly in blank-master.tcl. So, my doubt is: wich one should I use? It seems to me that your file has some problems about Xinha loading, but I can't say this for sure.

There's also a big difference in head-procs.tcl and acs-integration-procs.tcl (from the files in ajaxhelper and the other ones in acs-templating/tcl HEAD). Wich ones are the best for use? I guess I'm a little lost here.

Thank you very much for your help and all your work on this.

Collapse
4: Re: Ajax Helper load error (response to 3)
Posted by Hamilton Chua on
Hi Eduardo,

I took some time to check the changes on OpenACS head and you're absolutely right, the files I included in my www/docs are now outdated. My bad for not keeping up 😊

I included copies of those files in www/docs because at the time template::head wasn't in CVS head yet but now they are so I'll be removing them on my next update. I will update the docs too.

Please use the ones from cvs head.

I just committed a change in head-procs.tcl which solves the error about prototype being required, so please get a fresh copy of head-procs.tcl from cvs head.

Now about that javascript error.

Do you have an id for your form ?

The error indicates that it can't find the form element.

Maybe instead of $(form), try using $("formid") where formid is the id you give your form.

Your form should look like &lt form id="formid" ... &gt

If you're using ad_form I believe you can add it in the html parameter like -html {id "formid"}

Thanks for trying out ajaxhelper and do let me know if this helped.

Thanks,

Hamilton

Collapse
5: Re: Ajax Helper load error (response to 4)
Posted by Eduardo Santos on
Hi Hamilton,

Sorry about the delay. I had to perform a lot of tests before I'm sure everithing is working.

I'm using now HEAD versions of all the files (the whole master stuff and the templating procs) and it seems to be working now. However, I had to manually setup the form id using the html id. It seems to me that ad_form is not parsing the right DOM information to the form. I uses a hidden input named form:id, and firefox doesn't see that as the form id.

Maybe someone need to change the ad_form API to improve DOM integration?

Thank you very much for your help. Everything is working now.