1 Reply Latest reply: May 4, 2012 1:36 PM by 610203 RSS

    can html tags be accessed from the faces context? or by java?

    308675
      I have some html tags whose values I would like to access in a backing bean. How can I do this?
           <h:form id="opsForm" >
                 <b>id:</b><b id='idToAccess'>ValueIwantToAccessInJava</b><br/>
      I want to access the value of idToAccess in the backing bean. Can I do this? Can I use the faces context?
        • 1. Re: can html tags be accessed from the faces context? or by java?
          610203
          Hi,
          You can use an <h:outputText> for do it:
          <h:form id="opsForm" >
                     <b>id:</b><b id="idToAccess"><h:outputText value="#{yourBean.yourBeanValue}" /></b><br/>
          html tags are not saved in your faces context, these tags are in your page, the page that is rendered. In your faces context you will have a representation view of the JSF components of your page, in this case, the component created from <h:outputText>, and the <h:form>.

          Regards.