Inject the item page via an annotation.

get it, set the property, and return it all in your select action:

// returns the page to go to
public ItemPage selectAction(Long postId) {
  //Grabs the postId from a directLink parameter
  //setPostId(postId); don't think you need this...
  ItemPage ip = getItemPage();
  ip.setPostId(postId);
  return ip;
}

Will that work for you?

On 3/28/06, Nima Boustanian <[EMAIL PROTECTED]> wrote:
> Okay guys, I took your advice and made the appropriate changes (am using
> the InjectComponent annotation, made a page property
> that maps to the component property and so forth.)
>
> The only thing that's left is that I can't figure out how to call the
> goItemPage method in the first page class:
>
> public abstract Long getPostId();
> public abstract void setPostId(Long postId);
>
> public void selectAction(Long postId) {     //Grabs the postId from a
> directLink parameter
>        setPostId(postId);
>        //Now that we have the postId, how can we call the next method
> which sets the property and takes us to the next page?
> }
>
> public void goItemPage(IRequestCycle cycle) {
>        Item itemPage =
>            (Item) cycle.getPage("Item");
>        ....
>    }
>
> Any further suggestions or do's or don't's?
>
> Thanks!
>
> Mike Snare wrote:
>
> >Doesn't it make more sense to set the value on the page and have the
> >page deal with it however it needs to -- in this case by setting the
> >id on the component in the page.
> >
> >It seems that the components used by a particular page are
> >implementation details for that page that should not be exposed when
> >there is another solution.  The user of the page doesn't need to know
> >about the Conversation component, only that the page needs an id to do
> >it's job.  Law of demeter and all that...
> >
> >-Mike
> >
> >---------------------------------------------------------------------
> >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]

Reply via email to