GeeCON Prague 2014*
The moose likes JSF and the fly likes java.lang.StringIndexOutOfBoundsException in primefaces ajax call Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "java.lang.StringIndexOutOfBoundsException in primefaces ajax call" Watch "java.lang.StringIndexOutOfBoundsException in primefaces ajax call" New topic
Author

java.lang.StringIndexOutOfBoundsException in primefaces ajax call

Kumar Sugandh
Greenhorn

Joined: Dec 29, 2012
Posts: 7
<h:form id="createAccountFormId">
<p:selectOneMenu id="accountDropDownId"
value="#{captureAccountDetailBackingBean.accountType}" >
<f:selectItems
value="#{captureAccountDetailBackingBean.accountTypeList}"
itemValue="#{accountList.accoutTypeId}" var="accountList"
itemLabel="#{msg[accountList.accountTypeName]}" />
<p:ajax event="change"
process="createAccountFormId:accountDropDownId"
actionListener="#{installationController.handleAccountType}"
update="createAccountFormId:accountTypeDetailsDivId" />
</p:selectOneMenu>

<h:panelGrid columns="3" id="accountTypeDetailsDivId"
rendered="#{captureAccountDetailBackingBean.showAccountTypeDetails}">

</h:panelGrid>

</h:form>


public void handleAccountType(ActionEvent evt) {
System.out.println("Hello");
if(accountType.equalsIgnoreCase("Saving")){
showAccountTypeDetails = true;
}else{
showAccountTypeDetails = false;
}
}


java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1937)
at com.sun.faces.renderkit.ServerSideStateHelper.getState(ServerSideStateHelper.java:263)
at com.sun.faces.renderkit.ResponseStateManagerImpl.getState(ResponseStateManagerImpl.java:97)
at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:217)
at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:177)
at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:119)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:438)
at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:144)
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:182)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:107)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)



On making ajax call using p:ajax (method handleAccountType() ) on select of dropdown, getting above exception. Please help.
Kumar Sugandh
Greenhorn

Joined: Dec 29, 2012
Posts: 7
The problem is coming in Mozilla firefox browser. In google crome it works perfectly fine.
 
GeeCON Prague 2014
 
subject: java.lang.StringIndexOutOfBoundsException in primefaces ajax call