On Saturday, February 22, 2014 12:23:15 PM UTC+1, Tom wrote:
Ok, I have a need to use many ListBoxes in UiBinder.
Ok, in View.ui.xml file:
<g:ListBox ui:field='listBox1' visibleItemCount='3' > <g:item value='1'> Car </g:item> <g:item value='2'> Car2 </g:item> <g:item value='3'> Car3 </g:item> //more item </g:ListBox> <g:ListBox ui:field='listBox2' visibleItemCount='3' > <g:item value='1'> Bike </g:item> <g:item value='2'> Bike2 </g:item> <g:item value='3'> Bike3 </g:item> //more item </g:ListBox> // more ui binder ListBox hereNow I want to
setMultipleSelectfor some ListBoxes only, so I can do something like this<g:ListBox ui:field='listBox2' visibleItemCount='3' multipleSelect="true" >, it works fine butsetMultipleSelect(boolean multiple)was deprecated, Google said:@Deprecated public void setMultipleSelect(boolean multiple)
Deprecated. use ListBox(boolean) instead Sets whether this list allows multiple selections. NOTE: The preferred way of enabling multiple selections in a list box is by using the ListBox(boolean) constructor. Using this method can spuriously fail on Internet Explorer 6.0.
So it means we don't use
setMultipleSelectbut use constructorListBox(boolean)to set the MultipleSelection, so here is what I did in View.java@UiField ListBox listBox1; @UiField ListBox listBox2; @UiFactory ListBox makeListBox1(){ listBox1=new ListBox(true); return listBox1; }However, the above code apply
ListBox(true)for all the ListBoxes (listBox1, listBox2, etc). I don't want that cos some other ListBoxes need to havesingle selection only.So why
@UiFactory ListBox makeListBox1()apply for all ListBoxes & how to fix it?Not sure
provided=truecan help?
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment