ofbiz-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacques Le Roux (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (OFBIZ-7066) temporal expression screen missing date dialogbox
Date Tue, 18 Apr 2017 14:37:42 GMT

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

Jacques Le Roux edited comment on OFBIZ-7066 at 4/18/17 2:37 PM:
-----------------------------------------------------------------

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 :
{code}
${fieldName} + "1".
{code}
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


was (Author: florian m):
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
>         Attachments: example_solution
>
>
> 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.15#6346)

Mime
View raw message