[ 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