You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Andrew Robinson (JIRA)" <de...@myfaces.apache.org> on 2006/04/18 00:52:18 UTC

[jira] Created: (TOMAHAWK-261) Do not use document.write in popup calendars

Do not use document.write in popup calendars
--------------------------------------------

         Key: TOMAHAWK-261
         URL: http://issues.apache.org/jira/browse/TOMAHAWK-261
     Project: MyFaces Tomahawk
        Type: Improvement

  Components: Calendar, Date  
    Versions: 1.1.2-SNAPSHOT, 1.1.1, 1.1.3-SNAPSHOT    
    Reporter: Andrew Robinson
    Priority: Blocker


The popup calednar for the date control (and I think the calendar control) uses javascript "document.write" methods. Unfortunately this is not very compatible with AJAX as it is hard to write content to the document after the document is closed.

Instead, can this be changed to have: 

A) printed hidden component  (visibility: hidden; display: none) and just shown when the user clicks the popup button.

or 

B) Use the DOM JavaScript API to add new elements to the DOM instead of document.write.

Unless this is changed, these controls cannot be used with AjaxAnywhere and probably not with other AJAX solutions.

-- 
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] Updated: (TOMAHAWK-261) Do not use document.write in popup calendars

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/TOMAHAWK-261?page=all ]

Martin Marinschek updated TOMAHAWK-261:
---------------------------------------

           Status: Resolved  (was: Patch Available)
    Fix Version/s: 1.1.4-SNAPSHOT
       Resolution: Fixed

Thanks to Andrew Robinson for this fix.

regards,

Martin

> Do not use document.write in popup calendars
> --------------------------------------------
>
>                 Key: TOMAHAWK-261
>                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-261
>             Project: MyFaces Tomahawk
>          Issue Type: Improvement
>          Components: Calendar, Date
>    Affects Versions: 1.1.1, 1.1.2-SNAPSHOT, 1.1.3-SNAPSHOT
>            Reporter: Andrew Robinson
>         Assigned To: Martin Marinschek
>            Priority: Blocker
>             Fix For: 1.1.4-SNAPSHOT
>
>         Attachments: HtmlCalendarRenderer.patch
>
>
> The popup calednar for the date control (and I think the calendar control) uses javascript "document.write" methods. Unfortunately this is not very compatible with AJAX as it is hard to write content to the document after the document is closed.
> Instead, can this be changed to have: 
> A) printed hidden component  (visibility: hidden; display: none) and just shown when the user clicks the popup button.
> or 
> B) Use the DOM JavaScript API to add new elements to the DOM instead of document.write.
> Unless this is changed, these controls cannot be used with AjaxAnywhere and probably not with other AJAX solutions.

-- 
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: (TOMAHAWK-261) Do not use document.write in popup calendars

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-261?page=comments#action_12376897 ] 

Martin Marinschek commented on TOMAHAWK-261:
--------------------------------------------

The calendar javascript has been completely rewritten to not make any use of document.write anymore.

Can you please check it out in the nightly version, and tell us if we missed anything in implementing this?

regards,

Martin

> Do not use document.write in popup calendars
> --------------------------------------------
>
>          Key: TOMAHAWK-261
>          URL: http://issues.apache.org/jira/browse/TOMAHAWK-261
>      Project: MyFaces Tomahawk
>         Type: Improvement

>   Components: Calendar, Date
>     Versions: 1.1.2-SNAPSHOT, 1.1.1, 1.1.3-SNAPSHOT
>     Reporter: Andrew Robinson
>     Priority: Blocker

>
> The popup calednar for the date control (and I think the calendar control) uses javascript "document.write" methods. Unfortunately this is not very compatible with AJAX as it is hard to write content to the document after the document is closed.
> Instead, can this be changed to have: 
> A) printed hidden component  (visibility: hidden; display: none) and just shown when the user clicks the popup button.
> or 
> B) Use the DOM JavaScript API to add new elements to the DOM instead of document.write.
> Unless this is changed, these controls cannot be used with AjaxAnywhere and probably not with other AJAX solutions.

-- 
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: (TOMAHAWK-261) Do not use document.write in popup calendars

Posted by "Jeremy Grelle (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-261?page=comments#action_12436695 ] 
            
Jeremy Grelle commented on TOMAHAWK-261:
----------------------------------------

I don't mean to nitpick or anything, but it was actually me that provided the working patch.  ;)  Thank you for checking it out and applying it, Martin.

Thanks,
Jeremy

