[ 
https://issues.apache.org/jira/browse/TRINIDAD-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12633490#action_12633490
 ] 

Omar Elprince commented on TRINIDAD-1071:
-----------------------------------------

The patch are missing a case when the date range is set to span across one year 
only. In this case, the year id will not exist that will give a java script 
error "Object not found".

here is the fix: look for // MY FIX

private void _renderShowComboBoxScriptForIE6(FacesContext context, 
                                               RenderingContext arc, 
                                               FacesBean bean, 
                                               String baseId) throws 
IOException {
    if ("ie".equals(arc.getAgent().getAgentName()) && 
        arc.getAgent().getAgentVersion().startsWith("6")) {
      // IE6 only
      final ResponseWriter writer = context.getResponseWriter();
      final String monthId = 
        (baseId != null) ? baseId + ChooseDateRenderer.MONTH_PARAM : 
        ChooseDateRenderer.MONTH_PARAM;
      final String yearId = 
        (baseId != null) ? baseId + ChooseDateRenderer.YEAR_PARAM : 
        ChooseDateRenderer.YEAR_PARAM;

      writer.startElement("script", null);
      writer.writeAttribute("type", "text/javascript", null);
      writer.writeText("window.onload=showCombo; \n", null);
      writer.writeText("function showCombo() { \n", null);
      // Normal Trinidad onLoad;
      writer.writeText("_checkLoad(); \n", null);
      writer.writeText("document.getElementById('" + monthId + 
                       "').style.cssText = 'display: inline !important; 
visibility: visible !important;'; \n", 
                       null);
      writer.writeText("if (document.getElementById('" + yearId + 
                       "') != null) {", null);  // MY FIX
      writer.writeText("document.getElementById('" + yearId + 
                       "').style.cssText = 'display: inline !important; 
visibility: visible !important;'; \n", 
                       null);
      writer.writeText("}", null); // MY FIX
      // ToDo: Resize iframe to remove scrollbars:
      writer.writeText("return true; \n", null);
      writer.writeText("} \n", null);

      writer.endElement("script");
    }

  }


> combobox not shown in IE inside a lightweight dialog
> ----------------------------------------------------
>
>                 Key: TRINIDAD-1071
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1071
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 1.2.7-core
>         Environment: Tomcat 6.0.14, Sun JSF RI 1.2, Windows XP SP2, IE6, 
> Facelets 1.1.14 
>            Reporter: Mathias Walter
>         Attachments: ChooseDateRenderer.java, lwdlg_correctcb_IE.jpg, 
> lwdlg_missingcb_IE_1.jpg
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> A combobox (maybe with too long content) is not shown in a lightweight dialog 
> in IE. But if the combobox is a required field and the form is submitted, 
> then the combobox is shown correctly (together with the required error 
> message).
> Code:
> <?xml version='1.0' encoding='utf-8'?>
> <html xmlns="http://www.w3.org/1999/xhtml"; 
> xmlns:f="http://java.sun.com/jsf/core";
>       xmlns:tr="http://myfaces.apache.org/trinidad"; 
> xmlns:trh="http://myfaces.apache.org/trinidad/html";
>       xmlns:h="http://java.sun.com/jsf/html";
>       version="1.2">
>       <trh:head>
>               <title>Arzt auswählen</title>
>       </trh:head>
>       <trh:body>
>               <tr:form>
>                       <tr:panelFormLayout>
>                               <tr:selectOneChoice label="Arzt:" 
> value="#{physicians.choosed}" required="true">
>                                       <f:selectItems 
> value="#{physicians.items}" />
>                               </tr:selectOneChoice>
>                       </tr:panelFormLayout>
>                       <tr:separator />
>                       <tr:panelButtonBar halign="center">
>                               <tr:commandButton id="save" 
> action="#{physicians.select}" text="Übernehmen" />
>                               <tr:commandButton id="cancel" 
> action="#{physicians.cancelSelect}" text="Abbrechen" immediate="true" />
>                       </tr:panelButtonBar>
>               </tr:form>
>       </trh:body>
> </html>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to