Hello everybody!
I am new to GWT but I found it very useful. Although I came to a
problem I'd like to resolve.
I want to have one interface to manage data from various tables.
I fetch JSON data from database by RequestBuilder, then I create
Overlay Types just like in manual with this function
private final native static DataCollection<PageData> getPages(String
json) /*-{
return eval(json);
}-*/;
where DataCollection extends JsArray and PageData extends DataItem
that extends JavaScriptObject.
here's DataCollection class:
public class DataCollection<T extends DataItem> extends
JsArray<DataItem> {
protected DataCollection() {};
public final DataItem getItem(int i){
return get(i);
}
}
DataItem just extends JavaScriptObject. I did not implemented any
methods..
So my question is how to cast the type <PageData> to the object that
is returned by getItem method od DataCollection to achieve this:
PageData pg=pagesCollection.getItem(0);
I thought that when I define a variable DataCollection<PageData>
pagesCollection; it will return <PageData> . I am wrong.
Of course I can force type like this PageData
pg=(PageData)PAGES.getItem(i); but it is inconvenient.
Thank You in advance.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.