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

Error while press F9(change quantity) in webpos

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: 14.12.01, 12.04.06, 16.11.01
    • Component/s: webpos
    • Labels:
      None
    • Sprint:
      Bug Crush Event - 21/2/2015, Community Day 1 - 2015

      Description

      When i click F9 to change quantity input of product, it increase 1 but when I press F9 key, the quantity of product increase 13.

      1. OFBIZ-5588.patch
        2 kB
        Mridul Pathak

        Activity

        Hide
        hoandv Hoan Dang Van added a comment -

        I tested. All function of F1- F11, up and down key run 13 time. I think cause is function bind() in jquery .
        I wasn't $(document).bind(type, data, fnCode); line in definition WebPosHotkeys

        and edited and all thing run good.

        function activateHotKeys() {

        WebPosHotkeys.bind("keydown", "f1", productToSearchFocus, "productToSearchFocus()", "$

        {uiLabelMap.WebPosShortcutF1}

        ");

        WebPosHotkeys.bind("keydown", "f2", partyToSearchFocus, "partyToSearchFocus()", "$

        {uiLabelMap.WebPosShortcutF2}

        ");
        WebPosHotkeys.bind("keydown", "f3", payCash, "payCash()", "$

        {uiLabelMap.WebPosShortcutF3}

        ");
        WebPosHotkeys.bind("keydown", "f4", payCheck, "payCheck()", "$

        {uiLabelMap.WebPosShortcutF4}

        ");
        WebPosHotkeys.bind("keydown", "f5", payGiftCard, "payGiftCard()", "$

        {uiLabelMap.WebPosShortcutF5}

        ");
        WebPosHotkeys.bind("keydown", "f6", payCreditCard, "payCreditCard()", "$

        {uiLabelMap.WebPosShortcutF6}

        ");
        WebPosHotkeys.bind("keydown", "f7", payFinish, "payFinish()", "$

        {uiLabelMap.WebPosShortcutF7}

        ");
        WebPosHotkeys.bind("keydown", "f8", itemQuantityFocus, "itemQuantityFocus()", "$

        {uiLabelMap.WebPosShortcutF8}

        ");
        WebPosHotkeys.bind("keydown", "f9", incrementItemQuantity, "incrementItemQuantity()", "$

        {uiLabelMap.WebPosShortcutF9}

        ");
        WebPosHotkeys.bind("keydown", "f10", decrementItemQuantity, "decrementItemQuantity()", "$

        {uiLabelMap.WebPosShortcutF10}

        ");
        WebPosHotkeys.bind("keydown", "f11", emptyCart, "emptyCart()", "$

        {uiLabelMap.WebPosShortcutF11}

        ");
        WebPosHotkeys.bind("keydown", "up", keyUp, "keyUp()", "$

        {uiLabelMap.WebPosShortcutKeyUp}

        ");
        WebPosHotkeys.bind("keydown", "down", keyDown, "keyDown()", "$

        {uiLabelMap.WebPosShortcutKeyDown}

        ");
        keypress();

        updateHotKeys();
        }
        function keypress(){
        $(document).ready(function() {
        $(document).bind('keydown', 'f1', function()

        { productToSearchFocus(); e.preventDefault(); return false; }

        );
        });
        // function of f2.....f11,up and down key is similar
        }

        Show
        hoandv Hoan Dang Van added a comment - I tested. All function of F1- F11, up and down key run 13 time. I think cause is function bind() in jquery . I wasn't $(document).bind(type, data, fnCode); line in definition WebPosHotkeys and edited and all thing run good. function activateHotKeys() { WebPosHotkeys.bind("keydown", "f1", productToSearchFocus, "productToSearchFocus()", "$ {uiLabelMap.WebPosShortcutF1} "); WebPosHotkeys.bind("keydown", "f2", partyToSearchFocus, "partyToSearchFocus()", "$ {uiLabelMap.WebPosShortcutF2} "); WebPosHotkeys.bind("keydown", "f3", payCash, "payCash()", "$ {uiLabelMap.WebPosShortcutF3} "); WebPosHotkeys.bind("keydown", "f4", payCheck, "payCheck()", "$ {uiLabelMap.WebPosShortcutF4} "); WebPosHotkeys.bind("keydown", "f5", payGiftCard, "payGiftCard()", "$ {uiLabelMap.WebPosShortcutF5} "); WebPosHotkeys.bind("keydown", "f6", payCreditCard, "payCreditCard()", "$ {uiLabelMap.WebPosShortcutF6} "); WebPosHotkeys.bind("keydown", "f7", payFinish, "payFinish()", "$ {uiLabelMap.WebPosShortcutF7} "); WebPosHotkeys.bind("keydown", "f8", itemQuantityFocus, "itemQuantityFocus()", "$ {uiLabelMap.WebPosShortcutF8} "); WebPosHotkeys.bind("keydown", "f9", incrementItemQuantity, "incrementItemQuantity()", "$ {uiLabelMap.WebPosShortcutF9} "); WebPosHotkeys.bind("keydown", "f10", decrementItemQuantity, "decrementItemQuantity()", "$ {uiLabelMap.WebPosShortcutF10} "); WebPosHotkeys.bind("keydown", "f11", emptyCart, "emptyCart()", "$ {uiLabelMap.WebPosShortcutF11} "); WebPosHotkeys.bind("keydown", "up", keyUp, "keyUp()", "$ {uiLabelMap.WebPosShortcutKeyUp} "); WebPosHotkeys.bind("keydown", "down", keyDown, "keyDown()", "$ {uiLabelMap.WebPosShortcutKeyDown} "); keypress(); updateHotKeys(); } function keypress(){ $(document).ready(function() { $(document).bind('keydown', 'f1', function() { productToSearchFocus(); e.preventDefault(); return false; } ); }); // function of f2.....f11,up and down key is similar }
        Hide
        mridul.pathak Mridul Pathak added a comment -

        Seems like an issue with JQuery hotkeys API - http://forum.jquery.com/topic/problem-with-bind-keydown-in-jquery-1-4-2.

        Attached patch is an extended version of Hoan's approach to cover all the cases. Should be able to fix the issue temporarily.

        Show
        mridul.pathak Mridul Pathak added a comment - Seems like an issue with JQuery hotkeys API - http://forum.jquery.com/topic/problem-with-bind-keydown-in-jquery-1-4-2 . Attached patch is an extended version of Hoan's approach to cover all the cases. Should be able to fix the issue temporarily.
        Hide
        mridul.pathak Mridul Pathak added a comment -

        Fixed in trunk r1668279, 14.12 r1668290, 12.04 r1668300.

        Thanks Hoan for reporting the issue and pointing towards the fix.

        Show
        mridul.pathak Mridul Pathak added a comment - Fixed in trunk r1668279, 14.12 r1668290, 12.04 r1668300. Thanks Hoan for reporting the issue and pointing towards the fix.

          People

          • Assignee:
            mridul.pathak Mridul Pathak
            Reporter:
            hoandv Hoan Dang Van
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development

                Agile