You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mm...@apache.org on 2004/11/29 14:57:56 UTC

cvs commit: incubator-myfaces/src/components/org/apache/myfaces/custom/calendar HtmlCalendarRenderer.java

mmarinschek    2004/11/29 05:57:56

  Modified:    src/components/org/apache/myfaces/custom/calendar
                        HtmlCalendarRenderer.java
  Log:
  changes for input-calendar bugs
  
  Revision  Changes    Path
  1.10      +26 -3     incubator-myfaces/src/components/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java
  
  Index: HtmlCalendarRenderer.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- HtmlCalendarRenderer.java	13 Oct 2004 11:50:57 -0000	1.9
  +++ HtmlCalendarRenderer.java	29 Nov 2004 13:57:56 -0000	1.10
  @@ -40,9 +40,13 @@
   import java.util.Calendar;
   import java.util.Date;
   import java.util.Locale;
  +import java.util.List;
   
   /**
    * $Log$
  + * Revision 1.10  2004/11/29 13:57:56  mmarinschek
  + * changes for input-calendar bugs
  + *
    * Revision 1.9  2004/10/13 11:50:57  matze
    * renamed packages to org.apache
    *
  @@ -107,7 +111,26 @@
                       inputCalendar.getPopupDateFormat());
   
               Application application = facesContext.getApplication();
  -            HtmlInputText inputText = (HtmlInputText) application.createComponent(HtmlInputText.COMPONENT_TYPE);
  +
  +            HtmlInputText inputText = null;
  +
  +            List li = inputCalendar.getChildren();
  +
  +            for (int i = 0; i < li.size(); i++)
  +            {
  +                UIComponent uiComponent = (UIComponent) li.get(i);
  +
  +                if(uiComponent instanceof HtmlInputText)
  +                {
  +                    inputText = (HtmlInputText) uiComponent;
  +                    break;
  +                }
  +            }
  +
  +            if(inputText == null)
  +            {
  +                inputText = (HtmlInputText) application.createComponent(HtmlInputText.COMPONENT_TYPE);
  +            }
   
               RendererUtils.copyHtmlInputTextAttributes(inputCalendar, inputText);