Make Swing CTextArea consistent with ZK

Description

In the swing client if we press enter on a Text field (e.g. Document Note) it inserts a new line, while on ZK pressing ENTER fires a change event and allows to save the change. On ZK Shift+Enter is used to enter a new line. The default behaviour of Swing client can be very confusing due to the following:

  • Unlike all other fields, we can not save the changes in Text field by pressing Enter and F4, which causes confusion as many times the user would press Enter and F4 and leave the record only to return back and find it was not saved.

  • The only easy way to get the Save button after changing Text field is to click at any other field, or click the Save button, this requires use of a mouse and slows the data entry.

  • ZK and Swing clients should have the similar behaviour for such fields

  •  

    •  

      • NOTE *** I am attaching a VERY UGLY patch but it can be used as a starter, it might be the only way of doing or it might be the worst way of doing this. Please test and give feedback. If this can be integrated into head then I will also do similar for TAB (to make tab change field and shift+TAB insert a real tab)

Environment

None

Attachments

1

Activity

Hesham Ahmed
July 18, 2012 at 6:31 PM

https://bitbucket.org/hahmed/idempiere/changeset/1c201bf21799

  • Migration script numbering Fixed

  • Forgot to add LastMigrationScriptApplied update, done

  • boolean value read from sysconfig

  • Enter should enable save (which marks the update done) since this is how all other fields behave. After pressing enter if we press F4 or switch tabs/records the value is saved.

  • This is something we need to discuss, since we can not use Shift+Tab as its used for navigation. Maybe its time to consider rich text formatted text area! On the second note, I have not seen much need of entering tab in description/docnote fields etc.

Carlos Ruiz
July 18, 2012 at 1:28 PM

Hi Hahmed, thanks a lot for your work.

Peer review recommendations:

  • numbering of migration scripts must be 851

  • UPDATE AD_System.LastMigrationScriptApplied must be added manually at the end of migration script

  • Instead of reading the sysconfig as String it can be read as boolean with default as false this way:

    boolean taBehaviour = MSysConfig.getBooleanValue("SWING_OVERRIDE_TEXT_AREA_BEHAVIOUR", false, Env.getAD_Client_ID(Env.getCtx())); if (taBehaviour)
  • On my tests Enter is enabling the save button and Shift+Enter insert a line (fine, perhaps Enter must move to next field?)

  • I was not able to insert a Tab on the description field on Sales Order, Shift+Tab is navigating to the previous field and Tab to the next field (I see this is zkwebui behavior, but I feel like we lose the ability to add Tabs on description fields, is that desired? or better we add that capability to zkwebui?)

Regards,

Carlos Ruiz

Hesham Ahmed
July 16, 2012 at 9:32 AM
Carlos Ruiz
July 11, 2012 at 9:25 PM
Fixed

Details

Assignee

Reporter

Components

Priority

Created June 27, 2012 at 6:01 PM
Updated March 13, 2014 at 2:19 PM
Resolved July 18, 2012 at 9:12 PM