Git Product home page Git Product logo

Comments (12)

glassfishrobot avatar glassfishrobot commented on August 15, 2024

Reported by @edburns

from javaserverfaces-spec.

glassfishrobot avatar glassfishrobot commented on August 15, 2024

rogerk said:
Taking ownership.

from javaserverfaces-spec.

glassfishrobot avatar glassfishrobot commented on August 15, 2024

rogerk said:
Working proposal.

from javaserverfaces-spec.

glassfishrobot avatar glassfishrobot commented on August 15, 2024

@edburns said:
fix checked in

from javaserverfaces-spec.

glassfishrobot avatar glassfishrobot commented on August 15, 2024

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
    • 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

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)) {

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">

@@ -130,12 +130,12 @@
  • <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

turn false;"><

/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

turn false;"><

/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 @@

+


+
+
+

-
+

  • <img id="basicForm:graphicImage" src="/test/duke.gif;jsessionid=E8C

22D1F61AAFB3BEB4875553F897B85" style="someStyle" usemap="#map1" ismap="ismap" />

  • <img id="basicForm:graphicImage" src="/test/duke.gif;jsessionid=676

E0FBF879741B55500B45B856C6622" style="someStyle" usemap="#map1" ismap="ismap" />

  • <a id="basicForm:outputLink" href="test.html;jsessionid=E8C22D1F61

AAFB3BEB4875553F897B85" class="hyperlinkClass">output link text

  • <a id="basicForm:outputLink" href="test.html;jsessionid=676E0FBF87

9741B55500B45B856C6622" class="hyperlinkClass">output link text

  • <img id="basicForm:output_graphicImage" src="/test/duke.gif;jsessio

nid=E8C22D1F61AAFB3BEB4875553F897B85" usemap="#map1" ismap="ismap" />

  • <img id="basicForm:output_graphicImage" src="/test/duke.gif;jsessio

nid=676E0FBF879741B55500B45B856C6622" usemap="#map1" ismap="ismap" />

  • <a id="basicForm:output_commandLink" href="test.html;jsessionid=E8C

22D1F61AAFB3BEB4875553F897B85" style="position: absolute; left: 96px; top: 168px

" class="hyperlinkClass">link text

  • <a id="basicForm:output_commandLink" href="test.html;jsessionid=676

E0FBF879741B55500B45B856C6622" style="position: absolute; left: 96px; top: 168px

" class="hyperlinkClass">link text

  • <a id="basicForm:output_hrefLink" href="test.html;jsessionid=E8C22D

1F61AAFB3BEB4875553F897B85">

  • <a id="basicForm:output_hrefLink" href="test.html;jsessionid=676E0F

BF879741B55500B45B856C6622">


+
+
+
style this text like a red walleye

+

@@ -851,9 +859,9 @@

from javaserverfaces-spec.

glassfishrobot avatar glassfishrobot commented on August 15, 2024

@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:

The type of layout markup to use when rendering this group. If the value is "block" the renderer must produce an HTML "div" element. Otherwise HTML "span" element must be produced.

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.

glassfishrobot avatar glassfishrobot commented on August 15, 2024

@edburns said:
Prepare to delete "spec" subcomponent.

from javaserverfaces-spec.

glassfishrobot avatar glassfishrobot commented on August 15, 2024

@edburns said:
Move all to 1.2

from javaserverfaces-spec.

glassfishrobot avatar glassfishrobot commented on August 15, 2024

@manfredriem said:
Closing resolved issue out

from javaserverfaces-spec.

glassfishrobot avatar glassfishrobot commented on August 15, 2024

Was assigned to rogerk

from javaserverfaces-spec.

glassfishrobot avatar glassfishrobot commented on August 15, 2024

This issue was imported from java.net JIRA JAVASERVERFACES_SPEC_PUBLIC-17

from javaserverfaces-spec.

glassfishrobot avatar glassfishrobot commented on August 15, 2024

Marked as fixed on Thursday, March 4th 2010, 6:09:24 am

from javaserverfaces-spec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.