> Do not use document.write in popup calendars
> --------------------------------------------
>
>                 Key: TOMAHAWK-261
>                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-261
>             Project: MyFaces Tomahawk
>          Issue Type: Improvement
>          Components: Calendar, Date
>    Affects Versions: 1.1.1, 1.1.2-SNAPSHOT, 1.1.3-SNAPSHOT
>            Reporter: Andrew Robinson
>         Assigned To: Martin Marinschek
>            Priority: Blocker
>             Fix For: 1.1.4-SNAPSHOT
>
>         Attachments: HtmlCalendarRenderer.patch
>
>
> The popup calednar for the date control (and I think the calendar control) uses javascript "document.write" methods. Unfortunately this is not very compatible with AJAX as it is hard to write content to the document after the document is closed.
> Instead, can this be changed to have: 
> A) printed hidden component  (visibility: hidden; display: none) and just shown when the user clicks the popup button.
> or 
> B) Use the DOM JavaScript API to add new elements to the DOM instead of document.write.
> Unless this is changed, these controls cannot be used with AjaxAnywhere and probably not with other AJAX solutions.

-- 
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] Updated: (TOMAHAWK-261) Do not use document.write in popup calendars

Posted by "Jeremy Grelle (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/TOMAHAWK-261?page=all ]

Jeremy Grelle updated TOMAHAWK-261:
-----------------------------------

    Status: Patch Available  (was: Open)

> Do not use document.write in popup calendars
> --------------------------------------------
>
>          Key: TOMAHAWK-261
>          URL: http://issues.apache.org/jira/browse/TOMAHAWK-261
>      Project: MyFaces Tomahawk
>         Type: Improvement

>   Components: Calendar, Date
>     Versions: 1.1.2-SNAPSHOT, 1.1.1, 1.1.3-SNAPSHOT
>     Reporter: Andrew Robinson
>     Assignee: Martin Marinschek
>     Priority: Blocker

>
> The popup calednar for the date control (and I think the calendar control) uses javascript "document.write" methods. Unfortunately this is not very compatible with AJAX as it is hard to write content to the document after the document is closed.
> Instead, can this be changed to have: 
> A) printed hidden component  (visibility: hidden; display: none) and just shown when the user clicks the popup button.
> or 
> B) Use the DOM JavaScript API to add new elements to the DOM instead of document.write.
> Unless this is changed, these controls cannot be used with AjaxAnywhere and probably not with other AJAX solutions.

-- 
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: (TOMAHAWK-261) Do not use document.write in popup calendars

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-261?page=comments#action_12436778 ] 
            
Martin Marinschek commented on TOMAHAWK-261:
--------------------------------------------

Sorry - my bad.

So thanks to Jeremy Grelle for this patch!

regards,

Martin

> Do not use document.write in popup calendars
> --------------------------------------------
>
>                 Key: TOMAHAWK-261
>                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-261
>             Project: MyFaces Tomahawk
>          Issue Type: Improvement
>          Components: Calendar, Date
>    Affects Versions: 1.1.1, 1.1.2-SNAPSHOT, 1.1.3-SNAPSHOT
>            Reporter: Andrew Robinson
>         Assigned To: Martin Marinschek
>            Priority: Blocker
>             Fix For: 1.1.4-SNAPSHOT
>
>         Attachments: HtmlCalendarRenderer.patch
>
>
> The popup calednar for the date control (and I think the calendar control) uses javascript "document.write" methods. Unfortunately this is not very compatible with AJAX as it is hard to write content to the document after the document is closed.
> Instead, can this be changed to have: 
> A) printed hidden component  (visibility: hidden; display: none) and just shown when the user clicks the popup button.
> or 
> B) Use the DOM JavaScript API to add new elements to the DOM instead of document.write.
> Unless this is changed, these controls cannot be used with AjaxAnywhere and probably not with other AJAX solutions.

-- 
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: (TOMAHAWK-261) Do not use document.write in popup calendars

Posted by "Andrew Robinson (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-261?page=comments#action_12376951 ] 

Andrew Robinson commented on TOMAHAWK-261:
------------------------------------------

Not looking too good.

1) It doesn't work when the calendar is positioned inside of absolute positioned elements. I clicked on the button, and my scrollbars changed (grew), but the calendar never appeared. I have the popup calendar parent control positioned absolute inside of an absolute DIV that has a fairly high z-order (~500). 

2) Document.write is still being used. Here is the JavaScript that was rendered by the control:
var zfpForm_3A_5Fid235CalendarVar=new org_apache_myfaces_PopupCalendar();
zfpForm_3A_5Fid235CalendarVar.initData.imgDir = "/StormPeak/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11462360/calendar.HtmlCalendarRenderer/DB/";
zfpForm_3A_5Fid235CalendarVar.initData.monthName = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
zfpForm_3A_5Fid235CalendarVar.initData.dayName = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
zfpForm_3A_5Fid235CalendarVar.initData.startAt = 0;
zfpForm_3A_5Fid235CalendarVar.dateFormatSymbols.weekdays = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
zfpForm_3A_5Fid235CalendarVar.dateFormatSymbols.shortWeekdays = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
zfpForm_3A_5Fid235CalendarVar.dateFormatSymbols.shortMonths = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
zfpForm_3A_5Fid235CalendarVar.dateFormatSymbols.months = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
zfpForm_3A_5Fid235CalendarVar.dateFormatSymbols.eras = new Array("BC","AD");
zfpForm_3A_5Fid235CalendarVar.dateFormatSymbols.ampms = new Array("AM","PM");
zfpForm_3A_5Fid235CalendarVar.initData.popupLeft = false;

