1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    7
    Vote Rating
    0
    sasadorian is on a distinguished road

      0  

    Default Unanswered: DualListField help!

    Unanswered: DualListField help!


    Hi,
    I am looking at this example: http://www.sencha.com/examples/#Exam...:duallistfield

    Can anyone tell me where i can find "StateProperties" and "PropertyAccess"?

    My main goal is to have a working dual list with Strings that I provide. However, I cant get that working, so I need to look at the guts of StateProperties and see how its used.

    Help!

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,732
    Answers
    109
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    PropertyAccess is part of GXT itself, it can be found at com.sencha.gxt.data.shared.PropertyAccess<T> -- and StateProperties is that the top of that file (right after public class DualListFieldExample):
    Code:
      interface StateProperties extends PropertyAccess<State> {
        ModelKeyProvider<State> abbr();
     
        LabelProvider<State> name();
     
        @Path("name")
        ValueProvider<State, String> nameProp();
      }

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    7
    Vote Rating
    0
    sasadorian is on a distinguished road

      0  

    Default String implementation of DualListField

    String implementation of DualListField


    Thanks for the reply.

    By any chance, do you know an example that I can look it where it just simply uses "Strings" instead of PropertyAccess?

  4. #4
    Sencha User
    Join Date
    Oct 2012
    Posts
    7
    Vote Rating
    0
    sasadorian is on a distinguished road

      0  

    Default For example:

    For example:


    this is what i mean by using "Strings":

    Code:
    SimpleComboBox<String> scb = new SimpleComboBox<String>(new StringLabelProvider<String>());
    scb.add("Item1");
    scb.add("Item2");
    Same concept, but for DualListField instead...

  5. #5
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,732
    Answers
    109
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    There is a class called StringLabelProvider in the com.sencha.gxt.data.shared package - no generics, it assumes you are passing in a string and will return a string.

  6. #6
    Sencha User
    Join Date
    Oct 2012
    Posts
    7
    Vote Rating
    0
    sasadorian is on a distinguished road

      0  

    Default


    can you please help me setup?

    Code:
    DualListField<String, String> field = new DualListField<String, String>(?, ?, ?, new TextCell());

  7. #7
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,732
    Answers
    109
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    From the javadocs:
    Code:
       * @param fromStore the store containing the base set of items
       * @param toStore the store containing the items selected by the user
       * @param valueProvider the interface to {@code <M>}
       * @param cell displays the data in the list view (e.g. {@link TextCell}).
    You need to create and pass in a ListStore<M> for the left (the 'from' list) and for the right (the 'to' list). You also need to tell the DualListField<M,T> how it can read items from those M items and get out a T value that you can pass into the Cell<T>.

    What kinds of objects is the DualListField representing? How are you trying to draw them - just as plain text? Text and an Icon? These parameters let you control these details and more.

Thread Participants: 1