Mansingh Shitole

Greenhorn
+ Follow
since Jun 10, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mansingh Shitole

Now I am trying with different approach...lets I will give you detail..

My Bean:
package org.jbpm.identity;

import javax.faces.model.SelectItem;
import java.util.*;

public class SelectItemsBean {

protected List<SelectItem> plList = null;

public SelectItemsBean(){

}

public void setOptions(List<SelectItem> options) {
this.plList = options;
System.out.println("SelectItemsBeanClass = "+options);
}

public List<SelectItem> getOptions() {
return plList;
}
}

My faces.config.xml
<managed-bean>
<managed-bean-name>selectItemsBean</managed-bean-name>
<managed-bean-class>org.jbpm.identity.SelectItemsBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>

My UIform..
form.leaveapplication.xhtml
<h:selectOneMenu value="#{var['pl']}">
<f:selectItems value="#{selectItemsBean.plList}" />
</h:selectOneMenu>

Now I am getting error:
javax.servlet.ServletException: Expected a child component type of UISelectItem/UISelectItems for component type javax.faces.SelectOne(j_id214). Found null.
javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

root cause

java.lang.IllegalArgumentException: Expected a child component type of UISelectItem/UISelectItems for component type javax.faces.SelectOne(j_id214). Found null.
com.sun.faces.renderkit.RenderKitUtils.getSelectItems(RenderKitUtils.java:357)
com.sun.faces.renderkit.html_basic.MenuRenderer.getOptionNumber(MenuRenderer.java:644)
com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:762)
com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:304)
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:829)
org.jboss.gravel.common.renderer.RendererBase.doEncode(RendererBase.java:88)
org.jboss.gravel.common.renderer.RendererBase.doEncode(RendererBase.java:96)
org.jboss.gravel.common.renderer.RendererBase.doEncode(RendererBase.java:86)
org.jboss.gravel.common.renderer.RendererBase$ElementImpl.doEncode(RendererBase.java:337)
org.jbpm.jsf.taskformlayout.renderer.DataFormRenderer.encodeCells(DataFormRenderer.java:148)
org.jbpm.jsf.taskformlayout.renderer.DataFormRenderer.encodeChildren(DataFormRenderer.java:116)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:810)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:884)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:890)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:890)
javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:810)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:884)
javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:810)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:884)
javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:810)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:884)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:890)
com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:571)
javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:178)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:248)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
please help me to resolve this problem, I will be highly grateful to you

Thanking you,
Mansingh Shitole
13 years ago
JSF
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
13 years ago
JSF
In our JBoss JBpm project we are using JSF for UI's and those all are xhtml files...So how do I retrive from database and display in xhtml files.
14 years ago
JSF
xmlns:gd="http://gravel.jboss.org/jsf/1.0/data"

I am working on JBOSS JBPM workflow project. As I am new wth JSF..I need to have some explanation about following tag

<gd:repeat value="#{tasks}" var="task" idVar="rid" first="#{tasks_pager.first}" limit="#{tasks_pager.limit}">

So here, value="#{tasks}" , where this collection or instance of persistence class is mapped in JSF. This file's extension is a xhtml. SO please anybody let me know about How we can access database from JSF file(xhtml).

How to retrieve data from database and show in JSF forms(i.e in xhtml files)
14 years ago
JSF