ICEfaces
  1. ICEfaces
  2. ICE-2127

selectInputDate hard-codes images

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.1
    • Fix Version/s: 1.6.2, 1.7DR#2, 1.7
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      All

      Description

      It looks like selectInputDate hard-codes image names in its rendering, when it should instead be applying styles which could then be overridden via CSS.

        Activity

        Mark Collette created issue -
        Ken Fyten made changes -
        Field Original Value New Value
        Fix Version/s 1.7 [ 10080 ]
        Assignee Yip Ng [ yip.ng ]
        Hide
        yip.ng added a comment -

        There is already an existing way to override the default images using the imageDir attribute. Go to http://www.icefaces.org/docs/v1_6_0/components/index.html and look under selectInputDate.

        I have worked out a way to override via CSS style classes without causing glitches in either IE or FF, but there are complications:

        • it may break applications already using the existing approach
        • if we allow users to use arbitrary class names, then extra attributes are required to specify them
        • ...?

        What to do?

        Show
        yip.ng added a comment - There is already an existing way to override the default images using the imageDir attribute. Go to http://www.icefaces.org/docs/v1_6_0/components/index.html and look under selectInputDate. I have worked out a way to override via CSS style classes without causing glitches in either IE or FF, but there are complications: it may break applications already using the existing approach if we allow users to use arbitrary class names, then extra attributes are required to specify them ...? What to do?
        Hide
        Mark Collette added a comment -

        Right now, the base CSS classname is iceSelInpDate. We allow for the following styles to be rendered:

        iceSelInpDate
        iceSelInpDateInput
        iceSelInpDateMonthYear
        iceSelInpDateWeek
        iceSelInpDateDay
        iceSelInpDateCur

        So, what you would be adding, is these four new styles (named something like these), where you refer to the way of setting the images:

        iceSelInpDatePrevMonth
        iceSelInpDateNextMonth
        iceSelInpDateOpenPopup
        iceSelInpDateClosePopup

        Those would be the classes in xp.css and royale.css where you'd put the CSS that you've made. If they want to change the style of those buttons, then they would use the one existing style attribute. For example: style="myCalendar" which would then require them to set the following style classes in their own CSS file:

        myCalendarPrevMonth
        myCalendarNextMonth
        myCalendarOpenPopup
        myCalendarClosePopup

        This allows them to not only set the image locations and image names to whatever they want in their CSS, but also to choose to not use images at all, and rather just set a background colour or whatever. This allows mobile apps to save bandwidth by using CSS files with images for desktop browsers, and CSS files without images for mobile browsers.

        As for backwards compatibility with the old imageDir attribute, we could always split the rendering into two paths, one that would call the old code if imageDir is set, and one that would use the new code if it's not set. Wouldn't be the prettiest thing, but it would allow us to deprecate the imageDir attribute without messing up anyone's existing apps.

        Show
        Mark Collette added a comment - Right now, the base CSS classname is iceSelInpDate. We allow for the following styles to be rendered: iceSelInpDate iceSelInpDateInput iceSelInpDateMonthYear iceSelInpDateWeek iceSelInpDateDay iceSelInpDateCur So, what you would be adding, is these four new styles (named something like these), where you refer to the way of setting the images: iceSelInpDatePrevMonth iceSelInpDateNextMonth iceSelInpDateOpenPopup iceSelInpDateClosePopup Those would be the classes in xp.css and royale.css where you'd put the CSS that you've made. If they want to change the style of those buttons, then they would use the one existing style attribute. For example: style="myCalendar" which would then require them to set the following style classes in their own CSS file: myCalendarPrevMonth myCalendarNextMonth myCalendarOpenPopup myCalendarClosePopup This allows them to not only set the image locations and image names to whatever they want in their CSS, but also to choose to not use images at all, and rather just set a background colour or whatever. This allows mobile apps to save bandwidth by using CSS files with images for desktop browsers, and CSS files without images for mobile browsers. As for backwards compatibility with the old imageDir attribute, we could always split the rendering into two paths, one that would call the old code if imageDir is set, and one that would use the new code if it's not set. Wouldn't be the prettiest thing, but it would allow us to deprecate the imageDir attribute without messing up anyone's existing apps.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #14884 Mon Oct 01 17:32:03 MDT 2007 yip.ng ICE-2127
        Modified to allow calendar button images to be overridden via CSS.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/CSS_DEFAULT.java
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/resources/css/xp/xp.css
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/selectinputdate/SelectInputDate.java
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/resources/css/royale/royale.css
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/selectinputdate/SelectInputDateRenderer.java
        Hide
        yip.ng added a comment -

        Screenshot of test for overriding button images via CSS.

        Show
        yip.ng added a comment - Screenshot of test for overriding button images via CSS.
        yip.ng made changes -
        Attachment screenshot-1.jpg [ 10680 ]
        Hide
        yip.ng added a comment -

        To test:

        In component-showcase\web\inc\components\selectInputDate.jspx, remove the imageDir attribute and add the following attribute:
        styleClass="myCalendar"

        In component-showcase\web\css\showcase_style.css, add the following CSS code:
        .myCalendarMovePrev

        { background-image: url(../images/menu/zoomout.gif); }

        .myCalendarMoveNext

        { background-image: url(../images/menu/zoomin.gif); }

        .myCalendarOpenPopup

        { background-image: url(../images/menu/zoomin.gif); }

        .myCalendarClosePopup

        { background-image: url(../images/menu/zoomout.gif); }
        Show
        yip.ng added a comment - To test: In component-showcase\web\inc\components\selectInputDate.jspx, remove the imageDir attribute and add the following attribute: styleClass="myCalendar" In component-showcase\web\css\showcase_style.css, add the following CSS code: .myCalendarMovePrev { background-image: url(../images/menu/zoomout.gif); } .myCalendarMoveNext { background-image: url(../images/menu/zoomin.gif); } .myCalendarOpenPopup { background-image: url(../images/menu/zoomin.gif); } .myCalendarClosePopup { background-image: url(../images/menu/zoomout.gif); }
        yip.ng made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #14907 Tue Oct 09 10:42:33 MDT 2007 yip.ng ICE-2127
        Updated TLD doc.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/component-metadata/src/main/resources/conf/ice_cust_properties/cust-selectInputDate-props.xml
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #14985 Fri Oct 19 13:55:28 MDT 2007 yip.ng ICE-2127
        Propagated changes from xp.css.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/resources/css/xp/xp-portlet.css
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #14993 Fri Oct 19 17:41:31 MDT 2007 mark.collette Backport to 1.6.2 : ICE-1865, ICE-2082, ICE-2095, ICE-2150, ICE-2127
        Files Changed
        Commit graph MODIFY /icefaces/branches/icefaces-1.6/icefaces/samples/component-showcase/src/com/icesoft/icefaces/samples/showcase/components/calendar/SelectInputDateBean.java
        Commit graph MODIFY /icefaces/branches/icefaces-1.6/icefaces/core/src/com/icesoft/faces/resources/css/royale/royale.css
        Commit graph MODIFY /icefaces/branches/icefaces-1.6/icefaces/component/src/com/icesoft/faces/component/CSS_DEFAULT.java
        Commit graph MODIFY /icefaces/branches/icefaces-1.6/icefaces/samples/component-showcase/web/inc/components/selectInputDate.jspx
        Commit graph MODIFY /icefaces/branches/icefaces-1.6/icefaces/core/src/com/icesoft/faces/resources/css/xp/xp-portlet.css
        Commit graph MODIFY /icefaces/branches/icefaces-1.6/icefaces/component/src/com/icesoft/faces/component/selectinputdate/SelectInputDate.java
        Commit graph MODIFY /icefaces/branches/icefaces-1.6/icefaces/component-metadata/src/main/resources/conf/ice_cust_properties/cust-selectInputDate-props.xml
        Commit graph MODIFY /icefaces/branches/icefaces-1.6/icefaces/core/src/com/icesoft/faces/resources/css/xp/xp.css
        Commit graph MODIFY /icefaces/branches/icefaces-1.6/icefaces/component/src/com/icesoft/faces/component/util/CustomComponentUtils.java
        Commit graph MODIFY /icefaces/branches/icefaces-1.6/icefaces/component/src/com/icesoft/faces/component/selectinputdate/SelectInputDateRenderer.java
        Ken Fyten made changes -
        Fix Version/s 1.7DR#2 [ 10110 ]
        Fix Version/s 1.7 [ 10080 ]
        Mark Collette made changes -
        Fix Version/s 1.6.2 [ 10111 ]
        Ken Fyten made changes -
        Fix Version/s 1.7 [ 10080 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Yip Ng [ yip.ng ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Mark Collette
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: