yep, can we talk about it by mail ?
glevbe06@gmail.com
thanks
Announcement
Collapse
No announcement yet.
X
-
then please explain me how ...
The only thing i can obtain setting the valueXpath is "\n "
I do it using getAttribute("recipientTo")
the value Xpath i set :
Code:recipientTo = new DataSourceTextField( "recipientTo", "recipientTo" ); recipientTo.setValueXPath( "//response/data/records/message/recipientTo" );
(if i use a JavaScriptObject i throw an exception)
thanks!
Leave a comment:
-
Hi Hetal,
As previously mentioned, your data has an extra <records> element that you need to get rid of if you are using RestDataSource.
A properly formed XPath will return multiple values if the XPath is correct. If you think there's a SmartGWT problem here, the best thing to do is post a standalone test case so we can more quickly take a look at it and either correct your usage and identify a bug.
Leave a comment:
-
Originally posted by IsomorphicUsing valueXPath will mean each record gets on recipientTo/Address. If there are multiple records each will have a Name and Address.
Like Ben mentioned and like I had mentioned in my post, the Xpath recipientTo/Address just returns the first Address value from the whole object in case there are multiple address elements in each record.
What solution I have posted works.. but I wanted to know if there is a direct solution to work with the Datasource (or XPath) for the sample XML shown to retrieve the multiple address elements from the recipientTo node.
Thanks,
HetalLast edited by hgaglani; 6 Apr 2009, 07:46.
Leave a comment:
-
I had a similar issue. I solved it this way..
The code to get it in a String[] :
Code:ListGridRecord[] li = response.getData(); JavaScriptObject jso = li[0].getAttributeAsJavaScriptObject( "recipientTo" ); JsArray arr = jso.cast(); String[] addressArr = new String[arr.length()]; for(int i=0;i<arr.length();i++) { addressArr[i] = JSOHelper.getAttribute(arr.get(i),"Address"); }
Hope this helps.
Cheers,
HetalLast edited by hgaglani; 6 Apr 2009, 07:29.
Leave a comment:
-
Each record have one recipientTo that contains a lot of Adress and Name :
Code:<response> <status>0</status> <startRow>0</startRow> <endRow>1</endRow> <totalRows>1</totalRows> <data> <records> <message> <subject></subject> <sentDate>2009-02-27 12:22:08.0 CET</sentDate> <size>3662</size> <from>fayssal161466979@free.fr</from> <recipientTo> <Address>glev4retbe12345706@gmail.com</Address> <Name>Ben</Name> <Address>glev4retbe12345706@gmail.com</Address> <Name>Ben</Name> <Address>glev4retbe12345706@gmail.com</Address> <Name>Ben</Name> <Address>bob@bob.bob</Address> <Name>Bob</Name> </recipientTo> <uid>474</uid> <folderURL>gvfdg</folderURL> <summary>dfsg</summary> <content>dsfg</content> <seen>true</seen> <gotAttachment>dfsg</gotAttachment> </message> </records> </data> </response>
Leave a comment:
-
Using valueXPath will mean each record gets on recipientTo/Address. If there are multiple records each will have a Name and Address.
If this doesn't help, start over and post a much clearer explanation of the data you're working with and how exactly it needs to be displayed.
Leave a comment:
-
I want all the recipientTo/Address, i can have more than 1 value and i dont know how to get them ...
If i the valueXPath to recipientTo/Address or recipientTo/Name, my result is only the value of the first recipientTo.
Leave a comment:
-
valueXPath is relative to the record. You want just recipientTo/address.
You also have an extra tag, get rid of <records>.
Leave a comment:
-
Originally posted by BeN01Code:<response> <startRow>0</startRow> <endRow>1</endRow> <totalRows>1</totalRows>
DSResponse.totalRows: Total number of rows available from the server that match the current filter criteria, when using paged result fetching.
endRow: End row of returned server results, when using paged result fetching.
Note that startRow *and* endRow are zero-based - the first record is row zero.
Code:endRow - startRow + 1 == 2 > totalRows
Leave a comment:
Leave a comment: