1 Reply Latest reply on Jan 10, 2008 5:05 AM by Pete Muir

    Injecting/Outjecting Primitive Types

    Toni Beckman Novice

      Hi,

      how do I access the value of a check box contained inside a jsf view from a SFSB without creating explicitetly a Java Bean for the boolean value?

      This does not seem to work

      
      ---- simple page --------
      
      <f:view>
       <h:form>
      
       <h:outputText value="List All"/>
       <h:selectBooleanCheckbox value="#{showallentries}"/>
      
       <h:commandButton type="submit" value="Save" action="#{StatefullTestBean.save}"/>
      
       </h:form>
      </f:view>
      
      ----- simple sfsb ---------
      
      
      Name("linkSectionAction")
      @Stateful
      
      public class StatefullTestBean implements StatefullTtestBeanInterface
      {
      
       @In(create=true)
       @Out
       boolean showallentries;
      
       public String save()
       {
       // IWould like to access the boolean value, but I can't inject/outject it.
       }
      }
      


        • 1. Re: Injecting/Outjecting Primitive Types
          Pete Muir Master

          You need to bind it to a property

          <f:view>
           <h:form>
          
           <h:outputText value="List All"/>
           <h:selectBooleanCheckbox value="#{linkSectionAction.showallentries}"/>
          
           <h:commandButton type="submit" value="Save" action="#{StatefullTestBean.save}"/>
          
           </h:form>
          </f:view>


          Name("linkSectionAction")
          @Stateful
          
          public class StatefullTestBean implements StatefullTtestBeanInterface
          {
          
           private boolean showallentries;
          
           //getters and setters
          
           public String save()
           {
           // IWould like to access the boolean value, but I can't inject/outject it.
           }
          }