|
View:
New views
8 Messages
—
Rating Filter:
Alert me
|
|
|
[jira] Created: (TRINIDAD-1523) Issue with <tr:selectOneChoice> - Implementing dependent select boxesIssue with <tr:selectOneChoice> - Implementing dependent select boxes
--------------------------------------------------------------------- Key: TRINIDAD-1523 URL: https://issues.apache.org/jira/browse/TRINIDAD-1523 Project: MyFaces Trinidad Issue Type: Bug Components: Components Affects Versions: 1.2.11-core Environment: Windows Reporter: Vijay Ramalingam I am trying to implement dependent select boxes using trinidad. I have 2 drop down box, say A and B. I have set the autoSubmit="true" in dropdown A and specified partialTriggers with dropdwon B. When i change the A drop down B changes, as expected. But when i change any value in B dropdown and again change A. I get the below error. java.lang.IndexOutOfBoundsException: 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._convertIndexedSubmittedValue(SimpleSelectOneRenderer.java:214) at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleSelectOneRenderer.getConvertedValue(SimpleSelectOneRenderer.java:181) at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.InputLabelAndMessageRenderer.getConvertedValue(InputLabelAndMessageRenderer.java:65) at org.apache.myfaces.trinidad.component.UIXEditableValue.getConvertedValue(UIXEditableValue.java:422) at org.apache.myfaces.trinidad.component.UIXEditableValue.validate(UIXEditableValue.java:164) at org.apache.myfaces.trinidad.component.UIXEditableValue._executeValidate(UIXEditableValue.java:488) at org.apache.myfaces.trinidad.component.UIXEditableValue.processValidators(UIXEditableValue.java:270) at javax.faces.component.UIForm.processValidators(UIForm.java:74) at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:709) at javax.faces.component.UIViewRoot.access$101(UIViewRoot.java:43) at javax.faces.component.UIViewRoot$2.process(UIViewRoot.java:97) at javax.faces.component.UIViewRoot.process(UIViewRoot.java:206) at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:93) at org.apache.myfaces.lifecycle.ProcessValidationsExecutor.execute(ProcessValidationsExecutor.java:32) at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:148) at arch.jsf.JsfResource.process(JsfResource.java:145) at arch.presentation.beans.WebApplication._doServletFilterForRequest(WebApplication.java:564) at arch.presentation.beans.WebApplication.processResource(WebApplication.java:1368) at arch.presentation.beans.WebApplication.processRequest(WebApplication.java:2531) at arch.service.beans.ServiceContainer.processRequest(ServiceContainer.java:3913) at arch.no.engine.Context.processRequest(Context.java:68) at arch.no.engine.HttpConnector.processRequest(HttpConnector.java:58) at arch.no.http.Response.prepare(Response.java:563) at arch.no.http.Response._execute(Response.java:1975) at arch.no.http.Response.execute(Response.java:1910) at arch.no.http.HttpThreadPool._run(HttpThreadPool.java:32) at arch.util.ThreadPool._runLoopBody(ThreadPool.java:215) at arch.util.ThreadPool._runForThread(ThreadPool.java:232) at arch.util.ThreadPool.access$000(ThreadPool.java:5) at arch.util.ThreadPool$1.run(ThreadPool.java:97) Please find my XHTML content ------------------------------------------ <f:view> <h:form id="dropDownForm"> <tr:selectOneChoice valueChangeListener="#{dropdownbean.processAccountFeatureChange}" binding="#{dropdownbean.selectAccountFeature}" autoSubmit="true" value="#{dropdownbean.accountFeature}" id="selectAccountFeature" size="1"> <f:selectItems value="#{dropdownbean.accountFeatureMap}" /> </tr:selectOneChoice> <tr:selectOneChoice binding="#{dropdownbean.selectCardOrCheckType}" partialTriggers="selectAccountFeature" value="#{dropdownbean.cardOrCheckType}" id="selectCardOrCheckType" size="1"> <f:selectItems value="#{dropdownbean.checkTypeMap}" /> </tr:selectOneChoice> </h:form> </f:view> Please find my Bean code ------------------------------------ public class DropDownBean { CoreSelectOneChoice selectAccountFeature; CoreSelectOneChoice selectCardOrCheckType; String accountFeature="1"; String cardOrCheckType="SCO"; Map accountFeatureMap; Map checkTypeMap; public DropDownBean(){ super(); AMAConfig amaConfig = new AMAConfig(); accountFeatureMap = amaConfig.getAcctFeatureMap(); checkTypeMap = amaConfig.getSilverLevelCheckTypeMap(); } public void setSelectAccountFeature(CoreSelectOneChoice selectAccountFeature){ this.selectAccountFeature = selectAccountFeature; } public CoreSelectOneChoice getSelectAccountFeature(){ return this.selectAccountFeature; } public void setSelectCardOrCheckType(CoreSelectOneChoice selectCardOrCheckType){ this.selectCardOrCheckType = selectCardOrCheckType; } public CoreSelectOneChoice getSelectCardOrCheckType(){ return this.selectCardOrCheckType; } public String getAccountFeature(){ return this.accountFeature; } public void setAccountFeature(String accountFeature){ this.accountFeature = accountFeature; AMAConfig amaConfig = (AMAConfig)getValue("#{amaConfig}", AMAConfig.class); if("1".equals(accountFeature)){ this.cardOrCheckType = "SCO"; checkTypeMap = amaConfig.getSilverLevelCheckTypeMap(); }else if("2".equals(accountFeature)){ this.cardOrCheckType = "GCC"; checkTypeMap = amaConfig.getGoldLevelCheckTypeMap(); }else { this.cardOrCheckType = "PCC"; checkTypeMap = amaConfig.getPlatinumLevelCheckTypeMap(); } } public void setCardOrCheckType(String cardOrCheckType){ this.cardOrCheckType = cardOrCheckType; } public String getCardOrCheckType(){ return this.cardOrCheckType; } public Map getAccountFeatureMap(){ return this.accountFeatureMap; } public Map getCheckTypeMap(){ return this.checkTypeMap; } public void processAccountFeatureChange(ValueChangeEvent vce){ System.out.println("\nprocessAccountFeatureChange\n"); selectCardOrCheckType.setValue(null); } } I declared my bean as <managed-bean> <managed-bean-name>dropdownbean</managed-bean-name> <managed-bean-class>DropDownBean</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> Please help me. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
|
[jira] Commented: (TRINIDAD-1523) Issue with <tr:selectOneChoice> - Implementing dependent select boxes[ https://issues.apache.org/jira/browse/TRINIDAD-1523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12745565#action_12745565 ] Rafael Gonçalves Sampaio commented on TRINIDAD-1523: ---------------------------------------------------- Hello Vijay. I've had the same problem and did a workaround to get it working until some of the Project gurus solve this issue. Instead of setting null to the property in the managed bean, you should set null to the submitted value of the nested component like this: ... public void processAccountFeatureChange(ValueChangeEvent vce){ //DO YOUR WORK TO POPULATE THE NEW VALUES FOR THE NESTED COMPONENT UIComponent parent = vce.getComponent().getParent(); CoreSelectOneChoice choice = (CoreSelectOneChoice)parent.findComponent("selectCardOrCheckType"); if (null != choice) choice.setSubmittedValue(null); } ... This should work for the moment Kind Regards. > Issue with <tr:selectOneChoice> - Implementing dependent select boxes > --------------------------------------------------------------------- > > Key: TRINIDAD-1523 > URL: https://issues.apache.org/jira/browse/TRINIDAD-1523 > Project: MyFaces Trinidad > Issue Type: Bug > Components: Components > Affects Versions: 1.2.11-core > Environment: Windows > Reporter: Vijay Ramalingam > > I am trying to implement dependent select boxes using trinidad. I have 2 drop down box, say A and B. I have set the autoSubmit="true" in dropdown A and specified partialTriggers with dropdwon B. When i change the A drop down B changes, as expected. But when i change any value in B dropdown and again change A. I get the below error. > java.lang.IndexOutOfBoundsException: 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._convertIndexedSubmittedValue(SimpleSelectOneRenderer.java:214) > at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleSelectOneRenderer.getConvertedValue(SimpleSelectOneRenderer.java:181) > at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.InputLabelAndMessageRenderer.getConvertedValue(InputLabelAndMessageRenderer.java:65) > at org.apache.myfaces.trinidad.component.UIXEditableValue.getConvertedValue(UIXEditableValue.java:422) > at org.apache.myfaces.trinidad.component.UIXEditableValue.validate(UIXEditableValue.java:164) > at org.apache.myfaces.trinidad.component.UIXEditableValue._executeValidate(UIXEditableValue.java:488) > at org.apache.myfaces.trinidad.component.UIXEditableValue.processValidators(UIXEditableValue.java:270) > at javax.faces.component.UIForm.processValidators(UIForm.java:74) > at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:709) > at javax.faces.component.UIViewRoot.access$101(UIViewRoot.java:43) > at javax.faces.component.UIViewRoot$2.process(UIViewRoot.java:97) > at javax.faces.component.UIViewRoot.process(UIViewRoot.java:206) > at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:93) > at org.apache.myfaces.lifecycle.ProcessValidationsExecutor.execute(ProcessValidationsExecutor.java:32) > at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103) > at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76) > at javax.faces.webapp.FacesServlet.service(FacesServlet.java:148) > at arch.jsf.JsfResource.process(JsfResource.java:145) > at arch.presentation.beans.WebApplication._doServletFilterForRequest(WebApplication.java:564) > at arch.presentation.beans.WebApplication.processResource(WebApplication.java:1368) > at arch.presentation.beans.WebApplication.processRequest(WebApplication.java:2531) > at arch.service.beans.ServiceContainer.processRequest(ServiceContainer.java:3913) > at arch.no.engine.Context.processRequest(Context.java:68) > at arch.no.engine.HttpConnector.processRequest(HttpConnector.java:58) > at arch.no.http.Response.prepare(Response.java:563) > at arch.no.http.Response._execute(Response.java:1975) > at arch.no.http.Response.execute(Response.java:1910) > at arch.no.http.HttpThreadPool._run(HttpThreadPool.java:32) > at arch.util.ThreadPool._runLoopBody(ThreadPool.java:215) > at arch.util.ThreadPool._runForThread(ThreadPool.java:232) > at arch.util.ThreadPool.access$000(ThreadPool.java:5) > at arch.util.ThreadPool$1.run(ThreadPool.java:97) > Please find my XHTML content > ------------------------------------------ > <f:view> > <h:form id="dropDownForm"> > <tr:selectOneChoice valueChangeListener="#{dropdownbean.processAccountFeatureChange}" binding="#{dropdownbean.selectAccountFeature}" autoSubmit="true" value="#{dropdownbean.accountFeature}" id="selectAccountFeature" size="1"> > <f:selectItems value="#{dropdownbean.accountFeatureMap}" /> > </tr:selectOneChoice> > <tr:selectOneChoice binding="#{dropdownbean.selectCardOrCheckType}" partialTriggers="selectAccountFeature" value="#{dropdownbean.cardOrCheckType}" id="selectCardOrCheckType" size="1"> > <f:selectItems value="#{dropdownbean.checkTypeMap}" /> > </tr:selectOneChoice> > </h:form> > </f:view> > Please find my Bean code > ------------------------------------ > public class DropDownBean { > CoreSelectOneChoice selectAccountFeature; > > CoreSelectOneChoice selectCardOrCheckType; > > String accountFeature="1"; > > String cardOrCheckType="SCO"; > > Map accountFeatureMap; > > Map checkTypeMap; > public DropDownBean(){ > super(); > AMAConfig amaConfig = new AMAConfig(); > accountFeatureMap = amaConfig.getAcctFeatureMap(); > checkTypeMap = amaConfig.getSilverLevelCheckTypeMap(); > } > > public void setSelectAccountFeature(CoreSelectOneChoice selectAccountFeature){ > this.selectAccountFeature = selectAccountFeature; > } > public CoreSelectOneChoice getSelectAccountFeature(){ > return this.selectAccountFeature; > } > > public void setSelectCardOrCheckType(CoreSelectOneChoice selectCardOrCheckType){ > this.selectCardOrCheckType = selectCardOrCheckType; > } > public CoreSelectOneChoice getSelectCardOrCheckType(){ > return this.selectCardOrCheckType; > } > > public String getAccountFeature(){ > return this.accountFeature; > } > public void setAccountFeature(String accountFeature){ > this.accountFeature = accountFeature; > > > AMAConfig amaConfig = (AMAConfig)getValue("#{amaConfig}", AMAConfig.class); > > if("1".equals(accountFeature)){ > this.cardOrCheckType = "SCO"; > checkTypeMap = amaConfig.getSilverLevelCheckTypeMap(); > }else if("2".equals(accountFeature)){ > this.cardOrCheckType = "GCC"; > checkTypeMap = amaConfig.getGoldLevelCheckTypeMap(); > }else { > this.cardOrCheckType = "PCC"; > checkTypeMap = amaConfig.getPlatinumLevelCheckTypeMap(); > } > } > > public void setCardOrCheckType(String cardOrCheckType){ > this.cardOrCheckType = cardOrCheckType; > } > public String getCardOrCheckType(){ > return this.cardOrCheckType; > } > > public Map getAccountFeatureMap(){ > return this.accountFeatureMap; > } > > public Map getCheckTypeMap(){ > return this.checkTypeMap; > } > > public void processAccountFeatureChange(ValueChangeEvent vce){ > System.out.println("\nprocessAccountFeatureChange\n"); > selectCardOrCheckType.setValue(null); > } > } > I declared my bean as > <managed-bean> > <managed-bean-name>dropdownbean</managed-bean-name> > <managed-bean-class>DropDownBean</managed-bean-class> > <managed-bean-scope>request</managed-bean-scope> > </managed-bean> > Please help me. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
|
[jira] Commented: (TRINIDAD-1523) Issue with <tr:selectOneChoice> - Implementing dependent select boxes[ https://issues.apache.org/jira/browse/TRINIDAD-1523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12745877#action_12745877 ] Vijay Ramalingam commented on TRINIDAD-1523: -------------------------------------------- Thanks Rafael. I tried out and it worked :-) Thanks -vijay > Issue with <tr:selectOneChoice> - Implementing dependent select boxes > --------------------------------------------------------------------- > > Key: TRINIDAD-1523 > URL: https://issues.apache.org/jira/browse/TRINIDAD-1523 > Project: MyFaces Trinidad > Issue Type: Bug > Components: Components > Affects Versions: 1.2.11-core > Environment: Windows > Reporter: Vijay Ramalingam > > I am trying to implement dependent select boxes using trinidad. I have 2 drop down box, say A and B. I have set the autoSubmit="true" in dropdown A and specified partialTriggers with dropdwon B. When i change the A drop down B changes, as expected. But when i change any value in B dropdown and again change A. I get the below error. > java.lang.IndexOutOfBoundsException: 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._convertIndexedSubmittedValue(SimpleSelectOneRenderer.java:214) > at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleSelectOneRenderer.getConvertedValue(SimpleSelectOneRenderer.java:181) > at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.InputLabelAndMessageRenderer.getConvertedValue(InputLabelAndMessageRenderer.java:65) > at org.apache.myfaces.trinidad.component.UIXEditableValue.getConvertedValue(UIXEditableValue.java:422) > at org.apache.myfaces.trinidad.component.UIXEditableValue.validate(UIXEditableValue.java:164) > at org.apache.myfaces.trinidad.component.UIXEditableValue._executeValidate(UIXEditableValue.java:488) > at org.apache.myfaces.trinidad.component.UIXEditableValue.processValidators(UIXEditableValue.java:270) > at javax.faces.component.UIForm.processValidators(UIForm.java:74) > at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:709) > at javax.faces.component.UIViewRoot.access$101(UIViewRoot.java:43) > at javax.faces.component.UIViewRoot$2.process(UIViewRoot.java:97) > at javax.faces.component.UIViewRoot.process(UIViewRoot.java:206) > at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:93) > at org.apache.myfaces.lifecycle.ProcessValidationsExecutor.execute(ProcessValidationsExecutor.java:32) > at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103) > at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76) > at javax.faces.webapp.FacesServlet.service(FacesServlet.java:148) > at arch.jsf.JsfResource.process(JsfResource.java:145) > at arch.presentation.beans.WebApplication._doServletFilterForRequest(WebApplication.java:564) > at arch.presentation.beans.WebApplication.processResource(WebApplication.java:1368) > at arch.presentation.beans.WebApplication.processRequest(WebApplication.java:2531) > at arch.service.beans.ServiceContainer.processRequest(ServiceContainer.java:3913) > at arch.no.engine.Context.processRequest(Context.java:68) > at arch.no.engine.HttpConnector.processRequest(HttpConnector.java:58) > at arch.no.http.Response.prepare(Response.java:563) > at arch.no.http.Response._execute(Response.java:1975) > at arch.no.http.Response.execute(Response.java:1910) > at arch.no.http.HttpThreadPool._run(HttpThreadPool.java:32) > at arch.util.ThreadPool._runLoopBody(ThreadPool.java:215) > at arch.util.ThreadPool._runForThread(ThreadPool.java:232) > at arch.util.ThreadPool.access$000(ThreadPool.java:5) > at arch.util.ThreadPool$1.run(ThreadPool.java:97) > Please find my XHTML content > ------------------------------------------ > <f:view> > <h:form id="dropDownForm"> > <tr:selectOneChoice valueChangeListener="#{dropdownbean.processAccountFeatureChange}" binding="#{dropdownbean.selectAccountFeature}" autoSubmit="true" value="#{dropdownbean.accountFeature}" id="selectAccountFeature" size="1"> > <f:selectItems value="#{dropdownbean.accountFeatureMap}" /> > </tr:selectOneChoice> > <tr:selectOneChoice binding="#{dropdownbean.selectCardOrCheckType}" partialTriggers="selectAccountFeature" value="#{dropdownbean.cardOrCheckType}" id="selectCardOrCheckType" size="1"> > <f:selectItems value="#{dropdownbean.checkTypeMap}" /> > </tr:selectOneChoice> > </h:form> > </f:view> > Please find my Bean code > ------------------------------------ > public class DropDownBean { > CoreSelectOneChoice selectAccountFeature; > > CoreSelectOneChoice selectCardOrCheckType; > > String accountFeature="1"; > > String cardOrCheckType="SCO"; > > Map accountFeatureMap; > > Map checkTypeMap; > public DropDownBean(){ > super(); > AMAConfig amaConfig = new AMAConfig(); > accountFeatureMap = amaConfig.getAcctFeatureMap(); > checkTypeMap = amaConfig.getSilverLevelCheckTypeMap(); > } > > public void setSelectAccountFeature(CoreSelectOneChoice selectAccountFeature){ > this.selectAccountFeature = selectAccountFeature; > } > public CoreSelectOneChoice getSelectAccountFeature(){ > return this.selectAccountFeature; > } > > public void setSelectCardOrCheckType(CoreSelectOneChoice selectCardOrCheckType){ > this.selectCardOrCheckType = selectCardOrCheckType; > } > public CoreSelectOneChoice getSelectCardOrCheckType(){ > return this.selectCardOrCheckType; > } > > public String getAccountFeature(){ > return this.accountFeature; > } > public void setAccountFeature(String accountFeature){ > this.accountFeature = accountFeature; > > > AMAConfig amaConfig = (AMAConfig)getValue("#{amaConfig}", AMAConfig.class); > > if("1".equals(accountFeature)){ > this.cardOrCheckType = "SCO"; > checkTypeMap = amaConfig.getSilverLevelCheckTypeMap(); > }else if("2".equals(accountFeature)){ > this.cardOrCheckType = "GCC"; > checkTypeMap = amaConfig.getGoldLevelCheckTypeMap(); > }else { > this.cardOrCheckType = "PCC"; > checkTypeMap = amaConfig.getPlatinumLevelCheckTypeMap(); > } > } > > public void setCardOrCheckType(String cardOrCheckType){ > this.cardOrCheckType = cardOrCheckType; > } > public String getCardOrCheckType(){ > return this.cardOrCheckType; > } > > public Map getAccountFeatureMap(){ > return this.accountFeatureMap; > } > > public Map getCheckTypeMap(){ > return this.checkTypeMap; > } > > public void processAccountFeatureChange(ValueChangeEvent vce){ > System.out.println("\nprocessAccountFeatureChange\n"); > selectCardOrCheckType.setValue(null); > } > } > I declared my bean as > <managed-bean> > <managed-bean-name>dropdownbean</managed-bean-name> > <managed-bean-class>DropDownBean</managed-bean-class> > <managed-bean-scope>request</managed-bean-scope> > </managed-bean> > Please help me. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
|
[jira] Commented: (TRINIDAD-1523) Issue with <tr:selectOneChoice> - Implementing dependent select boxes[ https://issues.apache.org/jira/browse/TRINIDAD-1523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12756549#action_12756549 ] Borja Santos commented on TRINIDAD-1523: ---------------------------------------- Hello, Another step further is what I'm trying to do.. I'm trying to generate some source of dynamic group of dependent select boxes (since I don't know how many I need), and after trying all the possible solutions that I've found, I can't get rid of this problem of index out of bounds. This is my current approach. If I were able to get each selectOneChoice separately.. but since tr:iterator treats all inside it as a single component.. Rafael's solution is useless. <tr:iterator id="iterator" value="#{projectContentBean.projectItemTypes}" var="select"> <t:div styleClass="in md"> <tr:selectOneChoice id="id" simple="true" unselectedLabel="#{select.name}" partialTriggers="id" autoSubmit="true" value="#{projectContentBean.selectedIndex[select.id]}"> <f:selectItems value="#{projectContentBean.selectBoxes[select.id]}"/> </tr:selectOneChoice> </t:div> </tr:iterator> Best regards > Issue with <tr:selectOneChoice> - Implementing dependent select boxes > --------------------------------------------------------------------- > > Key: TRINIDAD-1523 > URL: https://issues.apache.org/jira/browse/TRINIDAD-1523 > Project: MyFaces Trinidad > Issue Type: Bug > Components: Components > Affects Versions: 1.2.11-core > Environment: Windows > Reporter: Vijay Ramalingam > > I am trying to implement dependent select boxes using trinidad. I have 2 drop down box, say A and B. I have set the autoSubmit="true" in dropdown A and specified partialTriggers with dropdwon B. When i change the A drop down B changes, as expected. But when i change any value in B dropdown and again change A. I get the below error. > java.lang.IndexOutOfBoundsException: 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._convertIndexedSubmittedValue(SimpleSelectOneRenderer.java:214) > at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleSelectOneRenderer.getConvertedValue(SimpleSelectOneRenderer.java:181) > at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.InputLabelAndMessageRenderer.getConvertedValue(InputLabelAndMessageRenderer.java:65) > at org.apache.myfaces.trinidad.component.UIXEditableValue.getConvertedValue(UIXEditableValue.java:422) > at org.apache.myfaces.trinidad.component.UIXEditableValue.validate(UIXEditableValue.java:164) > at org.apache.myfaces.trinidad.component.UIXEditableValue._executeValidate(UIXEditableValue.java:488) > at org.apache.myfaces.trinidad.component.UIXEditableValue.processValidators(UIXEditableValue.java:270) > at javax.faces.component.UIForm.processValidators(UIForm.java:74) > at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:709) > at javax.faces.component.UIViewRoot.access$101(UIViewRoot.java:43) > at javax.faces.component.UIViewRoot$2.process(UIViewRoot.java:97) > at javax.faces.component.UIViewRoot.process(UIViewRoot.java:206) > at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:93) > at org.apache.myfaces.lifecycle.ProcessValidationsExecutor.execute(ProcessValidationsExecutor.java:32) > at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103) > at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76) > at javax.faces.webapp.FacesServlet.service(FacesServlet.java:148) > at arch.jsf.JsfResource.process(JsfResource.java:145) > at arch.presentation.beans.WebApplication._doServletFilterForRequest(WebApplication.java:564) > at arch.presentation.beans.WebApplication.processResource(WebApplication.java:1368) > at arch.presentation.beans.WebApplication.processRequest(WebApplication.java:2531) > at arch.service.beans.ServiceContainer.processRequest(ServiceContainer.java:3913) > at arch.no.engine.Context.processRequest(Context.java:68) > at arch.no.engine.HttpConnector.processRequest(HttpConnector.java:58) > at arch.no.http.Response.prepare(Response.java:563) > at arch.no.http.Response._execute(Response.java:1975) > at arch.no.http.Response.execute(Response.java:1910) > at arch.no.http.HttpThreadPool._run(HttpThreadPool.java:32) > at arch.util.ThreadPool._runLoopBody(ThreadPool.java:215) > at arch.util.ThreadPool._runForThread(ThreadPool.java:232) > at arch.util.ThreadPool.access$000(ThreadPool.java:5) > at arch.util.ThreadPool$1.run(ThreadPool.java:97) > Please find my XHTML content > ------------------------------------------ > <f:view> > <h:form id="dropDownForm"> > <tr:selectOneChoice valueChangeListener="#{dropdownbean.processAccountFeatureChange}" binding="#{dropdownbean.selectAccountFeature}" autoSubmit="true" value="#{dropdownbean.accountFeature}" id="selectAccountFeature" size="1"> > <f:selectItems value="#{dropdownbean.accountFeatureMap}" /> > </tr:selectOneChoice> > <tr:selectOneChoice binding="#{dropdownbean.selectCardOrCheckType}" partialTriggers="selectAccountFeature" value="#{dropdownbean.cardOrCheckType}" id="selectCardOrCheckType" size="1"> > <f:selectItems value="#{dropdownbean.checkTypeMap}" /> > </tr:selectOneChoice> > </h:form> > </f:view> > Please find my Bean code > ------------------------------------ > public class DropDownBean { > CoreSelectOneChoice selectAccountFeature; > > CoreSelectOneChoice selectCardOrCheckType; > > String accountFeature="1"; > > String cardOrCheckType="SCO"; > > Map accountFeatureMap; > > Map checkTypeMap; > public DropDownBean(){ > super(); > AMAConfig amaConfig = new AMAConfig(); > accountFeatureMap = amaConfig.getAcctFeatureMap(); > checkTypeMap = amaConfig.getSilverLevelCheckTypeMap(); > } > > public void setSelectAccountFeature(CoreSelectOneChoice selectAccountFeature){ > this.selectAccountFeature = selectAccountFeature; > } > public CoreSelectOneChoice getSelectAccountFeature(){ > return this.selectAccountFeature; > } > > public void setSelectCardOrCheckType(CoreSelectOneChoice selectCardOrCheckType){ > this.selectCardOrCheckType = selectCardOrCheckType; > } > public CoreSelectOneChoice getSelectCardOrCheckType(){ > return this.selectCardOrCheckType; > } > > public String getAccountFeature(){ > return this.accountFeature; > } > public void setAccountFeature(String accountFeature){ > this.accountFeature = accountFeature; > > > AMAConfig amaConfig = (AMAConfig)getValue("#{amaConfig}", AMAConfig.class); > > if("1".equals(accountFeature)){ > this.cardOrCheckType = "SCO"; > checkTypeMap = amaConfig.getSilverLevelCheckTypeMap(); > }else if("2".equals(accountFeature)){ > this.cardOrCheckType = "GCC"; > checkTypeMap = amaConfig.getGoldLevelCheckTypeMap(); > }else { > this.cardOrCheckType = "PCC"; > checkTypeMap = amaConfig.getPlatinumLevelCheckTypeMap(); > } > } > > public void setCardOrCheckType(String cardOrCheckType){ > this.cardOrCheckType = cardOrCheckType; > } > public String getCardOrCheckType(){ > return this.cardOrCheckType; > } > > public Map getAccountFeatureMap(){ > return this.accountFeatureMap; > } > > public Map getCheckTypeMap(){ > return this.checkTypeMap; > } > > public void processAccountFeatureChange(ValueChangeEvent vce){ > System.out.println("\nprocessAccountFeatureChange\n"); > selectCardOrCheckType.setValue(null); > } > } > I declared my bean as > <managed-bean> > <managed-bean-name>dropdownbean</managed-bean-name> > <managed-bean-class>DropDownBean</managed-bean-class> > <managed-bean-scope>request</managed-bean-scope> > </managed-bean> > Please help me. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
|
[jira] Issue Comment Edited: (TRINIDAD-1523) Issue with <tr:selectOneChoice> - Implementing dependent select boxes[ https://issues.apache.org/jira/browse/TRINIDAD-1523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12756549#action_12756549 ] Borja Santos edited comment on TRINIDAD-1523 at 9/17/09 6:57 AM: ----------------------------------------------------------------- Hello, Another step further is what I'm trying to do.. I'm trying to generate some source of dynamic group of dependent select boxes (since I don't know how many I need), and after trying all the possible solutions that I've found, I can't get rid of this problem of index out of bounds. This is my current approach. If I were able to get each selectOneChoice separately.. but since tr:iterator treats all inside it as a single component.. Rafael's solution is useless. <tr:iterator id="iterator" value="#{projectContentBean.projectItemTypes}" var="select"> <t:div styleClass="in md"> <tr:selectOneChoice id="id" simple="true" unselectedLabel="#{select.name}" partialTriggers="id" autoSubmit="true" value="#{projectContentBean.selectedIndex[select.id]}"> <f:selectItems value="#{projectContentBean.selectBoxes[select.id]}"/> </tr:selectOneChoice> </t:div> </tr:iterator> Best regards was (Author: bsvazquez): Hello, Another step further is what I'm trying to do.. I'm trying to generate some source of dynamic group of dependent select boxes (since I don't know how many I need), and after trying all the possible solutions that I've found, I can't get rid of this problem of index out of bounds. This is my current approach. If I were able to get each selectOneChoice separately.. but since tr:iterator treats all inside it as a single component.. Rafael's solution is useless. <tr:iterator id="iterator" value="#{projectContentBean.projectItemTypes}" var="select"> <t:div styleClass="in md"> <tr:selectOneChoice id="id" simple="true" unselectedLabel="#{select.name}" partialTriggers="id" autoSubmit="true" value="#{projectContentBean.selectedIndex[select.id]}"> <f:selectItems value="#{projectContentBean.selectBoxes[select.id]}"/> </tr:selectOneChoice> </t:div> </tr:iterator> Best regards > Issue with <tr:selectOneChoice> - Implementing dependent select boxes > --------------------------------------------------------------------- > > Key: TRINIDAD-1523 > URL: https://issues.apache.org/jira/browse/TRINIDAD-1523 > Project: MyFaces Trinidad > Issue Type: Bug > Components: Components > Affects Versions: 1.2.11-core > Environment: Windows > Reporter: Vijay Ramalingam > > I am trying to implement dependent select boxes using trinidad. I have 2 drop down box, say A and B. I have set the autoSubmit="true" in dropdown A and specified partialTriggers with dropdwon B. When i change the A drop down B changes, as expected. But when i change any value in B dropdown and again change A. I get the below error. > java.lang.IndexOutOfBoundsException: 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._convertIndexedSubmittedValue(SimpleSelectOneRenderer.java:214) > at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleSelectOneRenderer.getConvertedValue(SimpleSelectOneRenderer.java:181) > at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.InputLabelAndMessageRenderer.getConvertedValue(InputLabelAndMessageRenderer.java:65) > at org.apache.myfaces.trinidad.component.UIXEditableValue.getConvertedValue(UIXEditableValue.java:422) > at org.apache.myfaces.trinidad.component.UIXEditableValue.validate(UIXEditableValue.java:164) > at org.apache.myfaces.trinidad.component.UIXEditableValue._executeValidate(UIXEditableValue.java:488) > at org.apache.myfaces.trinidad.component.UIXEditableValue.processValidators(UIXEditableValue.java:270) > at javax.faces.component.UIForm.processValidators(UIForm.java:74) > at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:709) > at javax.faces.component.UIViewRoot.access$101(UIViewRoot.java:43) > at javax.faces.component.UIViewRoot$2.process(UIViewRoot.java:97) > at javax.faces.component.UIViewRoot.process(UIViewRoot.java:206) > at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:93) > at org.apache.myfaces.lifecycle.ProcessValidationsExecutor.execute(ProcessValidationsExecutor.java:32) > at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103) > at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76) > at javax.faces.webapp.FacesServlet.service(FacesServlet.java:148) > at arch.jsf.JsfResource.process(JsfResource.java:145) > at arch.presentation.beans.WebApplication._doServletFilterForRequest(WebApplication.java:564) > at arch.presentation.beans.WebApplication.processResource(WebApplication.java:1368) > at arch.presentation.beans.WebApplication.processRequest(WebApplication.java:2531) > at arch.service.beans.ServiceContainer.processRequest(ServiceContainer.java:3913) > at arch.no.engine.Context.processRequest(Context.java:68) > at arch.no.engine.HttpConnector.processRequest(HttpConnector.java:58) > at arch.no.http.Response.prepare(Response.java:563) > at arch.no.http.Response._execute(Response.java:1975) > at arch.no.http.Response.execute(Response.java:1910) > at arch.no.http.HttpThreadPool._run(HttpThreadPool.java:32) > at arch.util.ThreadPool._runLoopBody(ThreadPool.java:215) > at arch.util.ThreadPool._runForThread(ThreadPool.java:232) > at arch.util.ThreadPool.access$000(ThreadPool.java:5) > at arch.util.ThreadPool$1.run(ThreadPool.java:97) > Please find my XHTML content > ------------------------------------------ > <f:view> > <h:form id="dropDownForm"> > <tr:selectOneChoice valueChangeListener="#{dropdownbean.processAccountFeatureChange}" binding="#{dropdownbean.selectAccountFeature}" autoSubmit="true" value="#{dropdownbean.accountFeature}" id="selectAccountFeature" size="1"> > <f:selectItems value="#{dropdownbean.accountFeatureMap}" /> > </tr:selectOneChoice> > <tr:selectOneChoice binding="#{dropdownbean.selectCardOrCheckType}" partialTriggers="selectAccountFeature" value="#{dropdownbean.cardOrCheckType}" id="selectCardOrCheckType" size="1"> > <f:selectItems value="#{dropdownbean.checkTypeMap}" /> > </tr:selectOneChoice> > </h:form> > </f:view> > Please find my Bean code > ------------------------------------ > public class DropDownBean { > CoreSelectOneChoice selectAccountFeature; > > CoreSelectOneChoice selectCardOrCheckType; > > String accountFeature="1"; > > String cardOrCheckType="SCO"; > > Map accountFeatureMap; > > Map checkTypeMap; > public DropDownBean(){ > super(); > AMAConfig amaConfig = new AMAConfig(); > accountFeatureMap = amaConfig.getAcctFeatureMap(); > checkTypeMap = amaConfig.getSilverLevelCheckTypeMap(); > } > > public void setSelectAccountFeature(CoreSelectOneChoice selectAccountFeature){ > this.selectAccountFeature = selectAccountFeature; > } > public CoreSelectOneChoice getSelectAccountFeature(){ > return this.selectAccountFeature; > } > > public void setSelectCardOrCheckType(CoreSelectOneChoice selectCardOrCheckType){ > this.selectCardOrCheckType = selectCardOrCheckType; > } > public CoreSelectOneChoice getSelectCardOrCheckType(){ > return this.selectCardOrCheckType; > } > > public String getAccountFeature(){ > return this.accountFeature; > } > public void setAccountFeature(String accountFeature){ > this.accountFeature = accountFeature; > > > AMAConfig amaConfig = (AMAConfig)getValue("#{amaConfig}", AMAConfig.class); > > if("1".equals(accountFeature)){ > this.cardOrCheckType = "SCO"; > checkTypeMap = amaConfig.getSilverLevelCheckTypeMap(); > }else if("2".equals(accountFeature)){ > this.cardOrCheckType = "GCC"; > checkTypeMap = amaConfig.getGoldLevelCheckTypeMap(); > }else { > this.cardOrCheckType = "PCC"; > checkTypeMap = amaConfig.getPlatinumLevelCheckTypeMap(); > } > } > > public void setCardOrCheckType(String cardOrCheckType){ > this.cardOrCheckType = cardOrCheckType; > } > public String getCardOrCheckType(){ > return this.cardOrCheckType; > } > > public Map getAccountFeatureMap(){ > return this.accountFeatureMap; > } > > public Map getCheckTypeMap(){ > return this.checkTypeMap; > } > > public void processAccountFeatureChange(ValueChangeEvent vce){ > System.out.println("\nprocessAccountFeatureChange\n"); > selectCardOrCheckType.setValue(null); > } > } > I declared my bean as > <managed-bean> > <managed-bean-name>dropdownbean</managed-bean-name> > <managed-bean-class>DropDownBean</managed-bean-class> > <managed-bean-scope>request</managed-bean-scope> > </managed-bean> > Please help me. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
|
[jira] Commented: (TRINIDAD-1523) Issue with <tr:selectOneChoice> - Implementing dependent select boxes[ https://issues.apache.org/jira/browse/TRINIDAD-1523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12756709#action_12756709 ] Rafael Gonçalves Sampaio commented on TRINIDAD-1523: ---------------------------------------------------- Hello Borja, Please note that I did NOT give a SOLUTION to the problem on the selectOneChoice tag... what I did was WORKAROUND for the error posted by Vijay, which, by the way, I've also experienced. If you have other problems wich are not related to the situation reported by Vijay I do Agree with you that my code is not suitable for your needs. Taking a first look at your code, I could not fully understand your problem, but I'd recommend that you do not generate nested combos with the same ID as you are doing, since if you would reuse my code anyhow, you couldn't get the proper nested combo. If you whish me to have a closer look at your problem please attach a runnable example w/ source of your problem or post the complete code like Vijay and also the stack trace of the error Kind Regards > Issue with <tr:selectOneChoice> - Implementing dependent select boxes > --------------------------------------------------------------------- > > Key: TRINIDAD-1523 > URL: https://issues.apache.org/jira/browse/TRINIDAD-1523 > Project: MyFaces Trinidad > Issue Type: Bug > Components: Components > Affects Versions: 1.2.11-core > Environment: Windows > Reporter: Vijay Ramalingam > > I am trying to implement dependent select boxes using trinidad. I have 2 drop down box, say A and B. I have set the autoSubmit="true" in dropdown A and specified partialTriggers with dropdwon B. When i change the A drop down B changes, as expected. But when i change any value in B dropdown and again change A. I get the below error. > java.lang.IndexOutOfBoundsException: 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._convertIndexedSubmittedValue(SimpleSelectOneRenderer.java:214) > at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleSelectOneRenderer.getConvertedValue(SimpleSelectOneRenderer.java:181) > at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.InputLabelAndMessageRenderer.getConvertedValue(InputLabelAndMessageRenderer.java:65) > at org.apache.myfaces.trinidad.component.UIXEditableValue.getConvertedValue(UIXEditableValue.java:422) > at org.apache.myfaces.trinidad.component.UIXEditableValue.validate(UIXEditableValue.java:164) > at org.apache.myfaces.trinidad.component.UIXEditableValue._executeValidate(UIXEditableValue.java:488) > at org.apache.myfaces.trinidad.component.UIXEditableValue.processValidators(UIXEditableValue.java:270) > at javax.faces.component.UIForm.processValidators(UIForm.java:74) > at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:709) > at javax.faces.component.UIViewRoot.access$101(UIViewRoot.java:43) > at javax.faces.component.UIViewRoot$2.process(UIViewRoot.java:97) > at javax.faces.component.UIViewRoot.process(UIViewRoot.java:206) > at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:93) > at org.apache.myfaces.lifecycle.ProcessValidationsExecutor.execute(ProcessValidationsExecutor.java:32) > at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103) > at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76) > at javax.faces.webapp.FacesServlet.service(FacesServlet.java:148) > at arch.jsf.JsfResource.process(JsfResource.java:145) > at arch.presentation.beans.WebApplication._doServletFilterForRequest(WebApplication.java:564) > at arch.presentation.beans.WebApplication.processResource(WebApplication.java:1368) > at arch.presentation.beans.WebApplication.processRequest(WebApplication.java:2531) > at arch.service.beans.ServiceContainer.processRequest(ServiceContainer.java:3913) > at arch.no.engine.Context.processRequest(Context.java:68) > at arch.no.engine.HttpConnector.processRequest(HttpConnector.java:58) > at arch.no.http.Response.prepare(Response.java:563) > at arch.no.http.Response._execute(Response.java:1975) > at arch.no.http.Response.execute(Response.java:1910) > at arch.no.http.HttpThreadPool._run(HttpThreadPool.java:32) > at arch.util.ThreadPool._runLoopBody(ThreadPool.java:215) > at arch.util.ThreadPool._runForThread(ThreadPool.java:232) > at arch.util.ThreadPool.access$000(ThreadPool.java:5) > at arch.util.ThreadPool$1.run(ThreadPool.java:97) > Please find my XHTML content > ------------------------------------------ > <f:view> > <h:form id="dropDownForm"> > <tr:selectOneChoice valueChangeListener="#{dropdownbean.processAccountFeatureChange}" binding="#{dropdownbean.selectAccountFeature}" autoSubmit="true" value="#{dropdownbean.accountFeature}" id="selectAccountFeature" size="1"> > <f:selectItems value="#{dropdownbean.accountFeatureMap}" /> > </tr:selectOneChoice> > <tr:selectOneChoice binding="#{dropdownbean.selectCardOrCheckType}" partialTriggers="selectAccountFeature" value="#{dropdownbean.cardOrCheckType}" id="selectCardOrCheckType" size="1"> > <f:selectItems value="#{dropdownbean.checkTypeMap}" /> > </tr:selectOneChoice> > </h:form> > </f:view> > Please find my Bean code > ------------------------------------ > public class DropDownBean { > CoreSelectOneChoice selectAccountFeature; > > CoreSelectOneChoice selectCardOrCheckType; > > String accountFeature="1"; > > String cardOrCheckType="SCO"; > > Map accountFeatureMap; > > Map checkTypeMap; > public DropDownBean(){ > super(); > AMAConfig amaConfig = new AMAConfig(); > accountFeatureMap = amaConfig.getAcctFeatureMap(); > checkTypeMap = amaConfig.getSilverLevelCheckTypeMap(); > } > > public void setSelectAccountFeature(CoreSelectOneChoice selectAccountFeature){ > this.selectAccountFeature = selectAccountFeature; > } > public CoreSelectOneChoice getSelectAccountFeature(){ > return this.selectAccountFeature; > } > > public void setSelectCardOrCheckType(CoreSelectOneChoice selectCardOrCheckType){ > this.selectCardOrCheckType = selectCardOrCheckType; > } > public CoreSelectOneChoice getSelectCardOrCheckType(){ > return this.selectCardOrCheckType; > } > > public String getAccountFeature(){ > return this.accountFeature; > } > public void setAccountFeature(String accountFeature){ > this.accountFeature = accountFeature; > > > AMAConfig amaConfig = (AMAConfig)getValue("#{amaConfig}", AMAConfig.class); > > if("1".equals(accountFeature)){ > this.cardOrCheckType = "SCO"; > checkTypeMap = amaConfig.getSilverLevelCheckTypeMap(); > }else if("2".equals(accountFeature)){ > this.cardOrCheckType = "GCC"; > checkTypeMap = amaConfig.getGoldLevelCheckTypeMap(); > }else { > this.cardOrCheckType = "PCC"; > checkTypeMap = amaConfig.getPlatinumLevelCheckTypeMap(); > } > } > > public void setCardOrCheckType(String cardOrCheckType){ > this.cardOrCheckType = cardOrCheckType; > } > public String getCardOrCheckType(){ > return this.cardOrCheckType; > } > > public Map getAccountFeatureMap(){ > return this.accountFeatureMap; > } > > public Map getCheckTypeMap(){ > return this.checkTypeMap; > } > > public void processAccountFeatureChange(ValueChangeEvent vce){ > System.out.println("\nprocessAccountFeatureChange\n"); > selectCardOrCheckType.setValue(null); > } > } > I declared my bean as > <managed-bean> > <managed-bean-name>dropdownbean</managed-bean-name> > <managed-bean-class>DropDownBean</managed-bean-class> > <managed-bean-scope>request</managed-bean-scope> > </managed-bean> > Please help me. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
|
[jira] Commented: (TRINIDAD-1523) Issue with <tr:selectOneChoice> - Implementing dependent select boxes[ https://issues.apache.org/jira/browse/TRINIDAD-1523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12756788#action_12756788 ] Borja Santos commented on TRINIDAD-1523: ---------------------------------------- First of all.. I know that it was not a solution, and perhaps I did not use the correct word when talking about it. Sorry for that and thank you for your quick answer. Not using the same id was one of the things that I was looking for, but since the id property does not accept EL (security reasons) I'm not able to set different id's.. There's another fact: the tr:iterator treats everything inside it as a unique component. e.g. in a concrete case I have three combos, and although when rendering they have different id's (you know, blahbla:0:id, blahblah:1:id, and so on..), when I try to get the source of a ValueChangeEvent, for example, it always returns THE unique id, whether is the first combo or the second or.. So, in this scenario, I'm not able to build dynamic and dependent select boxes, populating the 'child' combo when updating the selected value at the 'parent'. Their values (the options of the combos) are lost somewhere when doing the PPR, and when it tries to restore the index selected before, it throws the IndexOutOfBoundsException.. I'll try to find a way of doing this.. but as I said before, thank you so much. And of course, meanwhile, ideas are accepted. Best regards, Borja > Issue with <tr:selectOneChoice> - Implementing dependent select boxes > --------------------------------------------------------------------- > > Key: TRINIDAD-1523 > URL: https://issues.apache.org/jira/browse/TRINIDAD-1523 > Project: MyFaces Trinidad > Issue Type: Bug > Components: Components > Affects Versions: 1.2.11-core > Environment: Windows > Reporter: Vijay Ramalingam > > I am trying to implement dependent select boxes using trinidad. I have 2 drop down box, say A and B. I have set the autoSubmit="true" in dropdown A and specified partialTriggers with dropdwon B. When i change the A drop down B changes, as expected. But when i change any value in B dropdown and again change A. I get the below error. > java.lang.IndexOutOfBoundsException: 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._convertIndexedSubmittedValue(SimpleSelectOneRenderer.java:214) > at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleSelectOneRenderer.getConvertedValue(SimpleSelectOneRenderer.java:181) > at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.InputLabelAndMessageRenderer.getConvertedValue(InputLabelAndMessageRenderer.java:65) > at org.apache.myfaces.trinidad.component.UIXEditableValue.getConvertedValue(UIXEditableValue.java:422) > at org.apache.myfaces.trinidad.component.UIXEditableValue.validate(UIXEditableValue.java:164) > at org.apache.myfaces.trinidad.component.UIXEditableValue._executeValidate(UIXEditableValue.java:488) > at org.apache.myfaces.trinidad.component.UIXEditableValue.processValidators(UIXEditableValue.java:270) > at javax.faces.component.UIForm.processValidators(UIForm.java:74) > at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:709) > at javax.faces.component.UIViewRoot.access$101(UIViewRoot.java:43) > at javax.faces.component.UIViewRoot$2.process(UIViewRoot.java:97) > at javax.faces.component.UIViewRoot.process(UIViewRoot.java:206) > at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:93) > at org.apache.myfaces.lifecycle.ProcessValidationsExecutor.execute(ProcessValidationsExecutor.java:32) > at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103) > at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76) > at javax.faces.webapp.FacesServlet.service(FacesServlet.java:148) > at arch.jsf.JsfResource.process(JsfResource.java:145) > at arch.presentation.beans.WebApplication._doServletFilterForRequest(WebApplication.java:564) > at arch.presentation.beans.WebApplication.processResource(WebApplication.java:1368) > at arch.presentation.beans.WebApplication.processRequest(WebApplication.java:2531) > at arch.service.beans.ServiceContainer.processRequest(ServiceContainer.java:3913) > at arch.no.engine.Context.processRequest(Context.java:68) > at arch.no.engine.HttpConnector.processRequest(HttpConnector.java:58) > at arch.no.http.Response.prepare(Response.java:563) > at arch.no.http.Response._execute(Response.java:1975) > at arch.no.http.Response.execute(Response.java:1910) > at arch.no.http.HttpThreadPool._run(HttpThreadPool.java:32) > at arch.util.ThreadPool._runLoopBody(ThreadPool.java:215) > at arch.util.ThreadPool._runForThread(ThreadPool.java:232) > at arch.util.ThreadPool.access$000(ThreadPool.java:5) > at arch.util.ThreadPool$1.run(ThreadPool.java:97) > Please find my XHTML content > ------------------------------------------ > <f:view> > <h:form id="dropDownForm"> > <tr:selectOneChoice valueChangeListener="#{dropdownbean.processAccountFeatureChange}" binding="#{dropdownbean.selectAccountFeature}" autoSubmit="true" value="#{dropdownbean.accountFeature}" id="selectAccountFeature" size="1"> > <f:selectItems value="#{dropdownbean.accountFeatureMap}" /> > </tr:selectOneChoice> > <tr:selectOneChoice binding="#{dropdownbean.selectCardOrCheckType}" partialTriggers="selectAccountFeature" value="#{dropdownbean.cardOrCheckType}" id="selectCardOrCheckType" size="1"> > <f:selectItems value="#{dropdownbean.checkTypeMap}" /> > </tr:selectOneChoice> > </h:form> > </f:view> > Please find my Bean code > ------------------------------------ > public class DropDownBean { > CoreSelectOneChoice selectAccountFeature; > > CoreSelectOneChoice selectCardOrCheckType; > > String accountFeature="1"; > > String cardOrCheckType="SCO"; > > Map accountFeatureMap; > > Map checkTypeMap; > public DropDownBean(){ > super(); > AMAConfig amaConfig = new AMAConfig(); > accountFeatureMap = amaConfig.getAcctFeatureMap(); > checkTypeMap = amaConfig.getSilverLevelCheckTypeMap(); > } > > public void setSelectAccountFeature(CoreSelectOneChoice selectAccountFeature){ > this.selectAccountFeature = selectAccountFeature; > } > public CoreSelectOneChoice getSelectAccountFeature(){ > return this.selectAccountFeature; > } > > public void setSelectCardOrCheckType(CoreSelectOneChoice selectCardOrCheckType){ > this.selectCardOrCheckType = selectCardOrCheckType; > } > public CoreSelectOneChoice getSelectCardOrCheckType(){ > return this.selectCardOrCheckType; > } > > public String getAccountFeature(){ > return this.accountFeature; > } > public void setAccountFeature(String accountFeature){ > this.accountFeature = accountFeature; > > > AMAConfig amaConfig = (AMAConfig)getValue("#{amaConfig}", AMAConfig.class); > > if("1".equals(accountFeature)){ > this.cardOrCheckType = "SCO"; > checkTypeMap = amaConfig.getSilverLevelCheckTypeMap(); > }else if("2".equals(accountFeature)){ > this.cardOrCheckType = "GCC"; > checkTypeMap = amaConfig.getGoldLevelCheckTypeMap(); > }else { > this.cardOrCheckType = "PCC"; > checkTypeMap = amaConfig.getPlatinumLevelCheckTypeMap(); > } > } > > public void setCardOrCheckType(String cardOrCheckType){ > this.cardOrCheckType = cardOrCheckType; > } > public String getCardOrCheckType(){ > return this.cardOrCheckType; > } > > public Map getAccountFeatureMap(){ > return this.accountFeatureMap; > } > > public Map getCheckTypeMap(){ > return this.checkTypeMap; > } > > public void processAccountFeatureChange(ValueChangeEvent vce){ > System.out.println("\nprocessAccountFeatureChange\n"); > selectCardOrCheckType.setValue(null); > } > } > I declared my bean as > <managed-bean> > <managed-bean-name>dropdownbean</managed-bean-name> > <managed-bean-class>DropDownBean</managed-bean-class> > <managed-bean-scope>request</managed-bean-scope> > </managed-bean> > Please help me. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
|
[jira] Commented: (TRINIDAD-1523) Issue with <tr:selectOneChoice> - Implementing dependent select boxes[ https://issues.apache.org/jira/browse/TRINIDAD-1523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12756982#action_12756982 ] Vijay Ramalingam commented on TRINIDAD-1523: -------------------------------------------- Rafael/Borja, Thanks a lot for your valuable inputs and suggestions. selectCardOrCheckTypeChoice.setSubmittedValue(null); // this is needed to reset the child menu. But i did make one more change to it, in the faces-config.xml. I changed the scope to session. Borja, can you try that in your problem? Please find below an working example of multiple dependent boxes. However this doesn't uses trinidad( only JSF ). But this might help you. basically we need to have a very good understanding on the JSF life-cycle. http://balusc.blogspot.com/2007/10/populate-child-menus.html Thanks -vijay. > Issue with <tr:selectOneChoice> - Implementing dependent select boxes > --------------------------------------------------------------------- > > Key: TRINIDAD-1523 > URL: https://issues.apache.org/jira/browse/TRINIDAD-1523 > Project: MyFaces Trinidad > Issue Type: Bug > Components: Components > Affects Versions: 1.2.11-core > Environment: Windows > Reporter: Vijay Ramalingam > > I am trying to implement dependent select boxes using trinidad. I have 2 drop down box, say A and B. I have set the autoSubmit="true" in dropdown A and specified partialTriggers with dropdwon B. When i change the A drop down B changes, as expected. But when i change any value in B dropdown and again change A. I get the below error. > java.lang.IndexOutOfBoundsException: 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._convertIndexedSubmittedValue(SimpleSelectOneRenderer.java:214) > at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleSelectOneRenderer.getConvertedValue(SimpleSelectOneRenderer.java:181) > at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.InputLabelAndMessageRenderer.getConvertedValue(InputLabelAndMessageRenderer.java:65) > at org.apache.myfaces.trinidad.component.UIXEditableValue.getConvertedValue(UIXEditableValue.java:422) > at org.apache.myfaces.trinidad.component.UIXEditableValue.validate(UIXEditableValue.java:164) > at org.apache.myfaces.trinidad.component.UIXEditableValue._executeValidate(UIXEditableValue.java:488) > at org.apache.myfaces.trinidad.component.UIXEditableValue.processValidators(UIXEditableValue.java:270) > at javax.faces.component.UIForm.processValidators(UIForm.java:74) > at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:709) > at javax.faces.component.UIViewRoot.access$101(UIViewRoot.java:43) > at javax.faces.component.UIViewRoot$2.process(UIViewRoot.java:97) > at javax.faces.component.UIViewRoot.process(UIViewRoot.java:206) > at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:93) > at org.apache.myfaces.lifecycle.ProcessValidationsExecutor.execute(ProcessValidationsExecutor.java:32) > at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103) > at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76) > at javax.faces.webapp.FacesServlet.service(FacesServlet.java:148) > at arch.jsf.JsfResource.process(JsfResource.java:145) > at arch.presentation.beans.WebApplication._doServletFilterForRequest(WebApplication.java:564) > at arch.presentation.beans.WebApplication.processResource(WebApplication.java:1368) > at arch.presentation.beans.WebApplication.processRequest(WebApplication.java:2531) > at arch.service.beans.ServiceContainer.processRequest(ServiceContainer.java:3913) > at arch.no.engine.Context.processRequest(Context.java:68) > at arch.no.engine.HttpConnector.processRequest(HttpConnector.java:58) > at arch.no.http.Response.prepare(Response.java:563) > at arch.no.http.Response._execute(Response.java:1975) > at arch.no.http.Response.execute(Response.java:1910) > at arch.no.http.HttpThreadPool._run(HttpThreadPool.java:32) > at arch.util.ThreadPool._runLoopBody(ThreadPool.java:215) > at arch.util.ThreadPool._runForThread(ThreadPool.java:232) > at arch.util.ThreadPool.access$000(ThreadPool.java:5) > at arch.util.ThreadPool$1.run(ThreadPool.java:97) > Please find my XHTML content > ------------------------------------------ > <f:view> > <h:form id="dropDownForm"> > <tr:selectOneChoice valueChangeListener="#{dropdownbean.processAccountFeatureChange}" binding="#{dropdownbean.selectAccountFeature}" autoSubmit="true" value="#{dropdownbean.accountFeature}" id="selectAccountFeature" size="1"> > <f:selectItems value="#{dropdownbean.accountFeatureMap}" /> > </tr:selectOneChoice> > <tr:selectOneChoice binding="#{dropdownbean.selectCardOrCheckType}" partialTriggers="selectAccountFeature" value="#{dropdownbean.cardOrCheckType}" id="selectCardOrCheckType" size="1"> > <f:selectItems value="#{dropdownbean.checkTypeMap}" /> > </tr:selectOneChoice> > </h:form> > </f:view> > Please find my Bean code > ------------------------------------ > public class DropDownBean { > CoreSelectOneChoice selectAccountFeature; > > CoreSelectOneChoice selectCardOrCheckType; > > String accountFeature="1"; > > String cardOrCheckType="SCO"; > > Map accountFeatureMap; > > Map checkTypeMap; > public DropDownBean(){ > super(); > AMAConfig amaConfig = new AMAConfig(); > accountFeatureMap = amaConfig.getAcctFeatureMap(); > checkTypeMap = amaConfig.getSilverLevelCheckTypeMap(); > } > > public void setSelectAccountFeature(CoreSelectOneChoice selectAccountFeature){ > this.selectAccountFeature = selectAccountFeature; > } > public CoreSelectOneChoice getSelectAccountFeature(){ > return this.selectAccountFeature; > } > > public void setSelectCardOrCheckType(CoreSelectOneChoice selectCardOrCheckType){ > this.selectCardOrCheckType = selectCardOrCheckType; > } > public CoreSelectOneChoice getSelectCardOrCheckType(){ > return this.selectCardOrCheckType; > } > > public String getAccountFeature(){ > return this.accountFeature; > } > public void setAccountFeature(String accountFeature){ > this.accountFeature = accountFeature; > > > AMAConfig amaConfig = (AMAConfig)getValue("#{amaConfig}", AMAConfig.class); > > if("1".equals(accountFeature)){ > this.cardOrCheckType = "SCO"; > checkTypeMap = amaConfig.getSilverLevelCheckTypeMap(); > }else if("2".equals(accountFeature)){ > this.cardOrCheckType = "GCC"; > checkTypeMap = amaConfig.getGoldLevelCheckTypeMap(); > }else { > this.cardOrCheckType = "PCC"; > checkTypeMap = amaConfig.getPlatinumLevelCheckTypeMap(); > } > } > > public void setCardOrCheckType(String cardOrCheckType){ > this.cardOrCheckType = cardOrCheckType; > } > public String getCardOrCheckType(){ > return this.cardOrCheckType; > } > > public Map getAccountFeatureMap(){ > return this.accountFeatureMap; > } > > public Map getCheckTypeMap(){ > return this.checkTypeMap; > } > > public void processAccountFeatureChange(ValueChangeEvent vce){ > System.out.println("\nprocessAccountFeatureChange\n"); > selectCardOrCheckType.setValue(null); > } > } > I declared my bean as > <managed-bean> > <managed-bean-name>dropdownbean</managed-bean-name> > <managed-bean-class>DropDownBean</managed-bean-class> > <managed-bean-scope>request</managed-bean-scope> > </managed-bean> > Please help me. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
| Free embeddable forum powered by Nabble | Forum Help |