4.5.9 (Dec 2007)

Java Improvement

Context Popup Changes

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.)

 

8694Abnormal movement of the focus after closing popupMenu
8695onBeforeActiveLost event does not occur after popupMenu closes
8696When popup closes, onBeforeActiveLost event always occurs
8794popup is not given focus when made visible - inconsistent with popupMenu
8871712-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.

Processing of event handlers has changed

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.

Right Click on component to invoke context popup.

Proposed new order of events for both popup and popupMenu.

  1. onBeforeActiveLost on invoker ( the component on which right mouse button was clicked)
  2. onActiveLost on Invoker
  3. 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".
Selecting menuItem of a popupMenu

Proposed new order of events

  1. onBeforeActiveLost on popup
  2. onActiveLost on popup
  3. onActiveGained on invoker
Clicking outside the bounds of the context popup
Proposed new order of events
  1. onBeforeActiveLost on popup
  2. onActiveLost on popup
  3. 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.

Pressing Escape Key when context popup is being displayed.
PopupMenu
For a popupMenu, the order of events will be as follows 
  1. onBeforeActiveLost on popup
  2. onActiveLost on popup
  3. 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.

  1. The component that has focus gets first chance to handle escape key
  2. If not handled by focused component, the popup will close with the following events.
  • onBeforeActiveLost on popup
  • onActiveLost on popup
  • onActiveGained on invoker
Pressing Tab Key when context popup is being displayed

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.
 
Menus within Menu Bar

Issue
In versions before 4.5.9, selecting a menuItem sent focus to the next focusable component, as defined with the Focus Manager. This is often a bit confusing. Focus will now be passed to the first focusable ancestor of the invoker.
 
Note:
Since menubars are not focusable by default, this could end up passing focus to the client panel. The workaround for this would be to set the menubar to be focusable or put the menubar in a panel that is focusable. By default the menubar is not focusable. This is something that was changed for accessibility, but only do if the application is "accessible."
 
Context popups on subcomponents

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.

A note on dynamic dialog or window resizing
When a pane is dynamically made visible in a dialog or window, the dialog or window (container) will automatically resize to show the contents of the visible pane. Please keep in mind that any manual user resizing of the container before the invisible pane is made visible (before the pane automatically resizes) will cause the container to not automcatically resize. This behavior is correct because the user’s sizing takes precedence over automatic container resizing when a pane is dynamically made visible. So, if the developer's application relies on dynamic resizing provoked by making a pane visible, the developer should use resizable=”false” so the user can not change the size of the container, thus allowing the container to always automtically resize according to the developer's intentions.

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.

Work Around
 
Defect 8851 - The information changed by AttributeChangeListener does not synchronize with ServerDOM

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)

 

6882Java Client: Using "px" as table row height has no effect
7004712-3701912 - Scrollbars on drop down lists not showing everything
7711Value selected by custom editor comboBox is not displayed in a quickEdit table
7955Cell and listItem ignore style precedence
7972alignVertical attribute of cell should be fully supported
7973Events can not be added to elements in stylesheets
8026NullPointerException by exchange of a row position
8032Value selected by comboBox editor will not update cell in a quickEdit table
8234Dialog's width and height do not automatically update after size change of child pane
8350Cutting text using Ctrl+X does not generate an onTextChange event
8351A mouse wheel becomes invalid after selecting menuitem
8369NPE occurs when an element with "selectedStyle" is added to UI Document
8448712-4905380 - InvalidXmlException when height of listItem given in "px"
8639Uncommitted IME text is not being cleared when handling a setText via onBeforeActiveLost
8694Abnormal movement of the focus after closing popupMenu
8695onBeforeActiveLost event does not occur after popupMenu closes
8696When popup closes, onBeforeActiveLost event always occurs
8707Unable to expand tree node when lockedcolumn is being used by treetable
8715onTextChange event does not occur by Undo/Redo
8727Text of widget is not displayed after a macro and xmodify is used to refesh table
8787712-5056583 - onMouseDrag event is not in schema documentation
8793Styling of widgets (except cell) when inside a table does not work
8794popup is not given focus when made visible - inconsistent with popupMenu
8795An unnecessary space is displayed in gridpane (gridlayout) when using "gridColumnSpan"
8822712-5072564 - horizontalFlowPane does not fill parent element vertically
8827FocusService's getCurrentFocus() cannot get combobox element
8836When comboBox has focus, the onCommand event of button by accessKey is fired two or more times
8837A mouse wheel becomes invalid after focusing comboBox
8839Link in treeTable does not restore the color of links after mouse over
8851The information changed by AttributeChangeListener does not synchronize with ServerDOM
8855When the update of a client occurs by a server response, ServerDOM does not synchronize
8858comboBox not set to correct width when width attribute is explicitly set
8863Unable to expand tree when lockedColumn is being used by treetable
8871712-5181390 712-5233153 - popMenu does not close after moving focus to another UI widget
8993712-5328616 - Right click will reselect selection state
9019Window re-centers itself after pane redraws