• 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
Re: [Newbie] WOHyperlinks with Id
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Newbie] WOHyperlinks with Id


  • Subject: Re: [Newbie] WOHyperlinks with Id
  • From: Deirdre Saoirse Moen <email@hidden>
  • Date: Mon, 26 Apr 2004 19:22:32 -0700

On Apr 26, 2004, at 5:32 PM, Lucas Haley wrote:

I have a WORepetition in a table set up, listing off dates and headlines for a news archive. I would like to have each headline be a hyperlink to reload the current page with the related news item content. The way I figure it is that I would need to make each WOString headline be contained in a WOHyperlink. This would then be bound to an action that sets a key, and returns null. But I have yet to get into the WebObjects mindset, and don't know how to get the newsId key from the WORepetition and into the next page.

OK, here's how I do it. I have a page named PanelList that lists the panels. It calls PanelEdit to edit the panels.


In PanelList.html:

		<WEBOBJECT NAME="panelGuests">edit</WEBOBJECT></td>

In PanelList.wod:

panelGuests: WOHyperlink {
	action = panelGuests;
}

In PanelList.java:

    public PanelEdit panelGuests()
    {
        PanelEdit nextPage = (PanelEdit)pageWithName("PanelEdit");
		nextPage.setSourceObject(panelItem);

        return nextPage;
    }

In PanelEdit.java:

public class PanelEdit extends WOComponent {

    protected Panels thePanel;
    public PanelEdit(WOContext context) {
		super(context);

		modelGroup = EOModelGroup.defaultGroup();

		// Get the editing context.
		editingContext = session().defaultEditingContext();

    }

    public void setSourceObject(EOEnterpriseObject newSourceObject) {
		thePanel = (Panels) newSourceObject;
    }
}


--
_Deirdre http://deirdre.net
"Cannot run out of time. There is infinite time. You are finite. Zathras is finite. This....is wrong tool." -- Zathras
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.



References: 
 >[Newbie] WOHyperlinks with Id (From: Lucas Haley <email@hidden>)

  • Prev by Date: Re: database slowness weirdness
  • Next by Date: Re: [Newbie] WOHyperlinks with Id
  • Previous by thread: Re: [Newbie] WOHyperlinks with Id
  • Next by thread: Re: [Newbie] WOHyperlinks with Id
  • Index(es):
    • Date
    • Thread