Hybrid View

  1. #1
    Sencha User
    Join Date
    Jul 2011
    Posts
    25
    Answers
    2
    Vote Rating
    1
    IgyBoy is on a distinguished road

      0  

    Default Answered: ValueProvider+RequestFactory - how to access properties of nested object?

    Answered: ValueProvider+RequestFactory - how to access properties of nested object?


    Hi everybody,

    i'm trying to figure out how to display properties from related object in a grid.
    Let's say I have entity object called "Song",that is relating to "Genre" object.

    Now,what I want to achieve is to display list of "Song" objects on grid,but also include some of the details from related "Genre" object.
    From what I read on GXT 3.0, valueProviders should be able to do that, but I haven't found out how to do it.

    So far,I have managed to do this without problem:

    interface SongProxyProperties extends PropertyAccess<SongProxy> {

    ModelKeyProvider<SongProxy> id();
    ValueProvider<SongProxy, String> artist();
    .
    .
    .
    ValueProvider<GenreProxy, String> genre(); ?????????
    }


    Can anyone help me with this?

    Tnx,
    Igor

  2. Never mind, figured it out - have read about GWT Editor framework a bit...

  3. #2
    Sencha User
    Join Date
    Jul 2011
    Posts
    25
    Answers
    2
    Vote Rating
    1
    IgyBoy is on a distinguished road

      0  

    Default


    Never mind, figured it out - have read about GWT Editor framework a bit...
    Last edited by IgyBoy; 4 Feb 2012 at 5:31 AM. Reason: Figured it out.

  4. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    15
    Vote Rating
    0
    koenjan is on a distinguished road

      0  

    Question How did you do it finally?

    How did you do it finally?


    Hey Igor,

    Could you tell us how you did it? We are also looking for the same thing, but reading GWT Editor docs did not make us any wiser ...

    Thanks,
    Koen

  5. #4
    Sencha User
    Join Date
    Jul 2011
    Posts
    25
    Answers
    2
    Vote Rating
    1
    IgyBoy is on a distinguished road

      1  

    Default


    Hi koenjan,

    the "@Path" annotation is what you are looking for:
    From the GWT docs:

    "The @Path annotation may be used on the field or accessor method to specify a dotted property path or to bypass the implicit naming convention. For example:
    class PersonEditor implements Editor<Person> {
    // Corresponds to person.getManager().getName()
    @Path("manager.name");
    Label managerName;
    }


    So, in the example that I had above:

    interface SongProxyProperties extends PropertyAccess<SongProxy> {
    ModelKeyProvider<SongProxy> id();
    ValueProvider<SongProxy, String> artist();
    @Path("genre.genreName")
    ValueProvider<SongProxy, String> songGenre();
    }

    The @Path("genre.genreName") is basically saying: take "genreName" property from related "genre" object, and expose it as "songGenre" in SongProxyProperties interface.

    Hope this was helpfull.

    Cheers,
    Igor

  6. #5
    Sencha User
    Join Date
    Dec 2011
    Posts
    15
    Vote Rating
    0
    koenjan is on a distinguished road

      0  

    Default


    Thank you for your response...
    In fact, we already tried the @Path annotation, but somehow we got NullPointerExceptions...

    after some debugging, we found that to be able to use
    Code:
    @Path("type.name")
    ValueProvider<DetailProxy, String> typeName;
    that instead of
    Code:
    detailRequest.get().find(requestId).fire(receiver<DetailProxy>)
    which did not include the <DetailTypeProxy> inside the <DetailProxy>,
    we had to do
    Code:
    detailRequest.get().find(requestId).with("type").fire(receiver<DetailProxy>)
    maybe this is useful for others...

  7. #6
    Sencha Premium Member
    Join Date
    Oct 2012
    Posts
    1
    Vote Rating
    0
    Adam.Elkins is on a distinguished road

      0  

    Default


    I am having a very similar issue. I am using RequestFactory with Hibernate to populate a Sencha grid with a paging toolbar. By using the path annotation I was able to successfully populate the grid with data. I then tried to implement the paging toolbar which requires the use of RequestFactoryProxy and am now receiving a NullPointerException for the Columns in the grid that access nested objects. It seems that the use of the with() method within the context of RequestFactoryProxy doesn't work as expected.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."