11 Replies Latest reply on Dec 5, 2011 4:55 PM by henry katz

    Suggestion for component id addressing

    Dan Allen Master

      While watching Jay's talk at JBossWorld on RichFaces, I had an idea for what I think is a cleaner way of doing dynamic component id addressing.


      Currently, if you want to reference the id of a table cell, you might do something like:


      #{rich:rowKeys(collection, 'tableId')}:cellId


      The use of the EL + an EL function is a bit too verbose for my taste. Instead, we could build on the use of the @ token to reference canonical elements (e.g., @form, @this, @body, etc) and allow it to accept parameters.


      @rowKeys(collection, 'tableId'):cellId


      While on the one hand we are introducing yet another expression syntax, it's already understood that the @ token is a dynamic element and we are simply parameterizing it. And truthfully, we are bending EL anyway to support the first syntax, so we might as well do the bending in the right place.


      On a related note, as surprising as it may seem, JSF 2 does not support sub-paths on canonical tokens. For instance:




      Why on earth they didn't think of that I have no idea. But it would be nice to see that implemented in RichFaces if possible. If it's too high level, we can hack it into Seam Faces. I think it requires overriding the Ajax behavior renderer. Ah, I suppose it could be supported in a4j:ajax then.