[jira] [Commented] (OFBIZ-7066) temporal expression screen missing date dialogbox

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-7066) temporal expression screen missing date dialogbox

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-7066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15282781#comment-15282781 ]

Montalbano Florian commented on OFBIZ-7066:
-------------------------------------------

Hi Wai,

the problem seems to be related to a conflict of id when the page is build from the template.

Here are the input code from a working form in the same page (Date Range) :
{code}<input name="date1_i18n" title="Format: yyyy-MM-dd HH:mm:ss.SSS" size="25" maxlength="30" id="date11_i18n" type="text">{code}

The date dialog is present.

The input code for the not working one (Frequency) :
{code}<input name="date1_i18n" title="Format: yyyy-MM-dd HH:mm:ss.SSS" size="25" maxlength="30" id="date11_i18n" type="text">{code}

It's the exact same id (and same code).

From W3C : {quote}The id attribute specifies a unique id for an HTML element (the value must be unique within the HTML document).{quote}

And here it's confusing the javascript or something resulting in this following difference in the line just after each input :
Working one => {code}<input id="date11" class="hasDatepicker" name="date1" title="Format: yyyy-MM-dd HH:mm:ss.SSS" size="25" maxlength="30" type="hidden">{code}

Broken one => {code}<input date11 name="date1" title="Format: yyyy-MM-dd HH:mm:ss.SSS" size="25" maxlength="30" type="hidden">{code}

The class "hasDatepicker" is not added and thus the date dialog button is not created.

Root of the problem :
In the template tempExprMacros.ftl, the input type is "DateField". The id of a DateField is created as follow :  ${fieldName} + "1". Both form are using "date1" as fieldName resulting in this id conflict.

I will provide a example of solution (easy workaround not a final solution) to illustrate the working behaviour when the id conflict is avoided.

Have a nice day.

Florian

> temporal expression screen missing date dialogbox
> -------------------------------------------------
>
>                 Key: OFBIZ-7066
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-7066
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Trunk
>            Reporter: Wai
>
> go to https://localhost:8443/webtools/control/editTemporalExpression
> go to frequency expression section
> notice date dialog button is missing



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)