I've solved this way:
in template I've defined my select object like this:
<select jwcid="pagesSelect" onchange="ognl:pagesSelectAction">
then in .java
public String getPagesSelectAction() {
IDirect directLinkComponent =
(IDirect)getComponent("pageChangedLink");
DirectServiceParameter dsp = new
DirectServiceParameter(directLinkComponent,getChangedPageContext());
ILink selLink = getDirectService().getLink(false,dsp);
String sl = selLink.getURL();
System.err.println("link direct=" + sl);
return "document.location='" + sl.substring(0,sl.length()-1) +
"'+this.options[this.options.selectedIndex].value";
}
Many thanks to Michael Henderson that posted this suggestion in a post
titled "Re: DirectLink on a button and success messages"
Regards
Fabio
Mike Snare ha scritto:
Does it work to just have your listener declare a String parameter?
If not, try getting it from the listener parameters
(page.getRequestCycle.getListenerParameters)?
-Mike
On 4/3/06, Fabio Bondioli <[EMAIL PROTECTED]> wrote:
Hi,
I'm extending the contrib:TablePages component (tapestry 4) and I want
sunstitute the pages links with a PropertySelection (<select> tag)
object so the user can select the page to go from a drop-down list.
I don't want to use a form so I cannot use a Select or a
PropertySelection component.
I've declared a <select> this way:
<select jwcid="@Any" onchange="ognl:'document.location=\'' +
getActionLink() +
'&pg=\'+this.options[this.options.selectedIndex].value;' ">
and filled the options using a For component.
What I've to put in my getActionLink() function in order to return a
link like a DirectLink so when the user select another page from the
drop-down list, the page is reloaded and listener is called?
In my listener, how can I access my "pg" parameter passed from the link
in the select tag?
thanks a lot for any hints.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]