Hi,
I created a list of the 4 strings, called setAcceptableValues(list) in the
connstructor, but now I get the 4 values in the list, plus a null entry.
What am I doing wrong? This is my AddressEditor.java:
public class AddressEditor extends Composite implements Editor<Address>
{
private static AddressEditorUiBinder uiBinder =
GWT.create(AddressEditorUiBinder.class);
interface AddressEditorUiBinder extends UiBinder<Widget, AddressEditor>
{
}
@UiField
TextBox street;
@UiField
TextBox city;
@UiField
TextBox zip;
@UiField
ValueListBox<String> state;
public AddressEditor()
{
initWidget(uiBinder.createAndBindUi(this));
List<String> states = new ArrayList<String>();
states.add("Scotland");
states.add("England");
states.add("Wales");
states.add("Ireland");
state.setAcceptableValues(states);
}
@UiFactory
@Ignore
ValueListBox<String> stateInit()
{
return new ValueListBox<String>(new Renderer<String>()
{
@Override
public String render(String object)
{
return object;
}
@Override
public void render(String object, Appendable appendable) throws IOException
{
if(object != null)
{
appendable.append(object);
}
}
});
}
}
I suspect the first render function is being called, but I can't do a null
check on it as it needs a return value.
Thanks
On Wednesday, 5 September 2012 09:02:10 UTC+1, Ümit Seren wrote:
>
> valueBox.setAcceptableValues(List<EntityProxy> values);
>
> On Tuesday, September 4, 2012 1:32:37 PM UTC+2, Drew Spencer wrote:
>>
>> Did you guys get anywhere with this? I'm learning the Editor Framework
>> and my ValueListBox only contains the actual value - how do I make it so
>> that I populate the list with a predefined set of values, and select the
>> actual value as selected? I'm using GWTP.
>>
>> My code for my UiFactory:
>>
>> @UiFactory
>> @Ignore
>> ValueListBox<String> stateInit()
>> {
>> return new ValueListBox<String>(new Renderer<String>()
>> {
>> @Override
>> public String render(String object)
>> {
>> return object;
>> }
>> @Override
>> public void render(String object, Appendable appendable) throws
>> IOException
>> {
>> if(object != null)
>> {
>> // NEED SOME LOGIC HERE?
>> appendable.append(object);
>> }
>> }
>> });
>> }
>>
>> Cheers,
>>
>> Drew
>>
>> On Wednesday, 2 March 2011 09:05:56 UTC, George Moschovitis wrote:
>>>
>>> Eh? can you elaborate on this?
>>>
>>> thanks for the help!
>>> -g.
>>>
>>
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/cuJ_53t-744J.
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/google-web-toolkit?hl=en.