Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-9380

renderDateTimeField works in IE, not working with lastest Chrome

    Details

      Description

       <@htmlTemplate.renderDateTimeField ... />
      

      Works correctly in IE; but in firefox and chrome, it ignores the values when sent to an entity updating service call. The page gets refreshed with the original date.

        Activity

        Hide
        deepak.dixit Deepak Dixit added a comment -

        Also as its not a bug so changing the ticket type to improvement.

        Show
        deepak.dixit Deepak Dixit added a comment - Also as its not a bug so changing the ticket type to improvement.
        Hide
        deepak.dixit Deepak Dixit added a comment -

        Thanks Jacques,

        I was waiting for Chuck Kosta reply, but I think we can close will reopen if required.

        Show
        deepak.dixit Deepak Dixit added a comment - Thanks Jacques, I was waiting for Chuck Kosta reply, but I think we can close will reopen if required.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Hi Deepak,

        Should we not close?

        Show
        jacques.le.roux Jacques Le Roux added a comment - Hi Deepak, Should we not close?
        Hide
        deepak.dixit Deepak Dixit added a comment -

        Improved code and made formName field optional for renderDateTime macro.
        This has been committed at
        Trunk at r#1796262
        16.11 at r#1796263
        15.12 at r#1796264
        14.12 at r#1796265

        Thanks Chuck Kosta for reporting the issue.

        Show
        deepak.dixit Deepak Dixit added a comment - Improved code and made formName field optional for renderDateTime macro. This has been committed at Trunk at r#1796262 16.11 at r#1796263 15.12 at r#1796264 14.12 at r#1796265 Thanks Chuck Kosta for reporting the issue.
        Hide
        deepak.dixit Deepak Dixit added a comment - - edited

        Thanks Chuck Kosta for details,
        Html5 form attribute works with id, if you want to use form attribute then you need to pass an form id.
        IE does not support form attribute that why case mentioned by you working in IE only.
        http://caniuse.com/#feat=form-attribute

        HTML5 introduced a new form attribute that allows you to associate any orphaned form control with any <form> element on the page
        In your case you don;t need to pass formName in renderDateTime macro as you are defining the field inside form.

        I think we can make this formName field as optional parameter as this is not required in all cases.

        Show
        deepak.dixit Deepak Dixit added a comment - - edited Thanks Chuck Kosta for details, Html5 form attribute works with id, if you want to use form attribute then you need to pass an form id. IE does not support form attribute that why case mentioned by you working in IE only. http://caniuse.com/#feat=form-attribute HTML5 introduced a new form attribute that allows you to associate any orphaned form control with any <form> element on the page In your case you don;t need to pass formName in renderDateTime macro as you are defining the field inside form. I think we can make this formName field as optional parameter as this is not required in all cases.
        Hide
        chuck_kosta Chuck Kosta added a comment -

        It seemed to be a pattern following issue. All the other widgets had formName="EditFacilityForm" so we used it in the date picker. However, if you leave formName="" empty; then it works...
        The question is whether 'EditFacilityForm' is supposed to be there or not?

        If you add this code below to your EditFacility page 'as is' let me know what happens.

              <@htmlTemplate.renderDateTimeField name="closedDate" event="" action="" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" value="${facility.closedDate!}" size="25" maxlength="30" id="closedDate" dateType="date" shortDateInput=false timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName="EditFacilityForm"/>
        
        Show
        chuck_kosta Chuck Kosta added a comment - It seemed to be a pattern following issue. All the other widgets had formName="EditFacilityForm" so we used it in the date picker. However, if you leave formName="" empty; then it works... The question is whether 'EditFacilityForm' is supposed to be there or not? If you add this code below to your EditFacility page 'as is' let me know what happens. <@htmlTemplate.renderDateTimeField name= "closedDate" event= "" action=" " className=" " alert=" " title=" Format: yyyy-MM-dd HH:mm:ss.SSS " value=" ${facility.closedDate!} " size=" 25 " maxlength=" 30 " id=" closedDate " dateType=" date " shortDateInput= false timeDropdownParamName=" " defaultDateTimeString=" " localizedIconTitle=" " timeDropdown=" " timeHourName=" " classString=" " hour1=" " hour2=" " timeMinutesName=" " minutes=" " isTwelveHour=" " ampmName=" " amSelected=" " pmSelected=" " compositeType=" " formName=" EditFacilityForm"/>
        Hide
        jacopoc Jacopo Cappellato added a comment -

        Thank you for the report Chuck Kosta.
        I have tried to recreate the bug using the demo data and the out-of-the-box application; here are the steps I have followed:

        1) setup an instance of OFBiz 14.12 with demo data (./ant clean-all load-demo start)
        2) go to Catalog->Promos->select the first promotion and then select the "stores" tab; here is a shortcut (authenticate as admin/ofbiz):
        https://localhost:8443/catalog/control/EditProductPromoStores?productPromoId=9020
        3) in the screen, the input box with column named "THROUGH DATE" is rendered using the @htmlTemplate.renderDateTimeField macro (see the file EditProductPromoStores.ftl)
        4) select a date value and submit the form; the data is saved in the database

        I have tested it with Chrome.

        Could you please confirm if you can run the same steps? You could compare the fields set in this macro cal with the ones that you set in your screen and hopefully this will provide some clues about the nature of the issue.

        Show
        jacopoc Jacopo Cappellato added a comment - Thank you for the report Chuck Kosta . I have tried to recreate the bug using the demo data and the out-of-the-box application; here are the steps I have followed: 1) setup an instance of OFBiz 14.12 with demo data (./ant clean-all load-demo start) 2) go to Catalog->Promos->select the first promotion and then select the "stores" tab; here is a shortcut (authenticate as admin/ofbiz): https://localhost:8443/catalog/control/EditProductPromoStores?productPromoId=9020 3) in the screen, the input box with column named "THROUGH DATE" is rendered using the @htmlTemplate.renderDateTimeField macro (see the file EditProductPromoStores.ftl) 4) select a date value and submit the form; the data is saved in the database I have tested it with Chrome. Could you please confirm if you can run the same steps? You could compare the fields set in this macro cal with the ones that you set in your screen and hopefully this will provide some clues about the nature of the issue.

          People

          • Assignee:
            deepak.dixit Deepak Dixit
            Reporter:
            chuck_kosta Chuck Kosta
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development