Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

What is Ajax.InPlaceEditor typical usage ?

 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been looking at script.aculo.us Functional Tests and I found Ajax.InPlaceEditor intresting.
My first impresion of using it was to edit a loaded item (you know, a book, a customer) from the database.
But what if I modified two properties of an item successfuly and the third modification failed ?
I'm not sure when to use this tool.
What is the typical use of Ajax.InPlaceEditor ?
 
Sheriff
Posts: 67601
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see it being used for two major purposes: one as, well, an in-place editor: turning a read-only version of the data into an editable string. This can sometimes be quicker and easier than bringing up an edit page or an edit dialog. Another is to reformat data on-the-fly using the served-side assist that the in-plce editor allows.
 
Hussein Baghdadi
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, but it is not suitable for my case ?
 
Bear Bibeault
Sheriff
Posts: 67601
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sure. In the book I go into some ways that you can deal with server-side errors using custom response headers.
 
Hussein Baghdadi
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The second parameter to InPlaceEditor constructor is the URL to submit the changed value to.
Suppose I use some kind of a framework to load an item from the database and I want to update some of its data.
Usually (without this editor), we save the loaded item in the action, update its properties, post to a URL such as /updateItem.do
How to configure this editor with a framework like Struts ?
Any on line resources about using InPlaceEditor and Java developement ?
Does your new book's source code contains such examples (Scriptaculous & Java framework) or it does just use Servlets ?
 
Bear Bibeault
Sheriff
Posts: 67601
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by John Todd:
The second parameter to InPlaceEditor constructor is the URL to submit the changed value to.
Suppose I use some kind of a framework to load an item from the database and I want to update some of its data.



What do you mean by "some of its data". You load the data into the control or you don't. There's no "some" in the same way that there's no "some data" for a text field.

Usually (without this editor), we save the loaded item in the action, update its properties, post to a URL such as /updateItem.do



No difference. Except for component-based frameworks like JSF (which are there own deal and don't tend to work or play well with others) frameworks like Struts still work on a typical request-response cycle. So you don't need to do anything differently. The big difference is in what you return as the response. Rather than a full page, you typically return smaller snippets of data.

Does your new book's source code contains such examples (Scriptaculous & Java framework) or it does just use Servlets ?



Not sure what you mean by "such examples". If you mean Struts, then no. I'm not a fan. But it makes no difference as described above.
[ April 02, 2007: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Sheriff
Posts: 67601
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
P.S. Even though I am not a Struts user, I do employ my own Front Controller pattern that I regularly use with Ajax.
 
Hussein Baghdadi
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

What do you mean by "some of its data".


Sorry, I mean an item has three properties : isbn, title, price.
Actually, I have been reading the free chapter 6 of your book and I got a much better vision about this editor.

Rather than a full page, you typically return smaller snippets of data.


Suppose I'm using WebWork, the action served the request and forwared it to a result JSP.
Ofcourse, it is not a complete JSP, a snippets of data as you said.
If validation error accured in the action, can I use the previous JSP to set a specific header (a technique used in your book) ?
And I have another question regarding InPlaceCollectionEditor ...
Rather than hard-coding the possible values for the collection option in JavaScript, is it possible to get the data from the server ?
Does loadTextUrl has a role here ?
BTW, I want to thank you and the authors for this book, I really like it.
 
reply
    Bookmark Topic Watch Topic
  • New Topic