1

How can i pass multi parameters in a query string, openlaszlo? I am getting compile time error

when i use'&' between two parameters.

Sample Code:

LzBrowser.loadURL("../modules/Index.jsp?"base=canvas.base&id=canvas.Id,"fraMain");

Someone please help me in passing multi parameters in a query string openlaszlo.

Thanks in advance

user27
  • 274
  • 9
  • 26

2 Answers2

1

By using & amp; we can achieve this

user27
  • 274
  • 9
  • 26
0

You probably got the compile error because you didn't use the directive within the method, e.g.

<method name="someMethod"><![CDATA[

]]></method>

That's required by the XML specification. If you don't use the CDATA directive, all ampersands within the tag will be treated as XML entities.

Remember that the length of the query string depends on the browser. If you only have a limited amount of parameters, this approach will work. If you want to send a larger amount of data, you have to post the data.

Another option is to use a dataset in combination with the LzParam class. For a dataset with the name dsSendData, you could add multiple parameters like this:

<method name="sendData" args="action">
  var d=canvas.datasets.dsSendData;
  var p=new LzParam();  
  p.addValue("param1", "value1", true);
  p.addValue("param2", "value2", true);
  d.setQueryString(p);  
  d.doRequest();
</method>

For more information on the allowed query string length for each browser, check this discussion What is the maximum possible length of a query string?

Community
  • 1
  • 1
raju-bitter
  • 8,906
  • 4
  • 42
  • 53