
|
If you were logged in you would be able to see more operations.
|
|
|
Click
Created: 25/May/08 11:16 AM
Updated: 01/Oct/08 10:47 PM
|
|
| Component/s: |
extras
|
| Affects Version/s: |
1.5 M1
|
| Fix Version/s: |
1.5 M2
|
|
|
A DateField in a TabbedPanel may not be displayed if its not the active panel. However it will be included in the $jsImports which will cause a JS initialization error which will result in a Calender Alert message being displayed.
There are a number of potential fixes for this:
1 - remove Alert from Calendar.js, this is the quick and dirty solution, which leaves used JS code and imports in the page
2 - inline the JS initialization code in the page HTML for the DateField, has some performance issues with page rendering
3 - improve the logic for including JS, enabling the parent control/container to decide what is included.
|
|
Description
|
A DateField in a TabbedPanel may not be displayed if its not the active panel. However it will be included in the $jsImports which will cause a JS initialization error which will result in a Calender Alert message being displayed.
There are a number of potential fixes for this:
1 - remove Alert from Calendar.js, this is the quick and dirty solution, which leaves used JS code and imports in the page
2 - inline the JS initialization code in the page HTML for the DateField, has some performance issues with page rendering
3 - improve the logic for including JS, enabling the parent control/container to decide what is included. |
Show » |
|
|
Interesting scenario. Can you attach a demo of this to the issue? The TabbedFormDemo in the examples does cover this scenario and it works because the DateField is rendered even when its panel is not active.
>1 - remove Alert from Calendar.js, this is the quick and dirty solution, which leaves used JS code and imports in the page
This might work for DateField but other controls could still run into problems.
>2 - inline the JS initialization code in the page HTML for the DateField, has some performance issues with page rendering
Not sure how this would work?
>3 - improve the logic for including JS, enabling the parent control/container to decide what is included.
Have been thinking of this as well. PageImports should only invoke getHtmlImports of Control directly added to Page. Containers can then traverse their own children and include them. In the case of TabbedPanel it can conditionally include them.
A 4th option is to enhance the Javascript include logic to check if the specific control is available:
var control = document.getElementById('myDateField');
if (control != null) {
Calendar.setup(.....);
}
kind regards
bob