What about something like this:

                                        <span jwcid="@Foreach"
source="ognl:object.options" value="ognl:item" element="tr">
                                                <td><input type="text"
jwcid="@Insert" value="ognl:item.value"/></td>
                                                <td><input type="text"
jwcid="@Insert" value="ognl:item.text"/></td>
                                            
                                            <td><input type="submit"
jwcid="@Submit" listener="ognl:listeners.moveUp" selected="ognl:actedOn"
tag="ognl:item" label="Move Up"</td>
                                            <td><input type="submit"
jwcid="@Submit" listener="ognl:listeners.moveDown" selected="ognl:actedOn"
tag="ognl:item" label="Move Down"</td>
                                                        <td><input
type="submit" jwcid="@Submit" listener="ognl:listeners.moveDelete"
selected="ognl:actedOn" tag="ognl:item" label="Delete" onClick="return
confirmDelete()"</td>            
                                            
                                        </span>

        Then just have your listener check the value of actedOn to see which
particular object was the target of the action?

        --- Pat

> -----Original Message-----
> From: Mark Shead [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 02, 2005 5:38 PM
> To: Tapestry users
> Subject: RE: What to replace ActionLinks with?
> 
> So going forward is Tapestry going to no longer support transparently
> working with objects across a request response cycle?  Is there going to
> be a way to take an object that is in a list on a page and perform an
> action on it without using an id and looking the object up again?
> 
> --Mark
> 
> 
> -----Original Message-----
> From: Alan Chandler [mailto:[EMAIL PROTECTED]
> Sent: Wed 11/2/2005 5:17 PM
> To: [email protected]
> Subject: Re: What to replace ActionLinks with?
> 
> On Wednesday 02 Nov 2005 21:50, Mark Shead wrote:
> > I have a page that lists names like this:
> > Bob Martin _edit_ _delete_
> > Tom Smith  _edit_ _delete_
> > Greg Jones _edit_ _delete_
> >
> > The _edit_ and _delete_ are hyperlinks that bind to something like:
> >
> > <a jwcid="@ActionLink" listener="listener:deleteEntry">delete</a>
> >
> > However I see that ActionLink is deprecated.  So I tried replacing it
> > with a DirectLink, but now it gives me an error saying:
> 
> Heres one I do in a loop.  See how the parameters defines two parameters
> 
> <a jwcid="@DirectLink" listener="listener:doMarriage" parameters="ognl:
> {relationship.spouse.id,marriage.m_no}">
> <span jwcid="@Insert" value="ognl:marriage.DOD">~May 2005</span>
> 
> 
> >
> >  attempt to create delete event with null entity
> >
> > The listener looks like:
> >
> >     public void deleteEntry(IRequestCycle cycle) {
> >             PhoneBook book = PhoneBook.getInstance();
> >             book.delete(getSelectedEntry());
> >     }
> 
> 
> My listener looks like this
> 
>       @InjectPage("MarriagePage")
>       public abstract MarriagePage getMarriagePage();
> 
>       public MarriagePage doMarriage(Integer spouseId, Short mno) {
>               Marriage marriage = getMarriage();
>               if (getPerson().getGender().isMale()) {
>                       marriage.setHusband(getPerson().getId());
>                       marriage.setWife(spouseId);
>               } else {
>                       marriage.setWife(getPerson().getId());
>                       marriage.setHusband(spouseId);
>               }
>               marriage.setM_no(mno);
>               MarriagePage marriagePage = getMarriagePage();
>               marriagePage.setFunction(Function.EDIT);
> 
>               return marriagePage;
>       }
> 
> The getMarriage() and getPerson functions are retrieving a session scoped
> application state objects which have been populated by @Textfields on this
> current page.
> 
> ...
> 
> --
> Alan Chandler
> http://www.chandlerfamily.org.uk
> Open Source. It's the difference between trust and antitrust.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to