You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Julian Wood <wo...@ucalgary.ca> on 2007/07/19 00:10:09 UTC
InlineEditBox questions
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¬eText=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
Re: InlineEditBox questions
Posted by Julian Wood <wo...@ucalgary.ca>.
https://issues.apache.org/jira/browse/TAPESTRY-1656
J
On 18-Jul-07, at 7:15 PM, Jesse Kuhnert wrote:
> Good point. If you add a JIRA issue for it it should be super easy
> for to
> add a "listener" parameter.
>
> On 7/18/07, Julian Wood <wo...@ucalgary.ca> wrote:
>>
>> 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&se
>> ssi
>> on=T¬eText=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
>>
>>
>
>
> --
> Jesse Kuhnert
> Tapestry/Dojo team member/developer
>
> Open source based consulting work centered around
> dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
--
Julian Wood
Web, E-Mail, and Middleware Services
University of Calgary Information Technologies,
2500 University Drive, Calgary, Alberta, Canada T2N 1N4
(403) 220-5868
Re: InlineEditBox questions
Posted by Jesse Kuhnert <jk...@gmail.com>.
Good point. If you add a JIRA issue for it it should be super easy for to
add a "listener" parameter.
On 7/18/07, Julian Wood <wo...@ucalgary.ca> wrote:
>
> 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¬eText=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
>
>
--
Jesse Kuhnert
Tapestry/Dojo team member/developer
Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com