Issue Details (XML | Word | Printable)

Key: JAVASERVERFACES_SPEC_PUBLIC-1174
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Works as designed
Priority: Major Major
Assignee: Unassigned
Reporter: gabz90
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
javaserverfaces-spec-public

rendered on any html5 component

Created: 17/Mar/13 02:50 AM   Updated: 11/Nov/13 07:16 PM   Resolved: 11/Nov/13 07:16 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Tags:
Participants: Ed Burns and gabz90


 Description  « Hide

Sometimes I find myself creating <h:panelGroup> or containers just to use the rendered attribute on some html markup. It would be quite amazing if I could annotate any html with the jsf:rendered attribute and have JSF create a component behind the scenes to encapsulate that markup. that way I could just do <div jsf:rendered="#{isLoggedIn}>...content...</div>. Maybe a component dedicated for that purpose could be created (just to hold the html markup that is), excuse me is this is already possible, but I often find myself wishing this feature were available.



Ed Burns added a comment - 11/Nov/13 07:16 PM

I'm happy to report this just works with the HTML5 passthrough element support. Check this:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:myNS="http://xmlns.jcp.org/jsf">
    
    <div myNS:rendered="true">

<form myNS:id="form">
    
    <input name="textField" type="text" myNS:value="#{bean.text1}" />

    <input type="submit" myNS:id="submitButton" value="submit" />
    
    <p>submitted text: #{bean.text1}.</p>

</form>
        
    </div>

</html>

The rhs of the rendered attribute can just as well be an EL expression.