Found a simple solution, but not sure I am doing correctly:
In MyConstants.properties file
countryArray=England, America, Japan,...
in MyConstants.java
String[] countryArray();
in Presenter or View
for(String s : myConstants.countryArray()){ countryListBox.addItem(s); }
On Saturday, September 27, 2014 10:37:31 PM UTC+10, Tom wrote:
Ok, say I have a Label and a ListBox in UiBinder
<g:Label ui:field="countryLabel" /> <g:ListBox ui:field='countryListBox' visibleItemCount='1' />
In MyConstants.properties file
country=Country england=England america=America japan=Japan ....
in Presenter or View
countryLabel.setText(
myConstants.country()); This is so easy for Label since we only need to set Text 1 time but it will be very time consuming if we do the
ListBox
countryListBox.addItem(
myConstants.england()); countryListBox.addItem( myConstants.america()); etc... there will have 200 countries out there So my question is, is there any quicker way to effectively add Constants values into a ListBox in GWT?
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/d/optout.
No comments:
Post a Comment