You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Mike Youngstrom (JIRA)" <my...@incubator.apache.org> on 2005/08/19 20:32:54 UTC
[jira] Created: (MYFACES-433) inputCalendar renderPopupButtonAsImage does not line up image correctly
inputCalendar renderPopupButtonAsImage does not line up image correctly
-----------------------------------------------------------------------
Key: MYFACES-433
URL: http://issues.apache.org/jira/browse/MYFACES-433
Project: MyFaces
Type: Improvement
Components: Tomahawk
Versions: Nightly Build
Reporter: Mike Youngstrom
Image button should be aligned to bottom to line up with text box.
Here is a patch where I wrapped the 2 items in a table and aligned to bottom.
Mike
Index: /current/tomahawk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java
===================================================================
--- /current/tomahawk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java (revision 233337)
+++ /current/tomahawk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java (working copy)
@@ -149,9 +149,19 @@
inputCalendar.setId(facesContext.getViewRoot().createUniqueId());
inputCalendar.getChildren().add(inputText);
+
+ ResponseWriter writer = facesContext.getResponseWriter();
+ writer.startElement(HTML.TABLE_ELEM, null);
+ writer.writeAttribute(HTML.BORDER_ATTR, "0", null);
+ writer.writeAttribute(HTML.CELLSPACING_ATTR, "0", null);
+ writer.writeAttribute(HTML.CELLPADDING_ATTR, "0", null);
+ writer.startElement(HTML.TR_ELEM, null);
+ writer.startElement(HTML.TD_ELEM, null);
+ writer.writeAttribute("valign", "bottom", null);
RendererUtils.renderChild(facesContext, inputText);
+ writer.endElement(HTML.TD_ELEM);
inputCalendar.getChildren().remove(inputText);
//Set back the correct id to the input calendar
@@ -159,7 +169,8 @@
if (!inputCalendar.isDisabled())
{
- ResponseWriter writer = facesContext.getResponseWriter();
+ writer.startElement(HTML.TD_ELEM, null);
+ writer.writeAttribute("valign", "bottom", null);
writer.startElement(HTML.SCRIPT_ELEM,null);
writer.writeAttribute(HTML.SCRIPT_TYPE_ATTR,HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT,null);
@@ -171,12 +182,15 @@
writer.write("\n-->");
writer.endElement(HTML.SCRIPT_ELEM);
+ writer.endElement(HTML.TD_ELEM);
/* writer.startElement(HTML.INPUT_ELEM,null);
writer.writeAttribute(HTML.TYPE_ATTR,HTML.INPUT_TYPE_BUTTON,null);
writer.writeAttribute(HTML.ONCLICK_ATTR,"popUpCalendar(this, "+inputText.getClientId(facesContext)+
", \\\"dd.mm.yyyy\\\")",null);
writer.endElement(HTML.INPUT_TYPE_BUTTON);*/
}
+ writer.endElement(HTML.TR_ELEM);
+ writer.endElement(HTML.TABLE_ELEM);
}
else
{
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Closed: (MYFACES-433) inputCalendar renderPopupButtonAsImage does not line up image correctly
Posted by "Sylvain Vieujot (JIRA)" <my...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/MYFACES-433?page=all ]
Sylvain Vieujot closed MYFACES-433:
-----------------------------------
Fix Version: Nightly Build
Resolution: Fixed
Done.
Thanks Mike.
> inputCalendar renderPopupButtonAsImage does not line up image correctly
> -----------------------------------------------------------------------
>
> Key: MYFACES-433
> URL: http://issues.apache.org/jira/browse/MYFACES-433
> Project: MyFaces
> Type: Improvement
> Components: Tomahawk
> Versions: Nightly Build
> Reporter: Mike Youngstrom
> Fix For: Nightly Build
>
> Image button should be aligned to bottom to line up with text box.
> Here is a patch where I wrapped the 2 items in a table and aligned to bottom.
> Mike
> Index: /current/tomahawk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java
> ===================================================================
> --- /current/tomahawk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java (revision 233337)
> +++ /current/tomahawk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java (working copy)
> @@ -149,9 +149,19 @@
> inputCalendar.setId(facesContext.getViewRoot().createUniqueId());
>
> inputCalendar.getChildren().add(inputText);
> +
> + ResponseWriter writer = facesContext.getResponseWriter();
> + writer.startElement(HTML.TABLE_ELEM, null);
> + writer.writeAttribute(HTML.BORDER_ATTR, "0", null);
> + writer.writeAttribute(HTML.CELLSPACING_ATTR, "0", null);
> + writer.writeAttribute(HTML.CELLPADDING_ATTR, "0", null);
> + writer.startElement(HTML.TR_ELEM, null);
> + writer.startElement(HTML.TD_ELEM, null);
> + writer.writeAttribute("valign", "bottom", null);
>
> RendererUtils.renderChild(facesContext, inputText);
>
> + writer.endElement(HTML.TD_ELEM);
> inputCalendar.getChildren().remove(inputText);
>
> //Set back the correct id to the input calendar
> @@ -159,7 +169,8 @@
>
> if (!inputCalendar.isDisabled())
> {
> - ResponseWriter writer = facesContext.getResponseWriter();
> + writer.startElement(HTML.TD_ELEM, null);
> + writer.writeAttribute("valign", "bottom", null);
>
> writer.startElement(HTML.SCRIPT_ELEM,null);
> writer.writeAttribute(HTML.SCRIPT_TYPE_ATTR,HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT,null);
> @@ -171,12 +182,15 @@
> writer.write("\n-->");
> writer.endElement(HTML.SCRIPT_ELEM);
>
> + writer.endElement(HTML.TD_ELEM);
> /* writer.startElement(HTML.INPUT_ELEM,null);
> writer.writeAttribute(HTML.TYPE_ATTR,HTML.INPUT_TYPE_BUTTON,null);
> writer.writeAttribute(HTML.ONCLICK_ATTR,"popUpCalendar(this, "+inputText.getClientId(facesContext)+
> ", \\\"dd.mm.yyyy\\\")",null);
> writer.endElement(HTML.INPUT_TYPE_BUTTON);*/
> }
> + writer.endElement(HTML.TR_ELEM);
> + writer.endElement(HTML.TABLE_ELEM);
> }
> else
> {
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (MYFACES-433) inputCalendar renderPopupButtonAsImage does not line up image correctly
Posted by "Mike Youngstrom (JIRA)" <my...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/MYFACES-433?page=comments#action_12319420 ]
Mike Youngstrom commented on MYFACES-433:
-----------------------------------------
Good points.....I'll see if I can come up with a better solution.
> inputCalendar renderPopupButtonAsImage does not line up image correctly
> -----------------------------------------------------------------------
>
> Key: MYFACES-433
> URL: http://issues.apache.org/jira/browse/MYFACES-433
> Project: MyFaces
> Type: Improvement
> Components: Tomahawk
> Versions: Nightly Build
> Reporter: Mike Youngstrom
>
> Image button should be aligned to bottom to line up with text box.
> Here is a patch where I wrapped the 2 items in a table and aligned to bottom.
> Mike
> Index: /current/tomahawk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java
> ===================================================================
> --- /current/tomahawk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java (revision 233337)
> +++ /current/tomahawk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java (working copy)
> @@ -149,9 +149,19 @@
> inputCalendar.setId(facesContext.getViewRoot().createUniqueId());
>
> inputCalendar.getChildren().add(inputText);
> +
> + ResponseWriter writer = facesContext.getResponseWriter();
> + writer.startElement(HTML.TABLE_ELEM, null);
> + writer.writeAttribute(HTML.BORDER_ATTR, "0", null);
> + writer.writeAttribute(HTML.CELLSPACING_ATTR, "0", null);
> + writer.writeAttribute(HTML.CELLPADDING_ATTR, "0", null);
> + writer.startElement(HTML.TR_ELEM, null);
> + writer.startElement(HTML.TD_ELEM, null);
> + writer.writeAttribute("valign", "bottom", null);
>
> RendererUtils.renderChild(facesContext, inputText);
>
> + writer.endElement(HTML.TD_ELEM);
> inputCalendar.getChildren().remove(inputText);
>
> //Set back the correct id to the input calendar
> @@ -159,7 +169,8 @@
>
> if (!inputCalendar.isDisabled())
> {
> - ResponseWriter writer = facesContext.getResponseWriter();
> + writer.startElement(HTML.TD_ELEM, null);
> + writer.writeAttribute("valign", "bottom", null);
>
> writer.startElement(HTML.SCRIPT_ELEM,null);
> writer.writeAttribute(HTML.SCRIPT_TYPE_ATTR,HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT,null);
> @@ -171,12 +182,15 @@
> writer.write("\n-->");
> writer.endElement(HTML.SCRIPT_ELEM);
>
> + writer.endElement(HTML.TD_ELEM);
> /* writer.startElement(HTML.INPUT_ELEM,null);
> writer.writeAttribute(HTML.TYPE_ATTR,HTML.INPUT_TYPE_BUTTON,null);
> writer.writeAttribute(HTML.ONCLICK_ATTR,"popUpCalendar(this, "+inputText.getClientId(facesContext)+
> ", \\\"dd.mm.yyyy\\\")",null);
> writer.endElement(HTML.INPUT_TYPE_BUTTON);*/
> }
> + writer.endElement(HTML.TR_ELEM);
> + writer.endElement(HTML.TABLE_ELEM);
> }
> else
> {
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (MYFACES-433) inputCalendar renderPopupButtonAsImage does not line up image correctly
Posted by "Mike Youngstrom (JIRA)" <my...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/MYFACES-433?page=comments#action_12319422 ]
Mike Youngstrom commented on MYFACES-433:
-----------------------------------------
We could add (style="vertical-align:bottom;") to the image.......or provide an image style to the tag and the the user add whatever style they want to the image.....which would you prefer?
> inputCalendar renderPopupButtonAsImage does not line up image correctly
> -----------------------------------------------------------------------
>
> Key: MYFACES-433
> URL: http://issues.apache.org/jira/browse/MYFACES-433
> Project: MyFaces
> Type: Improvement
> Components: Tomahawk
> Versions: Nightly Build
> Reporter: Mike Youngstrom
>
> Image button should be aligned to bottom to line up with text box.
> Here is a patch where I wrapped the 2 items in a table and aligned to bottom.
> Mike
> Index: /current/tomahawk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java
> ===================================================================
> --- /current/tomahawk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java (revision 233337)
> +++ /current/tomahawk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java (working copy)
> @@ -149,9 +149,19 @@
> inputCalendar.setId(facesContext.getViewRoot().createUniqueId());
>
> inputCalendar.getChildren().add(inputText);
> +
> + ResponseWriter writer = facesContext.getResponseWriter();
> + writer.startElement(HTML.TABLE_ELEM, null);
> + writer.writeAttribute(HTML.BORDER_ATTR, "0", null);
> + writer.writeAttribute(HTML.CELLSPACING_ATTR, "0", null);
> + writer.writeAttribute(HTML.CELLPADDING_ATTR, "0", null);
> + writer.startElement(HTML.TR_ELEM, null);
> + writer.startElement(HTML.TD_ELEM, null);
> + writer.writeAttribute("valign", "bottom", null);
>
> RendererUtils.renderChild(facesContext, inputText);
>
> + writer.endElement(HTML.TD_ELEM);
> inputCalendar.getChildren().remove(inputText);
>
> //Set back the correct id to the input calendar
> @@ -159,7 +169,8 @@
>
> if (!inputCalendar.isDisabled())
> {
> - ResponseWriter writer = facesContext.getResponseWriter();
> + writer.startElement(HTML.TD_ELEM, null);
> + writer.writeAttribute("valign", "bottom", null);
>
> writer.startElement(HTML.SCRIPT_ELEM,null);
> writer.writeAttribute(HTML.SCRIPT_TYPE_ATTR,HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT,null);
> @@ -171,12 +182,15 @@
> writer.write("\n-->");
> writer.endElement(HTML.SCRIPT_ELEM);
>
> + writer.endElement(HTML.TD_ELEM);
> /* writer.startElement(HTML.INPUT_ELEM,null);
> writer.writeAttribute(HTML.TYPE_ATTR,HTML.INPUT_TYPE_BUTTON,null);
> writer.writeAttribute(HTML.ONCLICK_ATTR,"popUpCalendar(this, "+inputText.getClientId(facesContext)+
> ", \\\"dd.mm.yyyy\\\")",null);
> writer.endElement(HTML.INPUT_TYPE_BUTTON);*/
> }
> + writer.endElement(HTML.TR_ELEM);
> + writer.endElement(HTML.TABLE_ELEM);
> }
> else
> {
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (MYFACES-433) inputCalendar renderPopupButtonAsImage does not line up image correctly
Posted by "Mike Youngstrom (JIRA)" <my...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/MYFACES-433?page=comments#action_12319801 ]
Mike Youngstrom commented on MYFACES-433:
-----------------------------------------
I went ahead and created a patch that adds style="vertical-align:bottom;" to the image tag. This will fix the problem for me and if anyone else needs more control (add imageStyle attribute to calendar component) we can deal with that when the problem arrises.
Mike
Here is the patch:
Index: current/tomahawk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java
===================================================================
--- current/tomahawk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java (revision 239475)
+++ current/tomahawk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java (working copy)
@@ -383,6 +383,7 @@
// render the image
writer.startElement(HTML.IMG_ELEM, uiComponent);
writer.writeAttribute(HTML.SRC_ATTR, AddResource.getResourceMappedPath(HtmlCalendarRenderer.class, "images/calendar.gif", facesContext), null);
+ writer.writeAttribute(HTML.STYLE_ATTR, "vertical-align:bottom;", null);
//writer.writeAttribute(HTML.ONCLICK_ATTR, "document.getElementById(\\'"+buttonId+"\\').click()",null);
writeOnclickJsCalendarFunctionCall(facesContext,uiComponent,dateFormat);
> inputCalendar renderPopupButtonAsImage does not line up image correctly
> -----------------------------------------------------------------------
>
> Key: MYFACES-433
> URL: http://issues.apache.org/jira/browse/MYFACES-433
> Project: MyFaces
> Type: Improvement
> Components: Tomahawk
> Versions: Nightly Build
> Reporter: Mike Youngstrom
>
> Image button should be aligned to bottom to line up with text box.
> Here is a patch where I wrapped the 2 items in a table and aligned to bottom.
> Mike
> Index: /current/tomahawk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java
> ===================================================================
> --- /current/tomahawk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java (revision 233337)
> +++ /current/tomahawk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java (working copy)
> @@ -149,9 +149,19 @@
> inputCalendar.setId(facesContext.getViewRoot().createUniqueId());
>
> inputCalendar.getChildren().add(inputText);
> +
> + ResponseWriter writer = facesContext.getResponseWriter();
> + writer.startElement(HTML.TABLE_ELEM, null);
> + writer.writeAttribute(HTML.BORDER_ATTR, "0", null);
> + writer.writeAttribute(HTML.CELLSPACING_ATTR, "0", null);
> + writer.writeAttribute(HTML.CELLPADDING_ATTR, "0", null);
> + writer.startElement(HTML.TR_ELEM, null);
> + writer.startElement(HTML.TD_ELEM, null);
> + writer.writeAttribute("valign", "bottom", null);
>
> RendererUtils.renderChild(facesContext, inputText);
>
> + writer.endElement(HTML.TD_ELEM);
> inputCalendar.getChildren().remove(inputText);
>
> //Set back the correct id to the input calendar
> @@ -159,7 +169,8 @@
>
> if (!inputCalendar.isDisabled())
> {
> - ResponseWriter writer = facesContext.getResponseWriter();
> + writer.startElement(HTML.TD_ELEM, null);
> + writer.writeAttribute("valign", "bottom", null);
>
> writer.startElement(HTML.SCRIPT_ELEM,null);
> writer.writeAttribute(HTML.SCRIPT_TYPE_ATTR,HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT,null);
> @@ -171,12 +182,15 @@
> writer.write("\n-->");
> writer.endElement(HTML.SCRIPT_ELEM);
>
> + writer.endElement(HTML.TD_ELEM);
> /* writer.startElement(HTML.INPUT_ELEM,null);
> writer.writeAttribute(HTML.TYPE_ATTR,HTML.INPUT_TYPE_BUTTON,null);
> writer.writeAttribute(HTML.ONCLICK_ATTR,"popUpCalendar(this, "+inputText.getClientId(facesContext)+
> ", \\\"dd.mm.yyyy\\\")",null);
> writer.endElement(HTML.INPUT_TYPE_BUTTON);*/
> }
> + writer.endElement(HTML.TR_ELEM);
> + writer.endElement(HTML.TABLE_ELEM);
> }
> else
> {
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (MYFACES-433) inputCalendar renderPopupButtonAsImage does not line up image correctly
Posted by "Sylvain Vieujot (JIRA)" <my...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/MYFACES-433?page=comments#action_12319414 ]
Sylvain Vieujot commented on MYFACES-433:
-----------------------------------------
This isn't very clean.
I see several problems using a table :
- it can't be on the same line as another component
- A lot of HTML
Can't this be done with CSS ?
> inputCalendar renderPopupButtonAsImage does not line up image correctly
> -----------------------------------------------------------------------
>
> Key: MYFACES-433
> URL: http://issues.apache.org/jira/browse/MYFACES-433
> Project: MyFaces
> Type: Improvement
> Components: Tomahawk
> Versions: Nightly Build
> Reporter: Mike Youngstrom
>
> Image button should be aligned to bottom to line up with text box.
> Here is a patch where I wrapped the 2 items in a table and aligned to bottom.
> Mike
> Index: /current/tomahawk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java
> ===================================================================
> --- /current/tomahawk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java (revision 233337)
> +++ /current/tomahawk/src/java/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java (working copy)
> @@ -149,9 +149,19 @@
> inputCalendar.setId(facesContext.getViewRoot().createUniqueId());
>
> inputCalendar.getChildren().add(inputText);
> +
> + ResponseWriter writer = facesContext.getResponseWriter();
> + writer.startElement(HTML.TABLE_ELEM, null);
> + writer.writeAttribute(HTML.BORDER_ATTR, "0", null);
> + writer.writeAttribute(HTML.CELLSPACING_ATTR, "0", null);
> + writer.writeAttribute(HTML.CELLPADDING_ATTR, "0", null);
> + writer.startElement(HTML.TR_ELEM, null);
> + writer.startElement(HTML.TD_ELEM, null);
> + writer.writeAttribute("valign", "bottom", null);
>
> RendererUtils.renderChild(facesContext, inputText);
>
> + writer.endElement(HTML.TD_ELEM);
> inputCalendar.getChildren().remove(inputText);
>
> //Set back the correct id to the input calendar
> @@ -159,7 +169,8 @@
>
> if (!inputCalendar.isDisabled())
> {
> - ResponseWriter writer = facesContext.getResponseWriter();
> + writer.startElement(HTML.TD_ELEM, null);
> + writer.writeAttribute("valign", "bottom", null);
>
> writer.startElement(HTML.SCRIPT_ELEM,null);
> writer.writeAttribute(HTML.SCRIPT_TYPE_ATTR,HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT,null);
> @@ -171,12 +182,15 @@
> writer.write("\n-->");
> writer.endElement(HTML.SCRIPT_ELEM);
>
> + writer.endElement(HTML.TD_ELEM);
> /* writer.startElement(HTML.INPUT_ELEM,null);
> writer.writeAttribute(HTML.TYPE_ATTR,HTML.INPUT_TYPE_BUTTON,null);
> writer.writeAttribute(HTML.ONCLICK_ATTR,"popUpCalendar(this, "+inputText.getClientId(facesContext)+
> ", \\\"dd.mm.yyyy\\\")",null);
> writer.endElement(HTML.INPUT_TYPE_BUTTON);*/
> }
> + writer.endElement(HTML.TR_ELEM);
> + writer.endElement(HTML.TABLE_ELEM);
> }
> else
> {
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira