• 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: Primary keys, direct actions, and the WO "way"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Primary keys, direct actions, and the WO "way"


  • Subject: Re: Primary keys, direct actions, and the WO "way"
  • From: Dirk Bajohr <email@hidden>
  • Date: Tue, 13 Jul 2004 17:12:19 +0200

Amorya,
as David suggested, you have to use the primary key. If you want your pages to become even more friendly for search engines (get rid of the "?param=value") you could write a direct action class with the pk as action name, the url would look like /App.woa/wa/GenreAction/12345. A short example:


public class GenreAction extends WODirectAction {

	/**
	 * @param aRequest
	 */
	public GenreAction(WORequest aRequest) {
		super(aRequest);
	}

/*
* @see com.webobjects.appserver.WOAction#performActionNamed(java.lang.String)
*/
public WOActionResults performActionNamed(String pk) {
NSLog.out.appendln("Genre: " + pk);
// do some validation...


		WOComponent nextPage = ...
		nextPage.takeValueForKey(pk, "pkAsString");
		return nextPage;
	}
}

Don't forget to set the DefaultRequestHandler in your application class.

You create the link url by using the method call context().directActionURLForActionNamed("GenreAction/" + pk, null) in your component.

Cheers,
Dirk

--
Dirk Bajohr
iSOLUTION - Individuelle Software fuer moderne Kommunikation

Hauptstr. 50
53757 Sankt Augustin

T +49 2241 921567-0
F +49 2241 921567-89
http://www.isolution.de
_______________________________________________
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: 
 >Primary keys, direct actions, and the WO "way" (From: Amorya North <email@hidden>)

  • Prev by Date: Re: Primary keys, direct actions, and the WO "way"
  • Next by Date: Re: Primary keys, direct actions, and the WO "way"
  • Previous by thread: Re: Primary keys, direct actions, and the WO "way"
  • Next by thread: Re: Primary keys, direct actions, and the WO "way"
  • Index(es):
    • Date
    • Thread