Forums / General / ajax front attribute edit

ajax front attribute edit

Author Message

Mickael Robin

Tuesday 25 November 2008 8:43:41 am

Hi,

I just began to discover Ajax and really appreciate the eZ Xajax extension (http://projects.ez.no/ezxajax) that enables to use ajax based extensions such as :
http://projects.ez.no/ezxajax_classattribute
http://ez.no/developer/contribs/applications/star_rating

Working on a "productive web application" projet, I was wondering if someone has already managed to <b>let users edit attributes of an existing content from the "view" view and with Ajax</b> (ie. without reloading the page...)?

For example, changing the value of a "status" attribute (selection datatype) from "to do" to "done" or changing the value of the "name" attribute (text line datatype) after a simple double click...

Thanks in advance for sharing code or ideas :-)

André R.

Tuesday 25 November 2008 1:20:28 pm

Some rough code for something like that supporting most simple datatypes:
http://svn.projects.ez.no/ezcore/trunk/ezcore/modules/ezcore/attribute_edit.php

Post with you preferred js library to this url:
<ezp-www-dir>/ezcore/attribute_edit/<object_id>/<attribute_identifier>/<attribute_value>

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Mickael Robin

Wednesday 26 November 2008 7:22:19 am

Thanks a lot Andre for your answer(s). It will definitely help on the php side.

Now, I need to figure out how to generate and post this url with Ajax so that my page does not refresh when the form is submited.

Do you think the simplest way is to use eZ Xajax ( I'm already waiting for help from this thread : http://projects.ez.no/index.php//ezxajax/forum/general/how_to_pass_variable_from_js_to_php ) or to use another JS library?

Cheers