I've been playing with InlineEditBox and I have a few questions.

First, my use case: I have a project which has a set of notes. Both project and note are hibernate objects. You can add as many notes as you want to a project. It's nice to be able to edit the note text inline.

So I list the notes:

    <parameter name="project" required="true"/>
    <property name="note"/>

    <component id="forEachNote" type="For">
        <binding name="source" value="ognl:project.notes"/>
        <binding name="value" value="ognl:note"/>
    </component>

and I make the note text editable:

    <component id="noteText" type="InlineEditBox">
        <binding name="value" value="ognl:note.text"/>
    </component>

So this works fine, except that I need a chance to update the object back to the db. I've noticed that without doing anything more, InlineEditbox submits a form asynchronously when I hit save.

GET /timesheets/app? component=projectNotes.noteText&page=ProjectDetails&service=direct&sessi on=T&noteText=Project%20still%20on-going%20as%20per% 20Fred.&dojo.preventCache=1184792811048 HTTP/1.1

How do I get a hook on that? What is generating the response? How can I get the id of my note into that form? - placing the InlineEditBox within a form component results only in a nested form, so using a hidden field doesn't accomplish anything.

I can hook up an eventlistener to the onSave event and then I'm notified, but now we have two request responses, which seems unnecessary. Plus I need to do a bunch more infrastructure work to get at the note text and id, since I can't just use the persist annotation with my hibernate objects. Maybe I will need to do that work anyway...

I guess my question really boils down to: what is the intended way to use InlineEditBox? With the eventlistener annotation? With a hook onto that first request? Some other way I'm not seeing? All I need is the id of the note and the note text to make my save.

Thanks,

J

--
Julian Wood
Web, E-Mail, and Middleware Services
University of Calgary Information Technologies,
2500 University Drive, Calgary, Alberta, Canada T2N 1N4
(403) 220-5868

Reply via email to