PS: for the parameter names, use ServiceConstants class.
ציטוט Robert Haycock:
Hi,
I'm trying to create a URL to put into some javascript (opening a new
window). I have a javascript function which takes a url and opens a
window with the url passed in. In my component I have a 'getUrl' method
which looks like this:
public String getContributorUrl(IItemEntry item)
{
String[] params = {item.toString()};
String[] context = {"newwindow"};
EngineServiceLink url = new
EngineServiceLink(this.getPage().getRequestCycle(),
"page", context, params,
true);
return url.getURL();
}
Where "newwindow" is the component I'm trying to open in a new window.
This 'getUrl' method is called in the .page file so the resulting HTML
looks something like:
<... ondblclick="openWin('/mwc/app?service=page/newwindow&sp=43382');"
....>
Problem is the parameters aren't passed to the new component. newwindow
extends BasePage. newwindow has the following:
public void validate(IRequestCycle cycle)
{
Object[] params = cycle.getServiceParameters();
Problem is that params is null. How can I create a link with parameters
to stick in some javascript?
Rob.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]