You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by James Reynolds <Ja...@intermountainmail.org> on 2006/05/04 18:27:36 UTC

Confused about View ID

I have a page that lists Contracts. On this page is a booleanCheckBox
that filters the list based on a certain criteria.  Here is the
ValueChangeListener I'm using:

public void compOnlyChecked(ValueChangeEvent vce) {
        compOnly = (Boolean) vce.getNewValue(); //compOnly is a boolean
property in the managed-bean
        getFacesContext().renderResponse();
    }

So far, it works fine.  However, if I click on one of the contracts
(which navigates to the detail page), then click the back button to
return to the list, then click the booleanCheckBox, the *detail* page is
the one that is restored.

I suspect that the solution to this is to set the view ID to the
Contract View page inside of the ValueChangeEvent, but my efforts are
throwing Evaluation Execptions (stack trace below).  This is how I
modified the Value Change Listener, which is obviously incorrect.

public void compOnlyChecked(ValueChangeEvent vce) {
        compOnly = (Boolean) vce.getNewValue();
	  getFacesContext().getViewRoot().setId("/contractList.jsf");
        getFacesContext().renderResponse();
    }

Could you point me in the right direction?

Thanks



Stack Trace:
exception 

javax.servlet.ServletException: Exception while invoking expression
#{members$contractList.compOnlyChecked}
	javax.faces.webapp.FacesServlet.service(FacesServlet.java:121)
	
com.npp.web.AuthorizationFilter.doFilter(AuthorizationFilter.java:51)
	
org.apache.shale.faces.ShaleApplicationFilter.doFilter(ShaleApplicationF
ilter.java:285)
	
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(Extensi
onsFilter.java:122)


root cause 

javax.faces.el.EvaluationException: Exception while invoking expression
#{members$contractList.compOnlyChecked}
	
org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:15
3)
	javax.faces.component.UIInput.broadcast(UIInput.java:200)
	
javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
	
javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:143)
	
org.apache.myfaces.lifecycle.LifecycleImpl.processValidations(LifecycleI
mpl.java:240)
	
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76
)
	javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
	
com.npp.web.AuthorizationFilter.doFilter(AuthorizationFilter.java:51)
	
org.apache.shale.faces.ShaleApplicationFilter.doFilter(ShaleApplicationF
ilter.java:285)
	
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(Extensi
onsFilter.java:122)