[SOLVED] Re: Pulldown Menu and WOPopUpButton
[SOLVED] Re: Pulldown Menu and WOPopUpButton
- Subject: [SOLVED] Re: Pulldown Menu and WOPopUpButton
- From: Baiss Eric Magnusson <email@hidden>
- Date: Sat, 29 Jul 2006 14:36:46 -0700
Ok, I bound <value> and <onChange> of the WOPopupButton to:
<value> valueStringOfPopup // this generates the <option>'s
<onChange> "MM_jumpMenu('parent',this,0)"
And then utilizing the WODisplayGroup <store> I wrote:
public int popIndex;
public void awake() {
popIndex = 0;
}
public String valueStringOfPopup() {
if ( store.displayedObjects() == null || store.displayedObjects
().count() == 0) return "";
anItem = (StoreItem)store.displayedObjects().objectAtIndex
( popIndex );
popIndex++;
String popTitle = URLEncoder.encode( anItem.itemTitle());
return "#" + popTitle;
}
I had set the value attribute in the WOPopUpButton to emulate the
standard Pulldown Menu from the JS example like:
<option value="#link02">Product Two</option>
so that the <onchange> attribute of the WOPopUpButton will call
the JS and the browser will jump the page to the anchor <#link02>.
Does anyone have a solution to this issue?
I can't just add an attribute to WOPopUpButton because the
attribute has to be part of each <option> line, rather than just
the <select> line.
The JS is:
function MM_jumpMenu( targ, selObj, restore ) {
eval( targ + ".location='" + selObj.options
[selObj.selectedIndex].value + "'");
if ( restore )
selObj.selectedIndex = 0;
}
To re-iterate, I need a dynamic Pulldown Menu which, when
activated, will use <MM_jumpMenu> to navigate the page to an
anchor associated with the appropriate product on the page.
----
Baiss Eric Magnusson
<http://www.Track-Your-Finances.com>
<http://www.CascadeWebDesign.com>
_______________________________________________
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