View Full Version : LzBrowser and query string
pathogen
04-10-2006, 03:37 PM
Hi,
I am using LzBrowser to send a request to a servlet that provides export capabilities. I can hit the servlet fine. However, I cannot seem to pass any requests via a query string like so:
onclick="LzBrowser.loadURL('../../../exportServlet?fileName=results.xls')"
The request object in the servlet contains no request params. Maybe I am misusing it? If so, could someone please show me an example of passing request params via LzBrowser?
Thanks!
greg.huddleston
09-07-2006, 01:03 PM
I am having this exact same issue... did you figure out the magic to get this to work?
TIA
//GH
pathogen
09-07-2006, 03:03 PM
Actually, I did. I'm on vacation right now, however, and without access to my code... I'll answer you when I get back. Sorry....
greg.huddleston
09-07-2006, 03:31 PM
Ok Thanks for the quick response...
I am sure this is some type of 'escape' function call to preserve all of the characters (have tried all reasonable ones without success).
Cheers GH
dwilliams
09-08-2006, 05:02 AM
Try this:
<gridcolumn resizable="false" sortable="false">Data
<view datapath="@id">
<button style="{basecolor:0xf9ecdc}">Load
<method event="onclick">
URL 'http://www.example.com/get.php?i=' + parent.datapath.xpathQuery('@id');
LzBrowser.loadURL(URL, '_blank');
</method>
</button>
</view>
</gridcolumn>
I had to create the full URL first, then append my query string.
greg.huddleston
09-08-2006, 09:55 AM
Hi group...
If this matters, I am not using a dataset (this is why this is so dumb). I am only calling out html page 2 from page 1 & I am using query string as a way of controlling what gets shown on page 2
Its the std. call to LzBrowser thats (on purpose?) stripping off the query string values.
(doing this from memory) the code is essentially:
<code>
<button onclick=daClickActiontab2();>
gotopage2-tab2
</button>
<button onclick=daClickActiontab3();>
gotopage2-tab3
</button>
<method name=daClickActiontab2">
LzBrowser('./page2.html?test=tab2','_blank');
</method>
<method name=daClickActiontab3">
LzBrowser('./page2.html?test=tab3','_blank');
</method>
</code>
The page2.html gets called & loads properly in place but nothing past the ? is passed in...
Perhaps an approach is to write some custom javascript to do this type of all & skip the LzBrowsser() call entirely...
I will try this if I find some spare time.
cyabye GH
greg.huddleston
09-08-2006, 03:44 PM
(here is a code snippet that does not yet work as I want, but does at least compile to make the point (things seem to work inside server enviro. but fail when run when this is compiled into a SOLO.swf entity (no query string, as I stated before)
<code>
<canvas height="400" width="400" bgcolor="blue" debug="false">
<view>
<simplelayout axis="y" spacing="50"/>
<button onclick="daClickActiontab2();">
main-tab2
<method name="daClickActiontab2">
var url = "main.html?test=tab2";
LzBrowser.loadURL(url,'_blank');
</method>
</button>
<button onclick="daClickActiontab3();">
main-tab3
<method name="daClickActiontab3">
var url = "main.html?test=tab3";
LzBrowser.loadURL(url,'_blank');
</method>
</button>
</view>
</canvas>
<code>
cheers GregH
pathogen
09-11-2006, 10:31 AM
Hi Greg,
In my case, I was building an exporter panel so I created a class for the panel and made attributes of things like file name etc. So, when the user clicked on one of the export icons, this method was called:
<method name="doCsvExport">
<![CDATA[ LzBrowser.loadURL(classroot.exporterUrl + '?fileName=' + classroot.csvFileName + '&exportType=CSV&dataKey=' + classroot.dataKey
+ '&exclusionList=' + classroot.exclusionList); ]]>
</method>
So, in practical use, it was like so:
<exportPanel id="wp_2_0_fmdExportButtonPanel" exporterUrl="../../../dataExportServlet"
xlsFileName="2_0_Export"
csvFileName="2_0_Export"
xmlFileName="2_0_Export"
dataKey="2_0_Results"
/>
Hope this helps...
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.