Last active
August 29, 2015 14:18
-
-
Save jyeary/5adbeaf898a2e9bb939d to your computer and use it in GitHub Desktop.
An example of how to use the p:passthrough functionality in JSF 2.2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version='1.0' encoding='UTF-8' ?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" | |
xmlns:h="http://xmlns.jcp.org/jsf/html" | |
xmlns:p="http://xmlns.jcp.org/jsf/passthrough"> | |
<h:head> | |
<title><p:passthrough/> example</title> | |
</h:head> | |
<h:body> | |
<h:panelGroup id="panelGroup1" layout="block" | |
p:onmouseover="this.setAttribute('style', 'color: blue; font-size:32px; font-weight:bolder;');" | |
p:onmouseout="this.setAttribute('style', 'color: black; font-size:inherit; font-weight:normal;');"> | |
<h:outputText id="outputText1" value="Click me!" | |
p:data-experimental-type="Hello World!" | |
p:style="font-variant:small-caps;" | |
p:onclick="alert(this.getAttribute('data-experimental-type'));"/> | |
</h:panelGroup> | |
</h:body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version='1.0' encoding='UTF-8' ?> | |
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head id="j_idt2"> | |
<title><p:passthrough/> example</title> | |
</head> | |
<body> | |
<h1><p:passthrough/> example</h1> | |
<div id="panelGroup1" | |
onmouseout="this.setAttribute('style', 'color: black; font-size:inherit; font-weight:normal;');" | |
onmouseover="this.setAttribute('style', 'color: blue; font-size:32px; font-weight:bolder;');"> | |
<span id="outputText1" onclick="alert(this.getAttribute('data-experimental-type'));" | |
data-experimental-type="Hello World!" | |
style="font-variant:small-caps;">Click me!</span> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment