Details
-
Type: Bug
-
Status: Closed
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 1.6, 1.6.1
-
Component/s: ICE-Components
-
Labels:None
-
Environment:OS: Windows; Browser: All;
-
ICEsoft Forum Reference:
-
Workaround Exists:Yes
-
Workaround Description:
Description
Hi. I found a most intriguing issue. The <ice:selectInputDate> seems to ignore the disabled attribute. I've taken a look in the generated html code and the generated <input> indeed has no disabled attribute. The fix is easy I think. I took a look in icefaces' source code and found out that the disabled attribute is not taken into consideration: com.icesoft.faces.component.selectinputdate.SelectInputDateRenderer, method public void encodeEnd(FacesContext facesContext, UIComponent uiComponent) throws IOException; The simplest thing in my opinion would be to do the following:
<code>
Element dateText = domContext.createElement(HTML.INPUT_ELEM);
dateText.setAttribute(HTML.VALUE_ATTR, selectInputDate.formatDate((Date)selectInputDate.getValue()));
dateText.setAttribute(HTML.ID_ATTR, clientId + CALENDAR_INPUTTEXT);
dateText.setAttribute(HTML.NAME_ATTR, clientId + CALENDAR_INPUTTEXT);
dateText.setAttribute(HTML.CLASS_ATTR, selectInputDate.getCalendarInputClass());
dateText.setAttribute(HTML.ONFOCUS_ATTR, "setFocus('');");
dateText.setAttribute("onkeypress", this.ICESUBMIT);
dateText.setAttribute(HTML.ONBLUR_ATTR, this.ICESUBMITPARTIAL);
//my code
if (selectInputDate.isDisabled()) {
dateText.setAttribute(HTML.DISABLED_ATTR, "true");
}
if (selectInputDate.getAutocomplete() != null) {
dateText.setAttribute("autocomplete", selectInputDate.getAutocomplete());
}
// extract the popupdate format and use it as a tooltip
String tooltip = selectInputDate.getPopupDateFormat();
dateText.setAttribute(HTML.TITLE_ATTR, "Date Format: " + tooltip);
root.appendChild(dateText);
Element calendarButton = domContext.createElement(HTML.INPUT_ELEM);
calendarButton.setAttribute(HTML.ID_ATTR, clientId + CALENDAR_BUTTON);
calendarButton.setAttribute(HTML.NAME_ATTR, clientId + CALENDAR_BUTTON);
calendarButton.setAttribute(HTML.TYPE_ATTR, "image");
//my code
if (selectInputDate.isDisabled()) {
calendarButton.setAttribute(HTML.DISABLED_ATTR, "true");
}
</code>
<code>
Element dateText = domContext.createElement(HTML.INPUT_ELEM);
dateText.setAttribute(HTML.VALUE_ATTR, selectInputDate.formatDate((Date)selectInputDate.getValue()));
dateText.setAttribute(HTML.ID_ATTR, clientId + CALENDAR_INPUTTEXT);
dateText.setAttribute(HTML.NAME_ATTR, clientId + CALENDAR_INPUTTEXT);
dateText.setAttribute(HTML.CLASS_ATTR, selectInputDate.getCalendarInputClass());
dateText.setAttribute(HTML.ONFOCUS_ATTR, "setFocus('');");
dateText.setAttribute("onkeypress", this.ICESUBMIT);
dateText.setAttribute(HTML.ONBLUR_ATTR, this.ICESUBMITPARTIAL);
//my code
if (selectInputDate.isDisabled()) {
dateText.setAttribute(HTML.DISABLED_ATTR, "true");
}
if (selectInputDate.getAutocomplete() != null) {
dateText.setAttribute("autocomplete", selectInputDate.getAutocomplete());
}
// extract the popupdate format and use it as a tooltip
String tooltip = selectInputDate.getPopupDateFormat();
dateText.setAttribute(HTML.TITLE_ATTR, "Date Format: " + tooltip);
root.appendChild(dateText);
Element calendarButton = domContext.createElement(HTML.INPUT_ELEM);
calendarButton.setAttribute(HTML.ID_ATTR, clientId + CALENDAR_BUTTON);
calendarButton.setAttribute(HTML.NAME_ATTR, clientId + CALENDAR_BUTTON);
calendarButton.setAttribute(HTML.TYPE_ATTR, "image");
//my code
if (selectInputDate.isDisabled()) {
calendarButton.setAttribute(HTML.DISABLED_ATTR, "true");
}
</code>
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #22416 | Fri Sep 24 08:37:50 MDT 2010 | yip.ng | |
Files Changed | ||||
MODIFY
/icefaces2/trunk/icefaces/compat/core/src/main/resources/css/com/icesoft/faces/resources/css/rime/rime.css
MODIFY /icefaces2/trunk/icefaces/compat/core/src/main/resources/css/com/icesoft/faces/resources/css/rime/rime-portlet.css MODIFY /icefaces2/trunk/icefaces/compat/core/src/main/resources/css/com/icesoft/faces/resources/css/xp/xp-portlet.css MODIFY /icefaces2/trunk/icefaces/compat/core/src/main/resources/css/com/icesoft/faces/resources/css/royale/royale.css MODIFY /icefaces2/trunk/icefaces/compat/core/src/main/resources/css/com/icesoft/faces/resources/css/xp/xp.css |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #22415 | Fri Sep 24 08:36:50 MDT 2010 | yip.ng | |
Files Changed | ||||
MODIFY
/icefaces/trunk/icefaces/core/src/com/icesoft/faces/resources/css/xp/xp-portlet.css
MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/resources/css/xp/xp.css MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/resources/css/woodstock/woodstock.css MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/resources/css/royale/royale.css MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/resources/css/rime/rime.css MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/resources/css/rime/rime-portlet.css |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #14801 | Fri Sep 07 15:59:29 MDT 2007 | yip.ng | Added code to set the value of the disabled attribute for the links, input fields and buttons in the calendar component. |
Files Changed | ||||
MODIFY
/icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/selectinputdate/SelectInputDateRenderer.java
|
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #14800 | Fri Sep 07 15:58:11 MDT 2007 | yip.ng | Added code to set the value of the disabled attribute for the links, input fields and buttons in the calendar component. |
Files Changed | ||||
MODIFY
/icefaces/branches/icefaces-1.6/icefaces/component/src/com/icesoft/faces/component/selectinputdate/SelectInputDateRenderer.java
|