Re: Basic newbie questions
Re: Basic newbie questions
- Subject: Re: Basic newbie questions
- From: Ute Hoffmann <email@hidden>
- Date: Thu, 15 Sep 2005 11:47:40 +0200
There is a Component in your App which knows on what page you are. This
one Component needs to hand this information to the reusable Component
which needs to know, which is your menue. So you have to hand over this
value as often as needed until it reaches you menue.
lets assume:
page -> partial Component -> menue
page knows what menue needs to know (the string "CurrentPage")
partial Component has a binding String CurrentPage, which will be set
by Page.
menue has a binding CurrentPage which will be set by partial Component.
Be careful: The value currentPage will be only available for
check/programming in appendToResponse. So make sure your check, if done
in code, is done in appendToResponse else it will be always false, as
the value is not yet available.
To have WO hand over those information you define a binding in
WOBuilder here:
Once you have it working you can optimize it.
Hope this helps,
Regards,
Ute
Am Donnerstag, 15.09.05 um 10:12 Uhr schrieb Cyrille Stepanyk:
Hi and thanks for your answers.
I agree that I should have a "class" binding however what I can't
figure out is how to identify the current link based on the fact that
the menu is inside a reusable template and all pages are partial docs.
I should have obviusly a method that returns a String with value
"currentSite" but only when the page is the current one.
Thanks,
Cyrille
2005/9/15, LD <email@hidden>:
Hi Cyrille,
On 15/09/2005, at 3:36 AM, Cyrille Stepanyk wrote:
- I've a menu made of WOHyperlinks enclosed inside html unordered
list
<ul>. So each link is inside a <li> tag and each going to a different
WOComponent.
What I'd like to do is to "highlight" the current page using CSS.
Mean
that the current hyperlink should be displaying something like
class="current" for the <a> tag.
I've search for how to do that but with poor result so far.
Just add a binding for 'class'.
AHyperlink: WOHyperlink {
action = someAction;
<...>
class = hyperlinkClass;
}
- My second question is quite simlar : how to display the currently
selected item in WOPopupButton? In html its selected="selected". The
popup bindings are :
PopUpButton1: WOPopUpButton {
list = session.currentClient.toSites;
item = siteEnumerator;
selection = selectedSite;
displayString = siteEnumerator.name;
}
As you have guess this display a list of Sites for a Client.
Relationships for entities are Client <-->> Sites.
Those bindings should work as long as (selectedSite ==
siteEnumerator) at some point.
with regards,
--
LD
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
pixelmind.com
This email sent to email@hidden
_______________________________________________
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