myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vinod Krishnan <vin.si...@gmail.com>
Subject Re: Problem w/ tr:selectOneChoice
Date Wed, 19 May 2010 11:25:46 GMT
can u try

selectedEntry = ""; // instead of null

On Wed, May 19, 2010 at 4:45 PM, Gronenborn, Frank <Frank.Gronenborn@arag.de
> wrote:

> The exception occurs inside the RENDER_RESPONSE phase, if this helps...
>
> Frank
>
> -----Ursprüngliche Nachricht-----
> Von: Gronenborn, Frank [mailto:Frank.Gronenborn@arag.de]
> Gesendet: Mittwoch, 19. Mai 2010 13:04
> An: MyFaces Discussion
> Betreff: AW: Problem w/ tr:selectOneChoice
>
> Here it is (package declaration omitted):
>
>
> import java.util.ArrayList;
> import java.util.List;
>
> import javax.faces.model.SelectItem;
>
> public class Bean {
>        private String selectedEntry;
>        private List<SelectItem> entries;
>
>
>        private void initEntries() {
>                entries = new ArrayList<SelectItem>();
>                // TODO: load Entries From Database
>                // here: init with some dummy content
>                entries.add(new SelectItem("First", "First", "First",
> false));
>        }
>        public List<SelectItem> getEntries() {
>                return entries;
>        }
>
>        public String getSelectedEntry() {
>                return selectedEntry;
>        }
>
>        public void setSelectedEntry(String pSelectedEntry) {
>                selectedEntry = pSelectedEntry;
>        }
>
>        public void doSomething() {
>                // TODO: delete selected Entry From Database and reload
>                // list; here: init with some dummy content
>                entries = new ArrayList<SelectItem>();
>                selectedEntry = null;
>        }
> }
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Vinod Krishnan [mailto:vin.sinin@gmail.com]
> Gesendet: Mittwoch, 19. Mai 2010 12:43
> An: MyFaces Discussion
> Betreff: Re: Problem w/ tr:selectOneChoice
>
> Can u please paste the code that you do inside doSomething method
>
> On Wed, May 19, 2010 at 4:06 PM, Gronenborn, Frank <
> Frank.Gronenborn@arag.de
> > wrote:
>
> > Indeed, there was none partialSubmit="true" attribute set in the
> > tr:commandButton. I corrected that, but without any significant effect:
> The
> > error still occurs.
> >
> > Frank
> >
> >
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Vinod Krishnan [mailto:vin.sinin@gmail.com]
> > Gesendet: Mittwoch, 19. Mai 2010 11:51
> > An: MyFaces Discussion
> > Betreff: Re: Problem w/ tr:selectOneChoice
> >
> > if you have a partialTriggers="button1" then there is no
> partailSubmit=true
> > for the commandbutton could you please check
> >
> > On Wed, May 19, 2010 at 3:18 PM, Gronenborn, Frank <
> > Frank.Gronenborn@arag.de
> > > wrote:
> >
> > > Yeah, sure, that was a typo just because I tried to simplify the code.
> Of
> > > course  the trigger is button1, thanks
> > >
> > > Frank
> > >
> > >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Jozef Dropco [mailto:jozef.dropco@gmail.com]
> > > Gesendet: Mittwoch, 19. Mai 2010 11:38
> > > An: MyFaces Discussion
> > > Betreff: Re: Problem w/ tr:selectOneChoice
> > >
> > > Hi I am not sure but
> > >
> > > partialTriggers should be "button1" instead of "button".
> > >
> > >
> > > Jozef
> > >
> > > On 19.5.2010 11:30, Gronenborn, Frank wrote:
> > > > Hi all,
> > > >
> > > >
> > > >
> > > > I'm using Trinidad 1.2.13 and face the following problem:
> > > >
> > > >
> > > >
> > > > I have a selectOneChoice like this:
> > > >
> > > >
> > > >
> > > > <tr:selectOneChoice id="choice1" labelvalue="#{Bean.selectedEntry}"
> > > autoSubmit="true" partialTriggers="button">
> > > >
> > > > <f:selectItems  value="#{Bean.entries}" />
> > > >
> > > > </tr:selectOneChoice>
> > > >
> > > >
> > > >
> > > > plus the corresponding button:
> > > >
> > > >
> > > >
> > > > <tr:commandButton  id="button1" immediate="true" icon="button.gif"
> > > action="#{Bean.doSomething}" useWindow="true"
> > > returnListener="#{Bean.returned}"/>
> > > >
> > > >
> > > >
> > > > In the Bean-Method doSomething(), I show some simple confirm-dialog
> and
> > > delete the selectedEntry from the list (incl. reset the selectedEntry
> to
> > > null) on dialog-return. After this step get-Methods for both entries
> and
> > > selectedEntry are called, returning the updated list, null resp. So
> far,
> > > that's fine.
> > > >
> > > > But actually inside the rendered page the selected item in the
> comboBox
> > > doesn't change to null but the last one in the list instead, and if I
> > delete
> > > the last element of the list I get the following error.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > [19.05.10 11:23:33:071 CEST] 0000002a viewhandler   E   Error
> Rendering
> > > View[/test.jspx]
> > > >
> > > >
> java.lang.IndexOutOfBoundsException:
> > > Index SelectOne submittedValue's index 1 is out of bounds. It should be
> > > between 0 and 0
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleSelectOneRenderer.__getIndex(SimpleSelectOneRenderer.java:423)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleSelectOneRenderer._getSelectedIndex(SimpleSelectOneRenderer.java:548)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleSelectOneRenderer.encodeAllAsElement(SimpleSelectOneRenderer.java:271)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.FormElementRenderer.encodeAll(FormElementRenderer.java:109)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidad.render.CoreRenderer.delegateRenderer(CoreRenderer.java:446)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.InputLabelAndMessageRenderer.renderFieldCellContents(InputLabelAndMessageRenderer.java:146)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.LabelAndMessageRenderer._renderFieldCell(LabelAndMessageRenderer.java:470)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.LabelAndMessageRenderer.encodeAll(LabelAndMessageRenderer.java:340)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.InputLabelAndMessageRenderer.encodeAll(InputLabelAndMessageRenderer.java:124)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:794)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer._encodeFormItem(PanelFormLayoutRenderer.java:911)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer.access$100(PanelFormLayoutRenderer.java:48)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1419)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1338)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:170)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:255)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer._encodeChildren(PanelFormLayoutRenderer.java:312)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelFormLayoutRenderer.encodeAll(PanelFormLayoutRenderer.java:137)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:794)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.renderChild(RendererUtils.java:534)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.renderChildren(RendererUtils.java:511)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.renderChild(RendererUtils.java:532)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.renderChildren(RendererUtils.java:511)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.custom.htmlTag.HtmlTagRenderer.encodeChildren(HtmlTagRenderer.java:111)
> > > >
> > > >        at
> > >
> >
> javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:611)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.renderChild(RendererUtils.java:528)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.renderChildren(RendererUtils.java:511)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.custom.htmlTag.HtmlTagRenderer.encodeChildren(HtmlTagRenderer.java:111)
> > > >
> > > >        at
> > >
> >
> javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:611)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:402)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:432)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.renderContent(PanelPartialRootRenderer.java:69)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.BodyRenderer.renderContent(BodyRenderer.java:142)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.encodeAll(PanelPartialRootRenderer.java:115)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.BodyRenderer.encodeAll(BodyRenderer.java:78)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidad.render.CoreRenderer.delegateRenderer(CoreRenderer.java:446)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.DocumentRenderer.encodeAll(DocumentRenderer.java:80)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:794)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidad.component.UIXComponentBase.__encodeRecursive(UIXComponentBase.java:1544)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidad.component.UIXComponentBase.encodeAll(UIXComponentBase.java:814)
> > > >
> > > >        at
> > > javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)
> > > >
> > > >        at
> > >
> >
> com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
> > > >
> > > >        at
> > >
> >
> javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:48)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
> > > >
> > > >        at
> > >
> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
> > > >
> > > >        at
> > javax.faces.webapp.FacesServlet.service(FacesServlet.java:182)
> > > >
> > > >        at
> > >
> >
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1146)
> > > >
> > > >        at
> > >
> >
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1087)
> > > >
> > > >        at
> > >
> >
> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
> > > >
> > > >        at
> > >
> >
> com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
> > > >
> > > >        at
> > >
> >
> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
> > > >
> > > >        at
> > >
> >
> org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:341)
> > > >
> > > >        at
> > >
> >
> com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
> > > >
> > > >        at
> > >
> >
> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
> > > >
> > > >        at
> > >
> >
> com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
> > > >
> > > >        at
> > >
> >
> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:840)
> > > >
> > > >        at
> > >
> >
> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:683)
> > > >
> > > >        at
> > >
> >
> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:589)
> > > >
> > > >        at
> > >
> >
> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:489)
> > > >
> > > >        at
> > >
> >
> com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
> > > >
> > > >        at
> > >
> com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:748)
> > > >
> > > >        at
> > >
> >
> com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1466)
> > > >
> > > >        at
> > >
> >
> com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:122)
> > > >
> > > >        at
> > >
> >
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
> > > >
> > > >        at
> > >
> >
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
> > > >
> > > >        at
> > >
> >
> com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
> > > >
> > > >        at
> > >
> >
> com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
> > > >
> > > >        at
> > >
> >
> com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
> > > >
> > > >        at
> > >
> >
> com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
> > > >
> > > >        at
> com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
> > > >
> > > >        at
> > com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
> > > >
> > > >        at
> > >
> >
> com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
> > > >
> > > >        at
> com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
> > > >
> > > >        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > I found some comments around the web that suggest similar messages as
> > > Trinidad bugs. Does this look like a Trinidad issue or is it more
> likely
> > a
> > > problem of my own?
> > > >
> > > > Any ideas are very appreciated,
> > > >
> > > > Thanks in advance,
> > > >
> > > > Frank
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Frank Gronenborn
> > > >
> > > > Softwareentwicklung
> > > >
> > > > Dokumentenmanagement / Workflow, AKB 8125
> > > >
> > > >
> > > >
> > > > ARAG IT GmbH
> > > >
> > > > ARAG Platz 1, 40472 Düsseldorf
> > > >
> > > >
> > > >
> > > > Tel.: +49 (0)211  964-1673
> > > >
> > > > Fax: +49 (0)211  964-1340
> > > >
> > > > frank.gronenborn@ARAG.de<mailto:frank.gronenborn@ARAG.de>
> > > >
> > > > www.ARAG.de<http://www.arag.de/>
> > > >
> > > >
> > > >
> > > > Geschäftsführer: Ottmar Liebler, Hanno Petersen
> > > >
> > > > Sitz und Registergericht: Düsseldorf, HRB 10934
> > > >
> > > > USt-ID-Nr.: DE 119 356 473
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message