[ 
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

Reply via email to