You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Olivier Heintz (JIRA)" <ji...@apache.org> on 2012/05/19 10:02:13 UTC

[jira] [Created] (OFBIZ-4891) Add a Form attribute for simulate a click on a link included in the form(which not include a submit button) when "Enter button" is pressed on keyboard

Olivier Heintz created OFBIZ-4891:
-------------------------------------

             Summary: Add a Form attribute for simulate a click on a link included in the form(which not include a submit button) when "Enter button" is pressed on keyboard 
                 Key: OFBIZ-4891
                 URL: https://issues.apache.org/jira/browse/OFBIZ-4891
             Project: OFBiz
          Issue Type: Sub-task
          Components: framework
            Reporter: Olivier Heintz
            Priority: Minor


In some case, a single form doest not include a submit button, instead it includes an hypperlink. Setting this new attribute (validate-link-on-enter) to true will result in click on the link when enter button is pressed on any form other input

This patch enable to add javascript stuff on auto -generated forms(from xml forms) which execute the link with id (validate-link-id) when entre is pressed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OFBIZ-4891) Add a Form attribute for simulate a click on a link included in the form(which not include a submit button) when "Enter button" is pressed on keyboard

Posted by "Adrian Crum (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-4891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13279488#comment-13279488 ] 

Adrian Crum commented on OFBIZ-4891:
------------------------------------

Olivier,

The code:

{code}
String validateLinkOnEnter = formElement.getAttribute("validate-link-on-enter");
if (validateLinkOnEnter != null && validateLinkOnEnter.equalsIgnoreCase("true"))
  this.validateLinkOnEnter = true;
}
{code}

can be simplified to:

{code}
this.validateLinkOnEnter = "true".equalsIgnoreCase(formElement.getAttribute("validate-link-on-enter"));
{code}

Two things to remember:

1. When comparing Strings, always use the equals method of the String constant.
2. Element.getAttribute never returns null.

                
> Add a Form attribute for simulate a click on a link included in the form(which not include a submit button) when "Enter button" is pressed on keyboard 
> -------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4891
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4891
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4891.patch
>
>
> In some case, a single form doest not include a submit button, instead it includes an hypperlink. Setting this new attribute (validate-link-on-enter) to true will result in click on the link when enter button is pressed on any form other input
> This patch enable to add javascript stuff on auto -generated forms(from xml forms) which execute the link with id (validate-link-id) when entre is pressed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (OFBIZ-4891) Add a Form attribute for simulate a click on a link included in the form(which not include a submit button) when "Enter button" is pressed on keyboard

Posted by "Olivier Heintz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-4891?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Heintz updated OFBIZ-4891:
----------------------------------

    Attachment: OFBIZ-4891.patch

patch with still comment "#Bam# validate-form" to facilitate global review.
I will remove them before merge with trunk.
                
> Add a Form attribute for simulate a click on a link included in the form(which not include a submit button) when "Enter button" is pressed on keyboard 
> -------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4891
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4891
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4891.patch
>
>
> In some case, a single form doest not include a submit button, instead it includes an hypperlink. Setting this new attribute (validate-link-on-enter) to true will result in click on the link when enter button is pressed on any form other input
> This patch enable to add javascript stuff on auto -generated forms(from xml forms) which execute the link with id (validate-link-id) when entre is pressed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (OFBIZ-4891) Add a Form attribute for simulate a click on a link included in the form(which not include a submit button) when "Enter button" is pressed on keyboard

Posted by "Olivier Heintz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-4891?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Heintz updated OFBIZ-4891:
----------------------------------

    Attachment: OFBIZ-4891.patch

Patch correction after Adrian remark.

Thank's for your advices.
                
> Add a Form attribute for simulate a click on a link included in the form(which not include a submit button) when "Enter button" is pressed on keyboard 
> -------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4891
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4891
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>            Reporter: Olivier Heintz
>            Priority: Minor
>         Attachments: OFBIZ-4891.patch, OFBIZ-4891.patch
>
>
> In some case, a single form doest not include a submit button, instead it includes an hypperlink. Setting this new attribute (validate-link-on-enter) to true will result in click on the link when enter button is pressed on any form other input
> This patch enable to add javascript stuff on auto -generated forms(from xml forms) which execute the link with id (validate-link-id) when entre is pressed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira