4.5.9 (Dec 2007)
Java Improvement
Overview
One of the goals of this MR is to bring consistency to the use of popups. This section outlines the order of events that occur after a particular action. The following bugs identify several areas of inconsistencies with the use of the popups and popupMenus as context popups that were addressed in this maintenance release. (See the end of this 4.5.9 MR note for a full list of fixed defects.)
8694 | Abnormal movement of the focus after closing popupMenu |
8695 | onBeforeActiveLost event does not occur after popupMenu closes |
8696 | When popup closes, onBeforeActiveLost event always occurs |
8794 | popup is not given focus when made visible - inconsistent with popupMenu |
8871 | 712-5181390 712-5233153 - popMenu does not close after moving focus to another UI widget |
This section outlines new functionality, important notes on the use of popups and popupMenus, and the order that events fire after a particular action takes place.
The processing of event handlers has changed; invalid syntax that once worked properly - for instance spaces between the container and the call - will no longer work. Error reporting has improved.
Proposed new order of events for both popup and popupMenu.
- onBeforeActiveLost on invoker ( the component on which right mouse button was clicked)
- onActiveLost on Invoker
- onActiveGained on context popup (either popup or popupMenu)
Notes:
- The onBeforeActiveLost() allows for potential validation on the invoking component before bringing up the popup or popupMenu.
- The activeGained on the context popup, allows focus to be sent to any component when using a popup.
- Since focus is being taken away from the invoker, this means that the selection in a textField will also be taken away. Bug 8794, states that they wanted selection to stay. This can be done by setting the attribute of the textField to "always".
Proposed new order of events
- onBeforeActiveLost on popup
- onActiveLost on popup
- onActiveGained on invoker
- onBeforeActiveLost on popup
- onActiveLost on popup
- onActiveGained on selected component if focusable
This means that if you click into a textField while a context popup is visible, the popup will go away and the textField will gain focus and be selected. This is a change from how it worked before Platform 4.5.9. Previously, in order to select the textField, you had to click twice. Once to dismiss the context popup, and a second time to select the textField.
For a popupMenu, the order of events will be as follows
- onBeforeActiveLost on popup
- onActiveLost on popup
- onActiveGained on invoker
Popup
Previously, nothing happened when pressing escape when the context popup is defined as popup. Version 4.5.9 has the following behavior.
- The component that has focus gets first chance to handle escape key
- If not handled by focused component, the popup will close with the following events.
- onBeforeActiveLost on popup
- onActiveLost on popup
- onActiveGained on invoker
PopupMenu
For a context popup defined as a poupMenu, pressing the tab key has no effect, which is the desired behavior.
Popup
For popup in builds before 4.5.9, focus could be transferred away from the popup when pressing the tab key. This is the emphasis of bug 8871. This has been changed in 4.5.9 to keep the tabbing within the popup when it is being used as a context popup.
Issue
Issue
In previous builds to 4.5.9 there was an issue with focus when using context popups on a subcomponent such as headers or columns of a table. In 4.5.9 focus is sent to next focusable component.
Fix
The same logic proposed for menubar works here as well, passing focus to the first focusable ancestor of the invoker. So in the case of the context menu on the header or column, this would pass focus back to the table.
More Java Improvements
Selection behavior using right click of mouse
The following outlines the improved right-click selection behavior.
- Any right mouse click within a selection of cells, rows, or columns, should not result in the selection being changed, but should show the context menu. This is regarless of whether the control or shift keys are down.
- A right mouse click outside the current selections should select the single cell, row or column and bring up the context menu.
- Ctrl-Right mouse Click or Shift-Right mouse click, should add rows, columns, or cells, to the selection if the occurs outside the current selections.
Combo box's width respects explicit setting
If a developer explicitly defines the combo box width, then the combo box width will render with that width regardless of the length of the contents of the largest list item.
Window improvement when using attribute centered="true"
When using centered="true", now, window will not re-center itself everytime window is redrawn.
Styling of heavy weight components in table (XAL) have been improved
Styling such as font and background color inside heavy-weight components now render correctly. This issue was present in XAL only.
onMouseDrag is now fully supported
onMouseDrag has been added to the documentation for components such as panels, widgets and cell, listItem.
listItem and row height now support "px" in XAL
It is now possible to specify row and listItem height using "px" when using the XAL syntax.
Ctrl-X now generates an onTextChange event
The onTextChange event will now fire when Ctrl-X (cutting of text) is used.
Events can now be stored in Style Sheets
It is now possible to add events to elements in style sheets.
For example,
stylesheet.xss:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <styleSheet> <style applyTo="cell"> <normal fontItalic="true" onCreate="macro://addRow.execute('Create')" onDoubleClick="macro://addRow.execute('DoubleClick')" onMouseDown="macro://addRow.execute('MouseDown')" onMouseUp="macro://addRow.execute('MouseUp')"/> </style> </styleSheet>
Contents of cells inside table can now be aligned vertically
Support has been added to allow table cell contents to be aligned vertically. The name of this attribute for each syntax is, "alignVertical" (NXML), and "verticalAlignment" (XAL). This attribute has the following three values: "top|bottom|center". Details of this attribute have been added to the schema documentation.
To allow a workaround, we have exposed (undocumented class) com.nexaweb.client.xml.ThreadBasedSynchronizer. Where a change or changes to the UI DOM are needed, surround them with a call to push synchronization state and pop synchronizations state. Pop MUST be called when push is called - example:
public void onAttributeSet(AttributeChangeEvent arg0) { try { ThreadBasedSynchronizer.pushSynchronizationState(true); // change some attributes... } finally { ThreadBasedSynchronizer.popSynchronizationState(true); } }
Defects Resolved (Java)
6882 | Java Client: Using "px" as table row height has no effect |
7004 | 712-3701912 - Scrollbars on drop down lists not showing everything |
7711 | Value selected by custom editor comboBox is not displayed in a quickEdit table |
7955 | Cell and listItem ignore style precedence |
7972 | alignVertical attribute of cell should be fully supported |
7973 | Events can not be added to elements in stylesheets |
8026 | NullPointerException by exchange of a row position |
8032 | Value selected by comboBox editor will not update cell in a quickEdit table |
8234 | Dialog's width and height do not automatically update after size change of child pane |
8350 | Cutting text using Ctrl+X does not generate an onTextChange event |
8351 | A mouse wheel becomes invalid after selecting menuitem |
8369 | NPE occurs when an element with "selectedStyle" is added to UI Document |
8448 | 712-4905380 - InvalidXmlException when height of listItem given in "px" |
8639 | Uncommitted IME text is not being cleared when handling a setText via onBeforeActiveLost |
8694 | Abnormal movement of the focus after closing popupMenu |
8695 | onBeforeActiveLost event does not occur after popupMenu closes |
8696 | When popup closes, onBeforeActiveLost event always occurs |
8707 | Unable to expand tree node when lockedcolumn is being used by treetable |
8715 | onTextChange event does not occur by Undo/Redo |
8727 | Text of widget is not displayed after a macro and xmodify is used to refesh table |
8787 | 712-5056583 - onMouseDrag event is not in schema documentation |
8793 | Styling of widgets (except cell) when inside a table does not work |
8794 | popup is not given focus when made visible - inconsistent with popupMenu |
8795 | An unnecessary space is displayed in gridpane (gridlayout) when using "gridColumnSpan" |
8822 | 712-5072564 - horizontalFlowPane does not fill parent element vertically |
8827 | FocusService's getCurrentFocus() cannot get combobox element |
8836 | When comboBox has focus, the onCommand event of button by accessKey is fired two or more times |
8837 | A mouse wheel becomes invalid after focusing comboBox |
8839 | Link in treeTable does not restore the color of links after mouse over |
8851 | The information changed by AttributeChangeListener does not synchronize with ServerDOM |
8855 | When the update of a client occurs by a server response, ServerDOM does not synchronize |
8858 | comboBox not set to correct width when width attribute is explicitly set |
8863 | Unable to expand tree when lockedColumn is being used by treetable |
8871 | 712-5181390 712-5233153 - popMenu does not close after moving focus to another UI widget |
8993 | 712-5328616 - Right click will reselect selection state |
9019 | Window re-centers itself after pane redraws |