| Page 1 of 1 | [ 5 posts ] |
|
Can anyone tell me how to read a request variable in YUI-2?
|
Alberto SantiniYUI Contributor
|
Hello Gopinadh.
What do you mean? Please provide a snippet to describe the issue. If I understood correctly the question, you may give a look at the Connection Manager module and his examples: http://developer.yahoo.com/yui/connection/ Hope that helps, IceBox |
|
Hi,
I am setting a variable in request from my controller which i need to read in YUI-2 script. This is being set in my controller & is being forwarded to my JSP. I am using a datatable in my screen which has the datasource returning an XML. Is there a way i can put an attribute in request which can be read separately from YUI-2 script instead of just reading from it's datasource? Below is the code from backend controller. --------------------------------------------------------------- String xml = xstream.toXML(calendars); getRequest().setAttribute("xmlbean", xml); this.getRequest().setAttribute("currentPageForNavigation", this.getFromSession("currentPageForNavigation"); Here is the snippet from my YUI-2 script ----------------------------------------------------------- var myColumnHeaders = [ {text:"Actions",formatter:formatActionColumn,key:"oid"}, {text:"Plan",key:"planAcronym"}, {text:"Locked",key:"hasBillingSchedules",formatter:formatIsLockedColumn}, {text:"Client",key:"client"}, {text:"SubClient",key:"subClient"}, {text:"Name",key:"name"}, {text:"Type",key:"billingCalendarTypeKey"}, {text:"Frequency",key:"billingFrequency"}, {text:"RunOffSet Days",key:"runOffsetDays"}, {text:"BillingType",key:"billingClientTypeKey"}, {text:"ClientType",key:"clientType"}, {text:"RunOffsetCycleType",key:"runOffsetCycleTypeKey"} ]; var myColumnSet = new YAHOO.widget.ColumnSet(myColumnHeaders); var myDataSource = new YAHOO.util.DataSource(getURI('loadAllBillingCalendar.do')); myDataSource.responseType = YAHOO.util.DataSource.TYPE_XML; myDataSource.responseSchema = { resultNode: 'cals', id: 'oid', fields: ['planAcronym', 'client' ,'subClient', 'name','billingCalendarTypeKey','runOffsetDays','billingFrequency', 'billingClientTypeKey','oid','hasBillingSchedules','clientType','runOffsetCycleTypeKey'] }; var defaultDataTable = new YAHOO.widget.DataTable("standardselect",myColumnSet,myDataSource, {paginator:'true',rowsPerPage:10}); defaultDataTable.subscribe("cellClickEvent",defaultDataTable.onEventSelectRow); defaultDataTable.select(defaultDataTable.getRow(0)); **********Right now, if you see at the last line, i am defaulting the table to select the first row. But, my table has pagination. So, when i reload the page, i need to read the previously visited page number from session & go back to that page. So, I am trying to read the current page number & put it in session. While reloading the page, i am trying to set that page number in request to be read in my script to go back to the original visited page. The other problem: How do i get handle to my datatable's page number? I am clicking one of the images in the row data in one of the cells. Thanks for the help. |
|
Any clues?
|
|
You should probably be using "metaFields" in your DataSource schema. You can load as many extra data items as you like in the meta. Look into http://developer.yahoo.com/yui/datasource/ and search down to the XML section.
I'm a little rusty at the exact call, but you can over-ride either handleResponse or one of the onDataReturnXXXXRows methods to extract the meta data and do what you want with it. http://developer.yahoo.com/yui/docs/YAHOO.widget.DataTable.html#method_onDataReturnAppendRows for example. I don't know JSP, but you cannot send Objects via remote requests, so if you are sending an object you would need to stringify before send/parse upon receipt to convert it to an object. |
| Page 1 of 1 | [ 5 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group