Friday, October 9, 2015

Re: uncaught java.lang.indexoutofboundsexception

replace for(int i=0; i<=nbMenuItems;i++)
by for(int i=0; i<nbMenuItems;i++)

Op vrijdag 9 oktober 2015 11:34:32 UTC+2 schreef NewbieGwtUser:
Hello,

I have a global view in which I have to display a table that its rows depend on the number of lateral submenu Items called 'subMenuItemsContainer'.

I create this method where I just want to show if I get the good item values or not and I call it within the view constructor after the initWidget(uiBinder.createAndBindUi(this)) instruction :

        



public void fillContainer(){
int nbMenuItems = subMenuItemsContainer.getWidgetCount();
for(int i=0; i<=nbMenuItems;i++){
MaterialToast.alert(""+ subMenuItemsContainer.getWidget(i));
}



but when I run the application, I got an empty screen with just displayed toast.


and the uncaught java.lang.indexoutofboundsexception when I open the chrome tool Developer, have you an idea what's wrong with my loop that I even tried to replace with while loop, but I have the same problem.

any idea about what mistake have I commited ???

--
You received this message because you are subscribed to the Google Groups "GWT Users" 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