Been fighting trying to add a row to a table using prototype Ajax. I've tried a couple methods and keep running into road blocks. Maybe too much Ajax

dsp_addPO.a4d loads a page with a form
a pulldown in the form calls Ajax and loads a detail page depending on selection (works)

One detail page has a table of line items. The table is populated with data from a session collection populated by a qry_x.a4d include. The table is build and a link "Add Catalog Item" makes another Ajax call to add a row.

My first brut force attempt was to pass the innerhtml to the Ajax.updater, have the called method add the new row and replace the innerhtml. with a get request, data was truncated ( - expected since not encoded and can't find an encode parameters in prototype) with a post request using /4dcgi I get a server error from 4D. Without 4dcgi, I get and active4D error, data not in right format.

Second approach was to serialize the form data and rebuild the table from any modified elements. for some reason the Form.serailize('id') does not recognize the form elements that were loaded with the first Ajax call that loaded the details.

Anyone have another approach?

Again, maybe too much Ajax. Could just add a submit button to form "Add Catalog Item" and rebuild the session collection with the added row and rebuild the page.

Steve



_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to