File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Ajax.InPlaceEditor and manual enterEditMode Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Ajax.InPlaceEditor and manual enterEditMode" Watch "Ajax.InPlaceEditor and manual enterEditMode" New topic
Author

Ajax.InPlaceEditor and manual enterEditMode

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

I am using Scriptaculous' Ajax.inPlaceEditor. I have a page where I upload a file and then I presented with 1+n images. Each image has a name but the name can be changed. Simple enough. I click on the name which is in a DIV and the inPlaceEditor takes over and all is well.

However, the client wants a Change link so the user understands better they can change something. I guess highlighting the text and having a tool tip that says "Click to Change" as well as changing the mouse cursor to a pointer isn't enough. :roll:

So, I know I can do something like:

var editor = new Ajax.InPlaceEditor('product_1',...);
editor.enterEditMode('click');

And if I only had one of these on a page it would be fine. But as it turns out I could have up to 50 maybe. So I need a way to clicking on the link and choosing the appropriate editor to turn on edit mode.

My first thought is as I create a new InPlaceEditor I can put it in an array with a key of the image ID or an index of some sort. When I click the change link I could look up that editor instance in the array and call the enterEditMode function on it. I am getting ready to try this but thought I would also see if anyone else has any other good suggestions.

Some things to consider. The piece of HTML that contains the InPlaceEditor code in coming back from an Ajax request. So my code looks something like:


[ May 01, 2007: Message edited by: Gregg Bolinger ]

GenRocket - Experts at Building Test Data
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

Ok, the above solution I described works. Still wondering if there is a better way.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ajax.InPlaceEditor and manual enterEditMode