• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Hyperlinks and action methods
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Hyperlinks and action methods


  • Subject: Hyperlinks and action methods
  • From: "Chris Meyer" <email@hidden>
  • Date: Sun, 30 Mar 2008 19:44:23 -0700

One pattern I find myself using often is that I have a page listing my objects (PeopleList) and a detail page (PersonDetail).

In my PeopleList component, I have a WORepetition of WOHyperlink's linking to specific PersonDetails.

To facilitate the hyperlink, I have an action in PeopleList.java that creates a new PeopleDetail page and sets the iterated Person in the WORepetition into a variable on that new page.

My questions:

Is this the right design pattern to use?

If so, is there any way to use ognl or some other mechanism to avoid writing the action method in PeopleList.java that loads the new page and sets the Person variable on the new page?

If not, is there any fundamental reason why this cannot be done automatically (with some syntax modifications/improvements in the WOParser, or whatever)?

PeopleList.wo:

<ul>
<wo:WORepetition list="people" item="person">
<li><wo:WOHyperlink action="" value="$person.name"/></wo:WOHyperlink></li>
</wo:WORepetition>
</ul>

PeopleList.java

class PeopleList
{
  public Person person;

  // can this be avoided?
  public WOComponent gotoPersonDetail()
  {
    PersonDetail pd = (PersonDetail)pageWithName(PersonDetail.class.getSimpleName());
    pd.person = person;
    return pd;
  }
}

PersonDetail.java

class PersonDetail
{
  public Person person;
}

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Hyperlinks and action methods
      • From: David LeBer <email@hidden>
  • Prev by Date: Re: Is Adding EOAttribute to EOEntity Thread Safe?
  • Next by Date: Re: Hyperlinks and action methods
  • Previous by thread: Re: Is Adding EOAttribute to EOEntity Thread Safe?
  • Next by thread: Re: Hyperlinks and action methods
  • Index(es):
    • Date
    • Thread