1 Reply Latest reply on Nov 5, 2010 10:33 AM by Nick Belaevski

    Scope of RichFaces built-in client functions

    Nicholas Oxhøj Newbie



      Is there any reason, why the RichFaces built-in client functions (See Chapter 14. Functions), like rich:clientId('id') doesn't find the "closest" element with the given id, instead of searching from the root naming container, returning the first element with the given id? Or is there another way to access the needed "closest" element? It seems that most other things, resolve ids by starting at the closest NamingContainer, moving upwards by parent NamingContainers, searching for the relevant id in each NamingContainer until finally arriving at the root.


      If, for example, I have a composition template test.xhtml:


      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
          <s:div id="mydiv">
          Div ID: #{rich:clientId('mydiv')}
          <script type="text/javascript">


      which I use to decorate some example text:


      <s:decorate template="test.xhtml">
      <s:decorate template="test.xhtml">


      I would expect the output to look like




      but instead it renders as




      because both functions find the first div on the page with an id of "mydiv", instead of the "closest" (i.e. in the same NamingContainer).