1. #1
    Ext User
    Join Date
    Jun 2008
    Posts
    29
    Vote Rating
    0
    avilanchee is on a distinguished road

      0  

    Default need to pass a String object inside PageConfig object

    need to pass a String object inside PageConfig object


    Hey all,

    How do i add another string varicble to the PageConfig object used in BasePagingLoader

    private BasePagingLoader<PagingLoadConfig, PagingLoadResult<Article>> getPagingLoader() {
    if (pageLoader == null) {
    final DataServiceAsync service = (DataServiceAsync) Registry
    .get(Main.SERVICE);
    RpcProxy<PagingLoadConfig, PagingLoadResult<Article>> proxy = new RpcProxy() {
    public void load(Object loadConfig, AsyncCallback callback) {

    service.getArticlesForEdition((PagingLoadConfig) loadConfig, callback);
    }
    };

    pageLoader = new BasePagingLoader(proxy);
    pageLoader.load(0, 10);
    }
    return pageLoader;
    }

    i need to call like pageLoader.load(0, 10, "some String or variable");

    i extended BasePagingLoader and PagingLoadConfig to have a String property , but When i run it says "" ExtPagingLoadConfig' was not serializable and has no concrete serializable subtypes"" . Even i implemented IsSerializable in ExtPagingLoadConfig.

    ExtPagingLoadConfig is the subclass of PagingLoadConfig


    any light on this would be very helpful

  2. #2
    Ext User
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    961
    Vote Rating
    1
    Arno.Nyhm is on a distinguished road

      0  

    Default


    because PagingLoadConfig inherits from ModelData you can set any new value to it:

    loadConfig.set("myParametername", myParameter)
    loadConfig.get("myParametername")
    This forum needs your help: you got hints from the community and now you have fixed your code? dont just reply with "now its fixed" or "i found the error"! please take the time to post also an detailed answer with the working code.

    GreaseMonkey Script for a GXT-only Forum: it hides ExtJs here: New Posts • Search Results • Advanced Search form • Category overview http://www.extjs.com/forum/showthrea...041#post410041

  3. #3
    Ext User
    Join Date
    Jun 2008
    Posts
    29
    Vote Rating
    0
    avilanchee is on a distinguished road

      0  

    Default


    Do i need to create a new PageLoadingConfig like

    PagingLoadConfig config = new BasePagingLoadConfig();

    if it all no required to create a new PageLoadingConfig object , how do i set parameters here

    RpcProxy<PagingLoadConfig, PagingLoadResult<Article>> proxy = new RpcProxy() {
    public void load(Object loadConfig, AsyncCallback callback) {

    service.getArticlesForEdition((PagingLoadConfig) loadConfig, callback);
    }
    };

    any help will be very useful !

    -avi
    Last edited by avilanchee; 30 Dec 2009 at 4:00 AM. Reason: pre submit

  4. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Simple add a beforeload event listener and modifiy the loadconfig. An example is available here: http://www.extjs.com/examples/explor...vancedcombobox

  5. #5
    Ext User
    Join Date
    Jun 2008
    Posts
    29
    Vote Rating
    0
    avilanchee is on a distinguished road

      0  

    Default


    im using version 1.2.1 ext gwt

    -avi

  6. #6
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    It is the same:
    Code:
     loader.addListener(Loader.BeforeLoad,
            new Listener<LoadEvent<BasePagingLoadConfig, ListLoadResult<ModelData>>>() {
    
              public void handleEvent(
                  LoadEvent<BasePagingLoadConfig, ListLoadResult<ModelData>> be) {
                be.config.set("test", "test");
    
              }
            });
    Please try to read the example and understand it. It should not be very hard to transform it to GXT 1.2.X code.

Thread Participants: 2