[jira] Created: (OFBIZ-4156) infinite lookup ajax calls if key enter on the page with layer lookup forms

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

[jira] Created: (OFBIZ-4156) infinite lookup ajax calls if key enter on the page with layer lookup forms

Nicolas Malin (Jira)
infinite lookup ajax calls if key enter on the page with layer lookup forms
---------------------------------------------------------------------------

                 Key: OFBIZ-4156
                 URL: https://issues.apache.org/jira/browse/OFBIZ-4156
             Project: OFBiz
          Issue Type: Bug
          Components: framework
    Affects Versions: SVN trunk
         Environment: jQuery
            Reporter: Leon
             Fix For: SVN trunk


If the rendered page has one lookup field which is configured as layer mode, at first open the lookup dialog and click the empty space of the page to hide it, then, key the "enter", then in the console log you will find there's lookup request logged. Try to key "enter" serveral times, you will get more lookup requests in the backend. In particular case, even if you key one "enter" in, it will send hundrends lookup calls. See attached "infinite-lookups.log" for the log details.

Cause:
In modifySubmitButton of fieldlookup.js, it bind the keypress event to whole "document" to call "lookupFormAjaxRequest" when "enter" keyin. And in "lookupFormAjaxRequest" function, it call  "modifySubmitButton" again after data load.

Resolution:
Move the keypress event bind operation to dialog open process and unbind it when dialog is closed.

See attached patch for code update.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-4156) infinite lookup ajax calls if key enter on the page with layer lookup forms

Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-4156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leon updated OFBIZ-4156:
------------------------

    Attachment: fieldlookup.patch
                infinite-lookups.log

1. hundreds lookup calls logged to console.log
2. patch for this issue

> infinite lookup ajax calls if key enter on the page with layer lookup forms
> ---------------------------------------------------------------------------
>
>                 Key: OFBIZ-4156
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4156
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: jQuery
>            Reporter: Leon
>             Fix For: SVN trunk
>
>         Attachments: fieldlookup.patch, infinite-lookups.log
>
>
> If the rendered page has one lookup field which is configured as layer mode, at first open the lookup dialog and click the empty space of the page to hide it, then, key the "enter", then in the console log you will find there's lookup request logged. Try to key "enter" serveral times, you will get more lookup requests in the backend. In particular case, even if you key one "enter" in, it will send hundrends lookup calls. See attached "infinite-lookups.log" for the log details.
> Cause:
> In modifySubmitButton of fieldlookup.js, it bind the keypress event to whole "document" to call "lookupFormAjaxRequest" when "enter" keyin. And in "lookupFormAjaxRequest" function, it call  "modifySubmitButton" again after data load.
> Resolution:
> Move the keypress event bind operation to dialog open process and unbind it when dialog is closed.
> See attached patch for code update.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-4156) infinite lookup ajax calls if key enter on the page with layer lookup forms

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-4156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leon updated OFBIZ-4156:
------------------------

    Attachment:     (was: fieldlookup.patch)

> infinite lookup ajax calls if key enter on the page with layer lookup forms
> ---------------------------------------------------------------------------
>
>                 Key: OFBIZ-4156
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4156
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: jQuery
>            Reporter: Leon
>             Fix For: SVN trunk
>
>         Attachments: infinite-lookups.log
>
>
> If the rendered page has one lookup field which is configured as layer mode, at first open the lookup dialog and click the empty space of the page to hide it, then, key the "enter", then in the console log you will find there's lookup request logged. Try to key "enter" serveral times, you will get more lookup requests in the backend. In particular case, even if you key one "enter" in, it will send hundrends lookup calls. See attached "infinite-lookups.log" for the log details.
> Cause:
> In modifySubmitButton of fieldlookup.js, it bind the keypress event to whole "document" to call "lookupFormAjaxRequest" when "enter" keyin. And in "lookupFormAjaxRequest" function, it call  "modifySubmitButton" again after data load.
> Resolution:
> Move the keypress event bind operation to dialog open process and unbind it when dialog is closed.
> See attached patch for code update.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-4156) infinite lookup ajax calls if key enter on the page with layer lookup forms

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-4156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leon updated OFBIZ-4156:
------------------------

    Attachment: fieldlookup.patch

new patch.

Besides to fix what have mentioned, also make some trivial improvements to modifySubmitButton method:
1. in jquery, "contains" is not a valid method of String prototype, use "indexOf(blah) != -1" instead
2. bypass the "javascript:..." link in lookup result table. Although it's not a good solution, it makes more sence than "to skip the first Entry of the row".

> infinite lookup ajax calls if key enter on the page with layer lookup forms
> ---------------------------------------------------------------------------
>
>                 Key: OFBIZ-4156
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4156
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: jQuery
>            Reporter: Leon
>             Fix For: SVN trunk
>
>         Attachments: fieldlookup.patch, infinite-lookups.log
>
>
> If the rendered page has one lookup field which is configured as layer mode, at first open the lookup dialog and click the empty space of the page to hide it, then, key the "enter", then in the console log you will find there's lookup request logged. Try to key "enter" serveral times, you will get more lookup requests in the backend. In particular case, even if you key one "enter" in, it will send hundrends lookup calls. See attached "infinite-lookups.log" for the log details.
> Cause:
> In modifySubmitButton of fieldlookup.js, it bind the keypress event to whole "document" to call "lookupFormAjaxRequest" when "enter" keyin. And in "lookupFormAjaxRequest" function, it call  "modifySubmitButton" again after data load.
> Resolution:
> Move the keypress event bind operation to dialog open process and unbind it when dialog is closed.
> See attached patch for code update.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (OFBIZ-4156) infinite lookup ajax calls if key enter on the page with layer lookup forms

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-4156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux closed OFBIZ-4156.
----------------------------------

    Resolution: Fixed
      Assignee: Jacques Le Roux

Thanks Leon,

Your (slightly modified) patch is in trunk at r1065056  

I just ketp javascript:set_ in the indexOf( instead of simply javascript:

Good catch on "the first Entry of the row"

> infinite lookup ajax calls if key enter on the page with layer lookup forms
> ---------------------------------------------------------------------------
>
>                 Key: OFBIZ-4156
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4156
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: jQuery
>            Reporter: Leon
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: fieldlookup.patch, infinite-lookups.log
>
>
> If the rendered page has one lookup field which is configured as layer mode, at first open the lookup dialog and click the empty space of the page to hide it, then, key the "enter", then in the console log you will find there's lookup request logged. Try to key "enter" serveral times, you will get more lookup requests in the backend. In particular case, even if you key one "enter" in, it will send hundrends lookup calls. See attached "infinite-lookups.log" for the log details.
> Cause:
> In modifySubmitButton of fieldlookup.js, it bind the keypress event to whole "document" to call "lookupFormAjaxRequest" when "enter" keyin. And in "lookupFormAjaxRequest" function, it call  "modifySubmitButton" again after data load.
> Resolution:
> Move the keypress event bind operation to dialog open process and unbind it when dialog is closed.
> See attached patch for code update.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.