myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tilo Gau" <norm...@gmx.de>
Subject [Trinidad] SelectManyShuttle NullPointerException and Understanding
Date Wed, 15 Aug 2007 11:41:09 GMT
Hi,
 
I have quite a trouble to unterstand the SelectManyShuttle and get it running.
 
First, how I understood the SelectManyShuttle so far:
<tr:selectManyShuttle leadingHeader="Not Selected" trailingHeader="Selected" value="#{detailsBean.selected}">
<f:selectItems value="#{detailsBean.all}" />
</tr:selectManyShuttle>

The value in <tr:selectManyShuttle /> is a List of indexes of the selected items.

The value in <f:selectItems /> is a List of SelectItems with index, label and description
of all items.

 

Second, how I implemented the according methods:

public List<SelectItem> getAll() {
    List<SelectItem> list = new ArrayList<SelectItem>();
    for(Iterator it = getAllItems().iterator();it.hasNext();){
        Item item = (Item)it.next();
        list.add(new SelectItem(item .getId(), item .getLabel(), item .getDescription()));
    }
    return list;
}

public List<Integer> getSelected(){
List<Integer> list = new ArrayList<Integer>();
    for(Iterator it = getSelectedItems().iterator();it.hasNext();){
        Item item = (Item)it.next();
        list.add(item.getId());
    }
    return list;
}

 

Third, what error I got, when I tried to show the page:

java.lang.NullPointerException
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SelectManyShuttleRenderer$ShuttleList.getOndblclick(SelectManyShuttleRenderer.java:901)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer.renderEventHandlers(XhtmlRenderer.java:460)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.FormElementRenderer.renderEventHandlers(FormElementRenderer.java:193)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer.renderAllAttributes(XhtmlRenderer.java:316)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.FormInputRenderer.renderAllAttributes(FormInputRenderer.java:109)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleSelectManyListboxRenderer.encodeElementContent(SimpleSelectManyListboxRenderer.java:79)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleSelectManyRenderer.encodeAllAsElement(SimpleSelectManyRenderer.java:368)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.FormElementRenderer.encodeAll(FormElementRenderer.java:109)
	at org.apache.myfaces.trinidad.render.CoreRenderer.delegateRenderer(CoreRenderer.java:318)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SelectManyShuttleRenderer$Box.encodeAllChildren(SelectManyShuttleRenderer.java:1115)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelBoxRenderer._renderContent(PanelBoxRenderer.java:413)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelBoxRenderer._renderBody(PanelBoxRenderer.java:340)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelBoxRenderer._renderMiddleRow(PanelBoxRenderer.java:267)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelBoxRenderer.encodeAll(PanelBoxRenderer.java:115)
	at org.apache.myfaces.trinidad.render.CoreRenderer.delegateRenderer(CoreRenderer.java:318)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SelectManyShuttleRenderer._renderContainerRow(SelectManyShuttleRenderer.java:577)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SelectManyShuttleRenderer.encodeElementContent(SelectManyShuttleRenderer.java:312)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleSelectManyRenderer.encodeAllAsElement(SimpleSelectManyRenderer.java:368)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.FormElementRenderer.encodeAll(FormElementRenderer.java:109)
	at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:208)
	at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:694)
	at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:287)
	at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:304)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.renderContent(PanelPartialRootRenderer.java:72)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.BodyRenderer.renderContent(BodyRenderer.java:136)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.encodeAll(PanelPartialRootRenderer.java:152)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.BodyRenderer.encodeAll(BodyRenderer.java:78)
	at org.apache.myfaces.trinidad.render.CoreRenderer.delegateRenderer(CoreRenderer.java:318)
	at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.DocumentRenderer.encodeAll(DocumentRenderer.java:80)
	at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:208)
	at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:694)
	at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:242)
	at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
	at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
	at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:181)
	at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
	at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
	at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:208)
	at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:165)
	at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138)
	at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
	at java.lang.Thread.run(Unknown Source)
 
Does somebody have  an idea, what goes wrong?
Thank you in advance,
Tilo

-- 
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail

Mime
View raw message