PDA

View Full Version : problem in QueryString


Rajeshorey
01-09-2008, 09:44 AM
hi friends and experts !!!
Thanks for you support you given me for my previous post's:)

here i'm posting another problem hoping the Solution from you !!!!
When i click the VIEW action in the grid i want my ffirst name to
get append on my url (i.e) pass as queryString !!!
but i coudn't able to see any action on the URL Appending !!
my page is been directed to www.openlaszlo.org (http://www.openlaszlo.org) but
in the URL there is no change

thanks a lot in advance

<canvas width="800" height="800" debug="true">
<dataset name="ds">
<phonebook>
<contact firstName="John" lastName="Smith" phone="617-536-7855"
email="jsmith@mail.com"/>
<contact firstName="Lisa" lastName="Jones" phone="415-225-8743"
email="ljones@mail.com"/>
<contact firstName="Mary" lastName="Brown" phone="212-665-5211"
email="mbrown@mail.com"/>
</phonebook>
</dataset>
<grid datapath="ds:/*" name="gridian" sizetoheader="false" height ="150" showhlines="true" y="200" style="mylightstyle" >
<gridcolumn width="95" sortable="false" resizable="false"><b>Action</b>
<view name="fname1" x="0" layout="axis:x; spacing:1">

<text font="Verdana" fontsize="13" fgcolor="blue" x="0"><u>view</u></text>
<datapath xpath="@firstName" replication="lazy" />
<handler name="onclick">
LzBrowser.loadURL("http://www.openlaszlo.org?"+canvas.datasets.firstName.getQueryString());
</handler>
</view>
</gridcolumn>

<gridtext datapath="@firstName" width="150" editable="false"> <b>First Name </b> </gridtext>
<gridtext datapath="@lastName" width="120" editable="false"><b> lastName </b> </gridtext>
<gridtext datapath="@phone" width="105" editable="false"><b> phone </b> </gridtext>
<gridtext datapath="@email" width="126" editable="false"><b> email </b> </gridtext>
</grid>






</canvas>

Rajeshorey
01-10-2008, 09:34 AM
No replies ?

:(


I would be thankful to you !!! if you give me a solution soon
'cos this thing delays me to do the other job

thank you
Rajesh

senshi
01-10-2008, 02:26 PM
The following statement doesn't make any sense:

canvas.datasets.firstName.getQueryString()


Did you just want to get the name, like:

LzBrowser.loadURL("http://www.openlaszlo.org?" + this.data);

Rajeshorey
01-10-2008, 07:00 PM
Thank you so much for your reply !!

the think is i'm integrating openlaszlo with Spring
when i click the view button in the grid i should call the controller with the information of the particular row passed on with the URL !!! normally it happens fine ouside the grid !!!
Inside the grid also
i can able to call the controller
but couldn't able to pass the data (i.e the particular row which i'm clicking)as the URL QueryString


http://localhost:8080/Myproject/Demo.htm?undefined . This is wat i'm getting

thank you so much for your time and consideration !! i'm still new and learning in openlaszlo

Rajeshorey
01-10-2008, 08:53 PM
The following statement doesn't make any sense:

canvas.datasets.firstName.getQueryString()


Did you just want to get the name, like:

LzBrowser.loadURL("http://www.openlaszlo.org?" + this.data);


Yes exactly Mr.Senshi !!!
http://localhost:8080/DEMO/createcontact.htm?lastName=LASTNAME&firstName=FIRSTNAME

this is what i want my URL to be when i click view button inside the grid !!!

thanks for your patience and sorry if i'm troubling you

senshi
01-12-2008, 11:52 AM
Like so...


<view datapath="." >
<text font="Verdana" fontsize="13" fgcolor="blue" ><u>view</u></text>
<handler name="onclick"><![CDATA[
var urlparam = new LzParam();
urlparam.addValue("lastName", this.datapath.xpathQuery("@lastName"));
urlparam.addValue("firstName", this.datapath.xpathQuery("@firstName"));
var url = "http://www.openlaszlo.org?" + urlparam.serialize("=", "&", true);
LzBrowser.loadURL(url);
]]></handler>
</view>

Rajeshorey
01-12-2008, 08:45 PM
Thank you so much Mr senshi ..

it works gr8 . .
thanks once again



regards
rajesh :)