• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SelectItems + IllegalArgumentException + help

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am facing the problem, whenever I am trying to write selectItems tag in SelectOneMenu parent tag, it occurs. I am unable to find out why this illegalArgumentException is coming. Although value is coming in the list. But when Iam submitting the form it is giving exception. I am creating List of SelectItem object but dont know, why?
When I am using hard coded selecItem tag it is not giving any errors only while using selectItems...I searched a lot lot but never able to find out a satisfactory reason nor solution...I will provide my code..jst have a look at it..

My UIForm code
<ga:responseActions>
<id:listProjectLeaders target="#{plList}"/>
</ga:responseActions>
<h:selectOneMenu value="#{var['pl']}">
<f:selectItems value="#{plList}" />
</h:selectOneListbox>

I am getting data from database in dropdown list but not able to select..

My getMethod
public List<SelectItem> getProjectLeaders() {
List<SelectItem> projectLeaders = new ArrayList<SelectItem>();
SelectItem option = null;
String count = null;
Query query = session.createQuery(
"select usr.fullName from org.jbpm.identity.User as usr " +
"where usr.id in(select mbr.user.id from org.jbpm.identity.Membership as mbr " +
"where mbr.role = 'Project Leader')"
);
List lead = query.list();

System.out.println("================================");
System.out.println("Size of List = "+lead.size());
System.out.println("================================");

for(int i=0; i<lead.size(); i++)
{
pl = lead.get(i).toString();
count =String.valueOf(i);
option = new SelectItem(pl, pl);
projectLeaders.add(option);
}
System.out.println("================================");
System.out.println("================================");
System.out.println("PROJECTlEADERS = "+projectLeaders);
System.out.println("================================");
System.out.println("================================");

return projectLeaders;
}

Now what error, I am getting after clicking on submit button
type Exception report

exception

javax.servlet.ServletException
javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

root cause

java.lang.IllegalArgumentException
javax.faces.component.SelectItemsIterator.next(SelectItemsIterator.java:166)
javax.faces.component.SelectItemsIterator.next(SelectItemsIterator.java:49)
javax.faces.component.UISelectOne.matchValue(UISelectOne.java:165)
javax.faces.component.UISelectOne.validateValue(UISelectOne.java:137)
javax.faces.component.UIInput.validate(UIInput.java:868)
javax.faces.component.UIInput.executeValidate(UIInput.java:1071)
javax.faces.component.UIInput.processValidators(UIInput.java:663)
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1021)
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1021)
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1021)
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1021)
javax.faces.component.UIForm.processValidators(UIForm.java:229)
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1021)
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1021)
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1021)
javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:662)
com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:100)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:248)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

Please anybody guide me...

Thanking you
--Mansingh Shitole
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

<h:selectOneMenu value="#{var['pl']}">
<f:selectItems value="#{plList}" />
</h:selectOneListbox>



The closing tag looks incorrect.

Also the select item value should be BB.Arraylist (containing SelectItems objects).

I have not worked with GA so I might be wrong.
 
reply
    Bookmark Topic Watch Topic
  • New Topic