You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Eldred Mullany <el...@easypay.co.za> on 2009/12/02 14:01:52 UTC
Building a navigation links (bread crumb concept) based on dependent down selects (array list built in session)
Hi Everyone
I need to build a list of navigational links (bread crumb concept) each
time a user selects a value from a drop down list,
I have managed to create a custom event handler that will repopulate my
same select component with new values based on the previous values and
update a zone at the same time.
My custom event handler for my select component simply returns a new
values based on the parameter input like so:
String[] onProvideValues(String input) {
if ((input == null) || (input.trim().length() == 0)) {
return new String[] { "Select one..." };
}
String[] bins = getBinsForInsurer((InsuranceCompany)
this.encoder.toValue(input));
return bins;
}
I also have another method that is fired that calls onDropDown() to
update the zone after my select component is re-populated with new
values.
Object onDropDown() {
return this.zone.getBody();
}
The method that is called when zone is updated is
Public List methodCalledFromZone() {
List<String> string = new ArrayList<String>();
List<String> list[] =
requestGlobals.getHTTPServletRequest().getAttibute("selectComponent");
if (list != null)
for (int i = 0; i < list.length; i++)
string.add(list [i]);
return list;
}
This won't work of course because I am not getting the value back from
the getAttibute() method and I cannot build onto my arraylist the new
value because its not kept in the session ?
Any ideas would be appreciated.
Many thanks Eldred