Building a navigational component
Building a navigational component
- Subject: Building a navigational component
- From: "SigurĂ°ur E. Vilhelmsson" <email@hidden>
- Date: Mon, 3 Sep 2007 14:43:33 +0000
Hi all,
I'm playing around with a navigational wrapper that I have problems
getting to work.
The design is like follows:
There are 13 buttons (10 aligned in two rows horizontally across the
top and 3 down the side). This is all set up in css so I have:
<div id="menu_01_button"><webobject name = "LinkToPage_01"></webobject></div>
etc.
and in the wod:
LinkToPage_01: WOHyperlink {
pageName = "Page_01";
}
etc
Now, I'd like to be able to populate the buttons with names of pages
from the database, the reason being that the toplevel page names may
change from time to time and be moved about in the navigation bar, so
I'd rather not hard code them.
I have two tables:
Menu - containing PK "menuID" and "number" and FK "pageID" with a
to-one relationship to Page.
Page - containing, among others, attributes PK "pageID" and "title".
What I thought I would do is create an NSArray of the Menu table,
sorted by "number" and add that to the menu divs:
<div id="menu_01_button"><webobject name = "LinkToPage_01"><webobject
name ="Menu_01_title"></webobject></webobject></div>
and in the wod:
LinkToPage_01 : WOHyperlink {
pageName = "Page_01";
}
Menu_01_title : WOString {
value = amenu.page.name;
}
The code for this is eluding me, so any help would be appreciated. If
you have any suggestions for an alternative approach to this, I'd also
be very grateful.
Best regards,
Sigurdur
_______________________________________________
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