-
7 Feb 2013 8:05 AM #1
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!
-
7 Feb 2013 11:29 AM #2
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(); }
-
7 Feb 2013 11:37 AM #3
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?
-
7 Feb 2013 12:07 PM #4
For example:
For example:
this is what i mean by using "Strings":
Same concept, but for DualListField instead...Code:SimpleComboBox<String> scb = new SimpleComboBox<String>(new StringLabelProvider<String>()); scb.add("Item1"); scb.add("Item2");
-
7 Feb 2013 2:25 PM #5
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.
-
9 Feb 2013 12:16 PM #6
can you please help me setup?
Code:DualListField<String, String> field = new DualListField<String, String>(?, ?, ?, new TextCell());
-
9 Feb 2013 3:15 PM #7
From the javadocs:
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>.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}).
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.


Reply With Quote