You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Vi...@comcast.net on 2003/09/12 19:01:13 UTC
ActionLink & getServiceParameters - mysterious results
I have used an ActionLink component in the following manner:
<component id="DealerInfoLink" type="ActionLink">
<binding name="listener" expression="listeners.linkToDealerInfo"/>
<binding name="parameters" expression="currentSearchResult.dealerId"/>
</component>
When I inspect the generated HTML, I see the following that the above generated:
<a
href="/AutoWise/app?service=action/1/DealerSearchResults/1/DealerSearchResults.DealerInfoLink"
parameters="2">Dealership Name:My Dealer ID:2a>
So far, so good. The parameter for the ActionLink seems to work.
Now in the listener referenced above, I have the following code:
public void linkToDealerInfo(IRequestCycle cycle) {
AutowiseVisit visit;
visit = (AutowiseVisit)this.getPage().getVisit();
Object[] parameters = cycle.getServiceParameters();
visit.setCurrentDealerID( (String) parameters[0]);
cycle.activate("DealerInfo");
}
This code does get executed, but the parameters variable always gets set to null
when I call getServiceParameters, so the reference to parameters[0] causes a
NullPointerException.
Any ideas?
Thanks much in advance!
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org