Comments (12)
Reported by @edburns
from javaserverfaces-spec.
rogerk said:
Taking ownership.
from javaserverfaces-spec.
rogerk said:
Working proposal.
from javaserverfaces-spec.
@edburns said:
fix checked in
from javaserverfaces-spec.
rogerk said:
Here are the implementation changes for this issue:
This checkin implements the "layout" attribute for "panelGroup"
[layout="block" renders a "div" instead of a "span"]
SECTION: Changes
-
- api **
M doc/panel-group-attrs.xml - add "layout" attribute
M doc/standard-html-renderkit-base.xml - updated description for panelGroup rendering
- api **
-
- ri **
M src/com/sun/faces/renderkit/html_basic/GroupRenderer.java - looks for same conditions as when rendering a span (id, style, or styleClass
present),
but, if "layout" attr is present and value is "block" ---> render with "div".
M web/test/RenderResponse_correct - updated golden file
M web/test/TestRenderResponsePhase.jsp - included panelGroup with "layout" attribute
- ri **
Index: panel-group-attrs.xml
RCS file: /cvs/javaserverfaces-sources/jsf-api/doc/panel-group-attrs.xml,v
retrieving revision 1.4
diff -u -r1.4 panel-group-attrs.xml
— panel-group-attrs.xml 8 Nov 2004 19:23:00 -0000 1.4
+++ panel-group-attrs.xml 12 Jan 2005 18:43:18 -0000
@@ -49,4 +49,16 @@
false
-
\ No newline at end of file
+
- The type of layout markup to use when rendering this group.
- Valid value is "block" that will produce an HTML "div" element.
- If not specified, an HTML "span" element will be produced.
- Layout
- layout
- java.lang.String
+
Index: standard-html-renderkit-base.xml
RCS file: /cvs/javaserverfaces-sources/jsf-api/doc/standard-html-renderkit-base.
xml,v
retrieving revision 1.2
diff -u -r1.2 standard-html-renderkit-base.xml
— standard-html-renderkit-base.xml 10 Nov 2004 22:39:07 -0000 1.2
+++ standard-html-renderkit-base.xml 12 Jan 2005 18:43:19 -0000
@@ -1710,10 +1710,14 @@
Intended for use in situations when only one
UIComponent child can be nested, such as in the case of facets.
- If the "style" or "styleClass" attributes are present, render a
- "span" element, outputting the value of the "style" attribute as
- the value of the "style" attribute, and the value of the
- "styleClass" attribute as the value of the "class"
- If the "style" or "styleClass" attributes are present, and the "layout"
- attribute is present with a value of "block", render a "div" element,
- outputting the value of the "style" attribute as the value of the
- "style" attribute and the value of the "styleClass" attribute as the
- value of the "class" attribute. Otherwise, if the "layout" attribute
- is not present, render a "span" element, outputting the value of the
- "style" attribute as the value of the "style" attribute, and the value
- of the "styleClass" attribute as the value of the "class"
attribute.
javax.faces.Panel
javax.faces.Group
Index: GroupRenderer.java
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_b
asic/GroupRenderer.java,v
retrieving revision 1.22
diff -u -r1.22 GroupRenderer.java
— GroupRenderer.java 31 Mar 2004 18:48:35 -0000 1.22
+++ GroupRenderer.java 12 Jan 2005 18:45:31 -0000
@@ -91,11 +91,16 @@
// Render a span around this group if necessary
String
style = (String) component.getAttributes().get("style"),
-
styleClass = (String) component.getAttributes().get("styleClass");
- styleClass = (String) component.getAttributes().get("styleClass"),
- layout = (String) component.getAttributes().get("layout");
ResponseWriter writer = context.getResponseWriter();
-
if (spanned(component)) {
-
writer.startElement("span", component);
- if (divOrSpan(component)) {
- if ((layout != null) && (layout.equals("block"))) { + writer.startElement("div", component); + }
else
{ + writer.startElement("span", component); + }
writeIdAttributeIfNecessary(context, writer, component);
if (styleClass != null) {
writer.writeAttribute("class", styleClass, "styleClass");
@@ -155,8 +160,13 @@
// Close our span element if necessary
ResponseWriter writer = context.getResponseWriter();
-
if (spanned(component)) {
-
writer.endElement("span");
- String layout = (String)component.getAttributes().get("layout");
- if (divOrSpan(component))Unknown macro: {+ if ((layout != null) && (layout.equals("block"))) { + writer.endElement("div"); + } else { + writer.endElement("span"); + } }
if (log.isTraceEnabled()) {
log.trace("End encoding component " +
@@ -167,11 +177,11 @@
/**
-
-
Return true if we need to render a span element around this group.
-
-
Return true if we need to render a div or span element around this gr
-
oup.
* -
-
@param component
UIComponent
for this group
*/ -
private boolean spanned(UIComponent component) {
- private boolean divOrSpan(UIComponent component) {
if (shouldWriteIdAttribute(component) ||
(component.getAttributes().get("style") != null) ||
(component.getAttributes().get("styleClass") != null)) {
- private boolean divOrSpan(UIComponent component) {
Index: TestRenderResponsePhase.jsp
RCS file: /cvs/javaserverfaces-sources/jsf-ri/web/test/TestRenderResponsePhase.j
sp,v
retrieving revision 1.84
diff -u -r1.84 TestRenderResponsePhase.jsp
— TestRenderResponsePhase.jsp 12 Nov 2004 18:00:28 -0000 1.84
+++ TestRenderResponsePhase.jsp 12 Jan 2005 18:47:14 -0000
@@ -658,6 +658,14 @@
+
+
+<h:panelGroup layout="block" style="color:red" styleClass="walleye">
- <f:verbatim>style this text like a red walleye</f:verbatim>
+</h:panelGroup>
+
+
<h:inputHidden value="48%" >
<f:convertNumber type="number" pattern="#%"/>
</h:inputHidden>
Index: RenderResponse_correct
RCS file: /cvs/javaserverfaces-sources/jsf-ri/web/test/RenderResponse_correct,v
retrieving revision 1.113
diff -u -r1.113 RenderResponse_correct
— RenderResponse_correct 14 Dec 2004 21:08:56 -0000 1.113
+++ RenderResponse_correct 12 Jan 2005 18:49:35 -0000
@@ -15,7 +15,7 @@
-
+ @@ -130,12 +130,12 @@ @@ -169,7 +169,7 @@
Index: RenderResponse_correct
RCS file: /cvs/javaserverfaces-sources/jsf-ri/web/test/RenderResponse_correct,v
retrieving revision 1.113
diff -u -r1.113 RenderResponse_correct
— RenderResponse_correct 14 Dec 2004 21:08:56 -0000 1.113
+++ RenderResponse_correct 12 Jan 2005 18:49:35 -0000
@@ -15,7 +15,7 @@
-<form id="basicForm" method="post" action="/test/faces/TestRenderResponsePhase.
jsp;jsessionid=E8C22D1F61AAFB3BEB4875553F897B85" class="formClass" accept-charse
t="some-charset" accept="html,wml" enctype="application/x-www-form-urlencoded" t
arget="_self" title="basicForm">
+<form id="basicForm" method="post" action="/test/faces/TestRenderResponsePhase.
jsp;jsessionid=676E0FBF879741B55500B45B856C6622" class="formClass" accept-charse
t="some-charset" accept="html,wml" enctype="application/x-www-form-urlencoded" t
arget="_self" title="basicForm">
- <a id="basicForm:imageLink" href="#" style="someStyle" onclick="c
learFormHiddenParams_basicForm('basicForm');document.forms['basicForm']['basicFo
rm:_idcl'].value='basicForm:imageLink'; document.forms['basicForm'].submit(); re
/a>
- <a id="basicForm:imageLink" href="#" style="someStyle" onclick="c
learFormHiddenParams_basicForm('basicForm');document.forms['basicForm']['basicFo
rm:_idcl'].value='basicForm:imageLink'; document.forms['basicForm'].submit(); re
/a>
@@ -169,7 +169,7 @@- <a id="basicForm:hrefParamLink" href="#" onclick="clearFormHiddenPa
rams_basicForm('basicForm');document.forms['basicForm']['basicForm:_idcl'].value
='basicForm:hrefParamLink';document.forms['basicForm']['name'].value='horwat';do
cument.forms['basicForm']['value'].value='password'; document.forms['basicForm']
.target='_top'; document.forms['basicForm'].submit(); return false;"><img src="d
uke.gif;jsessionid=E8C22D1F61AAFB3BEB4875553F897B85" />
- <a id="basicForm:hrefParamLink" href="#" onclick="clearFormHiddenPa
rams_basicForm('basicForm');document.forms['basicForm']['basicForm:_idcl'].value
='basicForm:hrefParamLink';document.forms['basicForm']['name'].value='horwat';do
cument.forms['basicForm']['value'].value='password'; document.forms['basicForm']
.target='_top'; document.forms['basicForm'].submit(); return false;"><img src="d
uke.gif;jsessionid=676E0FBF879741B55500B45B856C6622" />
@@ -177,7 +177,7 @@
@@ -189,12 +189,12 @@
- <a id="basicForm:output_imageLink" href="test.html;jsessionid=E8C
22D1F61AAFB3BEB4875553F897B85" style="position: absolute; left: 96px; top: 168px
- <a id="basicForm:output_imageLink" href="test.html;jsessionid=676
E0FBF879741B55500B45B856C6622" style="position: absolute; left: 96px; top: 168px
@@ -202,7 +202,7 @@@@ -212,13 +212,13 @@
- <a id="basicForm:output_commandParamLink" href="test.html;jsessioni
d=E8C22D1F61AAFB3BEB4875553F897B85?name=horwat&value=password" class="hyperlinkC
lass">link text
- <a id="basicForm:output_commandParamLink" href="test.html;jsessioni
d=676E0FBF879741B55500B45B856C6622?name=horwat&value=password" class="hyperlinkC
lass">link text
@@ -228,7 +228,7 @@
- <a id="basicForm:output_hrefParamLink" href="test.html;jsessionid=E
8C22D1F61AAFB3BEB4875553F897B85?name=horwat&value=password"><img src="duke.gif;j
sessionid=E8C22D1F61AAFB3BEB4875553F897B85" />
- <a id="basicForm:output_hrefParamLink" href="test.html;jsessionid=6
76E0FBF879741B55500B45B856C6622?name=horwat&value=password"><img src="duke.gif;j
sessionid=676E0FBF879741B55500B45B856C6622" />
@@ -715,9 +715,17 @@
+
+
+
+
-
+
22D1F61AAFB3BEB4875553F897B85" style="someStyle" usemap="#map1" ismap="ismap" />
E0FBF879741B55500B45B856C6622" style="someStyle" usemap="#map1" ismap="ismap" /> |
|
AAFB3BEB4875553F897B85" class="hyperlinkClass">output link text
9741B55500B45B856C6622" class="hyperlinkClass">output link text |
nid=E8C22D1F61AAFB3BEB4875553F897B85" usemap="#map1" ismap="ismap" />
nid=676E0FBF879741B55500B45B856C6622" usemap="#map1" ismap="ismap" /> |
22D1F61AAFB3BEB4875553F897B85" style="position: absolute; left: 96px; top: 168px " class="hyperlinkClass">link text
E0FBF879741B55500B45B856C6622" style="position: absolute; left: 96px; top: 168px " class="hyperlinkClass">link text |
|
|
|
+ + + style this text like a red walleye
+ | |
@@ -851,9 +859,9 @@ |
from javaserverfaces-spec.
@edburns said:
Looks good. Two small changes, otherwise r=edburns. No re-review
required.
RK> Here are the implementation changes for this issue:
RK>
RK> This checkin implements the "layout" attribute for "panelGroup"
RK> [layout="block" renders a "div" instead of a "span"]
RK>
RK> SECTION: Changes
RK>
RK> ** api **
RK> M doc/panel-group-attrs.xml
RK> – add "layout" attribute
Don't edit the *-attrs.xml files. Edit the *-props.xml file instead.
See jsf-api/doc/README.txt
RK> +
RK> + The type of layout markup to use when rendering this group.
RK> + Valid value is "block" that will produce an HTML "div" element.
RK> + If not specified, an HTML "span" element will be produced.
RK> +
What happens if someone says layout="div", or something other than
"block"? When writing spec language for this sort of thing it's
important to cover all cases. You could say something like:
RK> M doc/standard-html-renderkit-base.xml
RK> – updated description for panelGroup rendering
RK> + outputting the value of the "style" attribute as the value of the
RK> + "style" attribute and the value of the "styleClass" attribute as the
RK> + value of the "class" attribute. Otherwise, if the "layout" attribute
RK> + is not present, render a "span" element, outputting the value of the
as above, we need to say "not present, or is a value other than block".
RK>
RK> ** ri **
RK> M src/com/sun/faces/renderkit/html_basic/GroupRenderer.java
RK> – looks for same conditions as when rendering a span (id, style, or styleClass
RK> present),
RK> but, if "layout" attr is present and value is "block" ---> render with "div".
RK> M web/test/RenderResponse_correct
RK> – updated golden file
RK> M web/test/TestRenderResponsePhase.jsp
RK> – included panelGroup with "layout" attribute
from javaserverfaces-spec.
@edburns said:
Prepare to delete "spec" subcomponent.
from javaserverfaces-spec.
@edburns said:
Move all to 1.2
from javaserverfaces-spec.
@manfredriem said:
Closing resolved issue out
from javaserverfaces-spec.
Was assigned to rogerk
from javaserverfaces-spec.
This issue was imported from java.net JIRA JAVASERVERFACES_SPEC_PUBLIC-17
from javaserverfaces-spec.
Marked as fixed on Thursday, March 4th 2010, 6:09:24 am
from javaserverfaces-spec.
Related Issues (20)
- CDI shortcut for search expressions HOT 2
- ActionListener and PhaseListener declared in Facelet: Injectable or not? HOT 1
- ProtectedViewException for a protectedview access while checking the OriginHeader HOT 1
- JSF 2.3 Table 5-3 JSF artifacts eligible for injection - Constructor Injection - Not supported HOT 1
- 11.4.6 should specify "search-expression-context-factory" rather than "search-expression-context-kit-factory" HOT 1
- wrong link to Mojarra on spec front page HOT 1
- JSF 2.3 spec section 2.5.2.1 typo HOT 1
- ResourceVisitOption.TOP_LEVEL_VIEWS_ONLY clarification HOT 1
- Add PartialResponseWriterWrapper HOT 3
- StringIndexOutOfBoundsException when using jsf 2.3.3 on tomcat 9.0.2 HOT 2
- Determine url of h:outputLink at click time HOT 4
- Implement cc:insertPassthroughAttributes HOT 1
- importConstants should be allowed everywhere, not only in f:metadata HOT 3
- JSF 2.3 with Java 10&11 not recognizing generic types with f:viewParam HOT 2
- Make javascript functions created by h:commandScript return a Promise HOT 1
- javax.faces.annotation.ManagedProperty websocket event incompatibility HOT 2
- Protected View Exception
- Change locale is not working HOT 1
- Replace "fat" XML responses with modern JSON/RESTful responses HOT 2
- typo in webpage HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javaserverfaces-spec.