1 Reply Latest reply on Nov 15, 2007 8:41 AM by Dmitry Demyankov

    A question about scope of userBean in Richfaces-demo applica

    ibuchh Newbie

      Hi,

      I have seen the following facelet page in richfaces-demo application. Is it necessary to have the userBean in session scope. It doesn't work if I change the scope to request, is it possible to have it in request scope.


      --Irshad.
      --assignTo.xhtml

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich">

      <h:form>
      <rich:panel>
      <a4j:commandButton value="Set Name to Alex" reRender="rep" >
      <a4j:actionparam name="username" value="Alex" assignTo="#{userBean.name}"/>
      </a4j:commandButton>
      <rich:spacer width="20" />
      <a4j:commandButton value="Set Name to John" reRender="rep" >
      <a4j:actionparam name="username" value="John" assignTo="#{userBean.name}"/>
      </a4j:commandButton>
      </rich:panel>
      <rich:panel>
      <h:outputText id="rep" value="Selected Name:#{userBean.name}"/>
      </rich:panel>
      </h:form>
      </ui:composition>