It is the responsibility of the server to read the paging parameters that
HttpProxy passes and return a subset of the data as xml (corresponding to
the page number and page size). The client side code will not do that if you
use HttpProxy. If you want to read the entire xml from the server and do
local paging, then return the entire xml as a String from a GWT-RPC call and
load the xml into the Store using loadXmlData/ Use this in conjunction with
PagingMemoryProxy from the GWT-Ext-Ux project to support local paging.

See http://gwt-ext.com/demo/#localXmlGrid

Sanjiv

On Wed, Sep 3, 2008 at 1:38 PM, Angelo <[EMAIL PROTECTED]> wrote:

>
> Hi everyone,
>
> I have reading XML from and trying to make a Grid that pages from that
> data. I used the GWT-Ext showcase as a starting point, but no matter
> what I seem to do, the Grid always loads ALL of the XML, instead of 25
> at a time.
>
> Here is what my XML looks like (this is just  sample):
> <result code="ok" sessionid="D0DDD4D513927094D1C2B11F22FE6427">
>    <msglist loadLimit="5000" pages="73" itemsLoaded="3629"
> itemsInView="3629" loadTime="533" age="166" spamstats="bulk,none"
> order="by-date-rev">
>    <page num="1" firstItem="1" lastItem="50">
>      <msgsummary id="3629" rcvd="8/27/08 4:42 PM"
> sname="[EMAIL PROTECTED]" saddr="[EMAIL PROTECTED]"
> rname="[EMAIL PROTECTED]" raddr="[EMAIL PROTECTED]"
> subj="bronchiocrisis" sizeabbr="1 KB" state="Deleted" spam="none"
> virus="MsgClean" attach="false" ip="unchecked"/>
>      <msgsummary id="3628" rcvd="8/27/08 4:42 PM"
> sname="[EMAIL PROTECTED]" saddr="[EMAIL PROTECTED]"
> rname="[EMAIL PROTECTED]" raddr="[EMAIL PROTECTED]"
> subj="caller" sizeabbr="1 KB" state="Deleted" spam="none"
> virus="MsgClean" attach="false" ip="unchecked"/>
>      <msgsummary id="3583" rcvd="8/27/08 4:41 PM"
> sname="[EMAIL PROTECTED]" saddr="[EMAIL PROTECTED]"
> rname="[EMAIL PROTECTED]" raddr="[EMAIL PROTECTED]"
> subj="schistic" sizeabbr="1 KB" state="Deleted" spam="none"
> virus="MsgClean" attach="false" ip="unchecked"/>
>     <msgsummary id="3582" rcvd="8/27/08 4:41 PM"
> sname="[EMAIL PROTECTED]" saddr="[EMAIL PROTECTED]"
> rname="[EMAIL PROTECTED]" raddr="[EMAIL PROTECTED]"
> subj="victless" sizeabbr="1 KB" state="Deleted" spam="none"
> virus="MsgClean" attach="false" ip="unchecked"/>
>     <msgsummary id="3581" rcvd="8/27/08 4:41 PM"
> sname="[EMAIL PROTECTED]" saddr="[EMAIL PROTECTED]"
> rname="[EMAIL PROTECTED]" raddr="[EMAIL PROTECTED]"
> subj="Elaphomyces" sizeabbr="1 KB" state="Deleted" spam="none"
> virus="MsgClean" attach="false" ip="unchecked"/>
>     <msgsummary id="3580" rcvd="8/27/08 4:40 PM"
> sname="[EMAIL PROTECTED]" saddr="[EMAIL PROTECTED]"
> rname="[EMAIL PROTECTED]" raddr="[EMAIL PROTECTED]"
> subj="Koine" sizeabbr="1 KB" state="Deleted" spam="none"
> virus="MsgClean" attach="false" ip="unchecked"/>
>    </msglist>
> </result>
>
> And here is my code:
>
> public class MainGUI implements EntryPoint {
>
>        private String sessionID = null;
>        private RootPanel root;
>        private GridPanel grid;
>
>        public void onModuleLoad() {
>
>                root = RootPanel.get();
>
>                String username = "[EMAIL PROTECTED]";
>                String password = "asdf1";
>
>                RequestBuilder xmlGetter = new
> RequestBuilder(RequestBuilder.GET,
>                                "cmd/login?password=" + password +
> "&username=" + username);
>
>                LoginCallback loginCallback = new LoginCallback(this);
>                xmlGetter.setCallback(loginCallback);
>                try {
>                        xmlGetter.send();
>                } catch (RequestException e) {
>                        // TODO Auto-generated catch block
>                        e.printStackTrace();
>                }
>
>        }
>
>        public void createGrid(String id) {
>                sessionID = id;
>
>                String path = "cmd/msg/list;jsessionid=";
>
>                DataProxy proxy = new HttpProxy(path + sessionID);
>
>                final RecordDef recordDef = new RecordDef( new FieldDef[] {
>                                new StringFieldDef("@id"), new
> StringFieldDef("@rcvd"),
>                                new StringFieldDef("@sname"), new
> StringFieldDef("@saddr"),
>                                new StringFieldDef("@rname"), new
> StringFieldDef("@raddr"),
>                                new StringFieldDef("@subj"), new
> StringFieldDef("@sizeabbr"),
>                                new StringFieldDef("@state"), new
> StringFieldDef("@spam"),
>                                new StringFieldDef("@virus"), new
> StringFieldDef("@attach") });
>
>                XmlReader reader = new XmlReader("msgsummary", recordDef);
>                final Store store = new Store(reader);
>
>                store.setAutoLoad(false);
>
>                store.addStoreListener(new StoreListenerAdapter() {
>
>                        public void onLoad(Store store, Record[] records) {
>                                Window.alert("loading store");
>                                super.onLoad(store, records);
>                        }
>                });
>
>                store.setDataProxy(proxy);
>
>                ColumnConfig[] columnConfigs = {
>                                new ColumnConfig("id", "@id", 50),
>                                new ColumnConfig("RCVD", "@rcvd", 125),
>                                new ColumnConfig("Sender Name", "@sname",
> 125),
>                                new ColumnConfig("Sender Address", "@saddr",
> 125),
>                                new ColumnConfig("Reciepient Name",
> "@rname", 125),
>                                new ColumnConfig("Subject", "@subj", 125),
>                                new ColumnConfig("Size", "@sizeabbr", 75),
>                                new ColumnConfig("State", "@state", 75),
>                                new ColumnConfig("Spam", "@spam", 60),
>                                new ColumnConfig("Virus", "@virus", 50),
>                                new ColumnConfig("Attatch", "@attach", 50)
> };
>
>                ColumnModel columnModel = new ColumnModel(columnConfigs);
>
>                grid = new GridPanel();
>                grid.setStore(store);
>                grid.setColumnModel(columnModel);
>
>                grid.setFrame(false);
>                grid.setStripeRows(true);
>                grid.setWidth("100%");
>                grid.setHeight("500px");
>                grid.setTitle("Messages");
>
>                PagingToolbar pagingToolbar = new PagingToolbar(store);
>                pagingToolbar.setPageSize(25);
>                pagingToolbar.setDisplayInfo(true);
>                pagingToolbar.setEmptyMsg("No topics to display");
>
>                grid.setBottomToolbar(pagingToolbar);
>
>
>                root.add(grid);
>                store.load(0, pagingToolbar.getPageSize());
>        }
> }
>
> Thanks a ton!!!
>
> Angelo
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"GWT-Ext Developer Forum" 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/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to