Menu

#1923 You can press New button a lot of times

Core
closed-fixed
UI Swing (244)
9
2010-02-12
2009-06-01
Teo Sarca
No

== Test case ==
Open a new window. Press "New" and a new record is created (check that the number from bottom right corner is incremented). Do not hit save and hit New again and again and again and you will get a lot of "new" records and also the counter from bottom right is incremented.

Best regards,
Teo Sarca - www.arhipac.ro

Discussion

  • Carlos Ruiz

    Carlos Ruiz - 2009-06-01
    • milestone: --> Core
     
  • Tobias Schöneberg

    Hi,
    I'm going to disable the "New" button if the "Save" and "Undo"-Buttons are enabled. The should solve the issue.
    WDYT?

    Regards
    tobi

     
  • Tobias Schöneberg

    • assigned_to: nobody --> tobi42
     
  • Tobias Schöneberg

    Oops, always enabling the new button has been done on purpose, see FR [ 2691063 ]. However, it only works if there are no mandatory fields in the current record that havent been filled yet..

     
  • Tobias Schöneberg

    committed a fix in revision 9914

     
  • Tobias Schöneberg

    • status: open --> pending
     
  • Carlos Ruiz

    Carlos Ruiz - 2009-08-13

    Hi Tobi, tested your patch and swing is working better.

    But still we have this problem in windows like "Cash Journal" that doesn't have mandatory fields.

    I think a better approach is like Heng Sin implemented in zkwebui.
    In zkwebui the "New" button is enabled AFTER the record is touched, so you can't press "New" in "Cash Journal" unless you touch or save the record.

    Regards,

    Carlos Ruiz

     
  • Carlos Ruiz

    Carlos Ruiz - 2009-08-13
    • status: pending --> open
     
  • Tobias Schöneberg

    Carlos remarked that the "New" button should be enabled only after a change has been made to the new record. This is how it has been solved in zkWebUI.

    I assume this could be done by listening to DataEvents, but I didn't check yet.

     
  • Tobias Schöneberg

    • status: open --> pending
     
  • Carlos Ruiz

    Carlos Ruiz - 2009-08-13
    • status: pending --> open
     
  • Sergio Trillo Lozano

    Hi Carlos,

    It is still happening.

    I have found the following:

    In the class: /client/src/org/compiere/apps/APanel.java

    At line 1133 there was:

    aNew.setEnabled(((inserting && changedColumn>0) || !inserting) && insertRecord);

    I don't know why is enabling the button in the case of you are inserting and you have changed something. I think this could be the malfunction.

    I have tried putting this other sentence and It seems to work fine:

    aNew.setEnabled(!inserting && insertRecord);

    What may I do, now?

    Sergio,

     
  • Sergio Trillo Lozano

    • assigned_to: tobi42 --> globalqss
     
  • Carlos Ruiz

    Carlos Ruiz - 2010-01-29

    Sergio - I just tested with Cash Journal and it's working as expected.

    The idea is that New button acts now like a "Save and Create New". But there was a bug (it seems solved now) that allowed to push new button without saving anything.

    It seems solved now.

    Regards,

    Carlos Ruiz

     
  • Carlos Ruiz

    Carlos Ruiz - 2010-01-29
    • status: open --> pending-fixed
     
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending-fixed --> closed-fixed
     

Log in to post a comment.