Have you tried using a ComponentAddress object to find the component? -----Original Message----- From: Mike Snare [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 28, 2006 8:57 AM To: Tapestry users Subject: Re: Setting a component property in another page
Are you trying to set a property of component that is contained within a page? How do you have any idea that the instance of ConversationInfoJwc you are getting is the one used by the ItemPage you are getting? I think you have to assume that it isn't. I think you need an ID setter on the ItemPage. This could be used by the page as a parameter to the ConversationInfoJwc component used by the page. -Mike On 3/28/06, Nima Boustanian <[EMAIL PROTECTED]> wrote: > Hey all > > Okay, I thought this was easy but I've been trying to set a component > property for a couple of hours now without getting anywhere. > > First off, I have my page class along with a listener method: > .. > public abstract Long getPostId(); > public abstract void setPostId(Long postId); > > @InjectPage("Item") > public abstract IPage getItemPage(); > > public IPage selectAction(Long postId) { > //No code here yet. Just an empty listener. > } > > public void setNextPageProperties(IRequestCycle cycle) { > ConversationInfoJwc conversationInfoJwc = > (ConversationInfoJwc) cycle.getPage("ConversationInfo"); > //The component where I want to set the property in > conversationInfoJwc.setPostId(getPostId()); > cycle.activate(getItemPage()); //The page which contains the > component > } > ... > > Which is called by: > ... > <span jwcid="@DirectLink" listener="listener:selectAction" > parameters="ognl:components.table.tableRow.id"> <span jwcid="@Insert" > value="ognl:components.table.tableRow.title"/> </span> > ... > > I want to set the property of ConversationInfoJwc which is contained in > the Item page somehow, but don't know how one should go about to > do it. I don't even know if the IRequestCycle is the proper interface to > use when trying to set component parameters, are there other ways of > doing this? > > > Thanks! > > --------------------------------------------------------------------- > 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]