zfpForm_3A_5Fid235CalendarVar.init(document.getElementById('zfpForm:_id235Span'));

if (!document.layers) {
document.write('<input type="button" onclick="zfpForm_3A_5Fid235CalendarVar._popUpCalendar(this,document.getElementById(\'zfpForm:_id235\'),\'M/d/yy\')" value="..." />');
}

You can see the document.write at the bottom. Despite being inside of an if statement, the presence of the document.write causes errors in AjaxAnywhere.

> Do not use document.write in popup calendars
> --------------------------------------------
>
>          Key: TOMAHAWK-261
>          URL: http://issues.apache.org/jira/browse/TOMAHAWK-261
>      Project: MyFaces Tomahawk
>         Type: Improvement

>   Components: Calendar, Date
>     Versions: 1.1.2-SNAPSHOT, 1.1.1, 1.1.3-SNAPSHOT
>     Reporter: Andrew Robinson
>     Assignee: Martin Marinschek
>     Priority: Blocker

>
> The popup calednar for the date control (and I think the calendar control) uses javascript "document.write" methods. Unfortunately this is not very compatible with AJAX as it is hard to write content to the document after the document is closed.
> Instead, can this be changed to have: 
> A) printed hidden component  (visibility: hidden; display: none) and just shown when the user clicks the popup button.
> or 
> B) Use the DOM JavaScript API to add new elements to the DOM instead of document.write.
> Unless this is changed, these controls cannot be used with AjaxAnywhere and probably not with other AJAX solutions.

-- 
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: (TOMAHAWK-261) Do not use document.write in popup calendars

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-261?page=comments#action_12436665 ] 
            
Martin Marinschek commented on TOMAHAWK-261:
--------------------------------------------

And by the way: I don't suppose that Netscape 4 is a browser we still support. If anybody has problems though, please reopen this issue.

regards,

Martin

> Do not use document.write in popup calendars
> --------------------------------------------
>
>                 Key: TOMAHAWK-261
>                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-261
>             Project: MyFaces Tomahawk
>          Issue Type: Improvement
>          Components: Calendar, Date
>    Affects Versions: 1.1.1, 1.1.2-SNAPSHOT, 1.1.3-SNAPSHOT
>            Reporter: Andrew Robinson
>         Assigned To: Martin Marinschek
>            Priority: Blocker
>             Fix For: 1.1.4-SNAPSHOT
>
>         Attachments: HtmlCalendarRenderer.patch
>
>
> The popup calednar for the date control (and I think the calendar control) uses javascript "document.write" methods. Unfortunately this is not very compatible with AJAX as it is hard to write content to the document after the document is closed.
> Instead, can this be changed to have: 
> A) printed hidden component  (visibility: hidden; display: none) and just shown when the user clicks the popup button.
> or 
> B) Use the DOM JavaScript API to add new elements to the DOM instead of document.write.
> Unless this is changed, these controls cannot be used with AjaxAnywhere and probably not with other AJAX solutions.

-- 
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: (TOMAHAWK-261) Do not use document.write in popup calendars

Posted by "Adam Winer (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-261?page=comments#action_12374828 ] 

Adam Winer commented on TOMAHAWK-261:
-------------------------------------

In addition, document.write() cannot be used in XHTML.

http://www.w3.org/MarkUp/2004/xhtml-faq#docwrite

> Do not use document.write in popup calendars
> --------------------------------------------
>
>          Key: TOMAHAWK-261
>          URL: http://issues.apache.org/jira/browse/TOMAHAWK-261
>      Project: MyFaces Tomahawk
>         Type: Improvement

>   Components: Calendar, Date
>     Versions: 1.1.2-SNAPSHOT, 1.1.1, 1.1.3-SNAPSHOT
>     Reporter: Andrew Robinson
>     Priority: Blocker

>
> The popup calednar for the date control (and I think the calendar control) uses javascript "document.write" methods. Unfortunately this is not very compatible with AJAX as it is hard to write content to the document after the document is closed.
> Instead, can this be changed to have: 
> A) printed hidden component  (visibility: hidden; display: none) and just shown when the user clicks the popup button.
> or 
> B) Use the DOM JavaScript API to add new elements to the DOM instead of document.write.
> Unless this is changed, these controls cannot be used with AjaxAnywhere and probably not with other AJAX solutions.

-- 
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