UIX Developer's Guide
Go to Table of Contents
Contents
Go to previous page
Previous
Go to next page
Next

Appendix: Changes Since JDeveloper 9.0.2

This appendix describes changes to UIX since JDeveloper 9.0.2 (which corresponds to UIX 2.0.21 through UIX 2.1.7). It includes the following sections:

Improvements to the Generic UIX Framework

The generic UIX framework includes improvements in the following areas:

Partial-Page Rendering

Many web pages allow the end user to perform actions which cause a specific portion of the page to be updated. For example, clicking a button can add a new row to a table of data. Or, by selecting an item from a list of values, other components in the page may be hidden, shown, or populated with new values based on the user's selection. These types of actions are different from the typical navigation case in which the user leaves the current page and moves to a completely new page. Instead, after performing such actions, the same page is redisplayed but with limited modifications. Currently, UIX-based applications must implement such functionality either by writing custom JavaScript code or by performing a full page refresh. Both of these solutions suffer from problems.

By writing custom JavaScript code, applications can offer a more highly interactive user experience. However, requiring each application to implement such functionality is an inefficient use of development resources and is likely to be error prone. Also, pure client-side JavaScript solutions can only be used in a limited number of cases, since in general these solutions require knowledge of all possible values up front. For example, when updating dependent fields in response to a user selection, all possible values for the dependent fields must be sent to the browser when the page is first rendered. This results in larger page sizes and slower page generation times, since it is often necessary to query data which might not ever be seen by the end user.

The simplest solution is for the application to perform a full page refresh in response to the user action. Although this solution is much easier to implement, performing a complete refresh is not very efficient. Even when only a small portion of the page is affected by a user action, a full page refresh requires that the entire page be regenerated, including any "chrome" or surrounding contents which remain unchanged. As a result, the user is often left staring at a blank page until the full render completes. To make matters worse, after the new page is loaded, the default browser behavior is to scroll back to the top of the page. As a result, the user loses context and is distracted from the task at hand.

Partial page rendering provides a compromise which offers some of the benefits of both of these solutions while avoiding some of the more significant drawbacks. When the user performs some action which invokes a partial page render, a request is made to the application which indicates that a specific portion of the page needs to be re-rendered. The application can then regenerate just this portion of the page and send this new partial content to the browser to be merged back into the page.

Partial page rendering has several advantages over other solutions:

UIX 9.0.3 and later delivers this functionality without requiring the application developer to perform an excessive amount of work. In addition to providing the core technology which makes partial page rendering possible, UIX 9.0.3 and later enhances several existing components, such as the UIX TableBean and HideShowBean, to transparently take advantage of partial page rendering. More components will come in future releases. Partial Rendering is supported for Internet Explorer 5.5 or later, as well as Mozilla 1.0 and Netscape 7.0, but gracefully falls back to full-page renders on older browsers.

uiXML-Struts Integration

The Struts framework has become one of the most popular frameworks for building J2EE web applications. While Struts developers often use JSPs for their pages, Struts supports the use of alternative view technologies. UIX 9.0.3 and later provides a set of extensions that lets you use uiXML for part or all of your Struts applications, and lets you use completely standard Struts Actions, ActionForm beans, and configuration files to control your uiXML-based application. See the new UIX Developer's Guide chapter, Using uiXML with Struts, for the details.

XML Configuration File

The new uix-config.xml file lets developers create a set of Configuration objects without writing a line of code--and update configuration properties in the field without recompiling code. This feature is only available to developers using Servlet 2.1 or later, so applications deployed on Apache JServ must continue using Java code.

The uix-config.xml file, which is placed in the standard WEB-INF directory, also allows the configuration of several properties not actually set on Configuration objects. Most importantly, it supports automatic registration of UIExtensions and UIT template libraries. It also provides straightforward access to several debugging features--like nicely indented HTML--that were not easily available in 9.0.2. For a full description of the features and format of this file, see the revised Configuration chapter of the UIX Developer's Guide.

Improved Support for JavaBeans

The UIX data-binding architecture is now much more JavaBeans-friendly. This change is pervasive, and includes the Java API, the uiXML interface, and the UIX JSP tag library.

Any place where a uiXML or JSP tag formerly required a DataObject, developers can pass a JavaBean instance, and UIX automatically introspects methods (and public variables) to discover properties. UIX also automatically supports objects that implement the java.util.Map interface (including HashMap and Hashtable). Any place where a uiXML or JSP tag formerly required a DataObjectList, developers can pass either an array or java.util.List (including ArrayList and Vector), and UIX transparently transforms that object into a DataObjectList.

The process is recursive, so bean properties that are themselves beans are automatically transformed into DataObjects containing DataObjects, and arrays of beans are automatically transformed into DataObjectLists.

Finally, MethodDataProviders no longer need to return DataObjects. They can return any sort of object, and UIX performs adapting as indicated above.

UIX caches a great deal of the more expensive objects required for this automatic introspection, so performance is generally reasonable, but UIX provides features for developers to optimize the performance of particularly important data sources.

For more information on this new feature, see Getting Easier: Binding to Beans in the Data Binding chapter of the UIX Developer's Guide.

New UIX Components

The new <lovInput> and <listOfValues> components make it much easier to raise a powerful List Of Values, and are integrated with Partial Page Rendering.

A trio of new components: <sideBar>, <styledList>, and <styledItem> give you a much richer set of options for building up the "side navigation" area of your page than the old <sideNav> control offered. <hideShow> also sports a new "selected" attribute for use inside <sideBar>.

<hideShow> also supports a new <prompt> child that lets you replace the default label of the hide-show control.

<pageLayout> has another six slots for inserting content:

<pageLayout> also now has a messageType attribute for building messaging pages.

<switcher> supports a <default> child that makes some common cases much easier to write.

A <displayException> element can be used inside of <try>/<catch> to give you more information for debugging problems.

Formatted Text Support

Message text can now contain a limited set of HTML formatting tags. This is supported only for text displayed in the messageBox and text displayed as message and tip attributes in the UIX message beans.

To signal that a given message includes formatting information, the message must begin with <html> and end with </html>. So, for instance, if you wished to make one word in a sentence bold, the message would read:


   String messageString = "<html>One word <b>here</b> is bold.</html>";

A new <formattedText> component lets you get at this functionality anywhere on a page. It doesn't require the <html> start and finish, though including these won't cause harm.

The following HTML elements, attributes, and entities are supported:

Elements, attributes, and entities not on this list will automatically be stripped from the content and ignored. This helps to ensure that your formatted text can properly rendered on non-browser devices, and it eliminates the risk of security holes that can be present in output code that passes through raw HTML. No guarantee is made that the input HTML will be output without modification. For example, paragraph and list-item elements will always be closed even if left open in the input text. Other HTML markup may be replaced with output more appropriate to the current look-and-feel or user agent.

New <media> Control

The media control displays media content, such as audio, video, or image in a player embedded in the user agent. The media control displays the media specified by the source attribute in the appropriate media player. If a particular media player is desired, it can be specified using the player attribute. The media control attempts to intelligently handle two tricky aspects of cross-platform media display: determining the best player to display the media and sizing the media player.

The media control attempts to pick the appropriate media player using the following steps:

  1. If the primary MIME type of the content is "image," the built in user-agent support is used.
  2. If a media player is specified by the player attribute and that player is available on the user agent and can display the media resource, that player is used.
  3. If one player is especially good at playing the media resource and that player is available on the user agent, that player is used.
  4. If one player is especially dominant on the user agent and that player can play the media resource, that player is used.

Printable Page Support

UIX 9.0.3 and later includes support for a new concept of "facets." A facet is a variant of a "look-and-feel." One of the facets supported in 2.1 is the "printable" facet, which optimizes output for printing by removing much of the "chrome" around the edges of a page. Facets can be set programatically or set declaratively from within uiXML:

    <button ctrl:event="printMe"/>

    ...
  <handlers>
    <event name="printMe">
      <showFacet name="printable"/>
    </event>    
  </handlers>

In addition, UIX 9.0.3 and later fixes a problem that affected the printability of standard UIX pages.

Support for a Wider Set of User Agents

PocketPC is now a supported platform. Not all components are supported, nor are all attributes of supported components. The UIX Element Reference indicates unsupported attributes and components.

MacOS Internet Explorer 5 rendering is greatly improved, and this platform is now fully supported.

Rendering quality in right-to-left languages is, but this is as yet supported only for Internet Explorer on Windows.

<train> Component Is Now Interactive

The <train> component is now interactive. Specifically, it now supports "value" and "maxVisited" attributes. When set, these will allow users to click on specific train links to jump backwards and forwards among steps. The <train> delivers the same "goto" event as <navigationBar>, so you can reuse your event handlers for this new purpose.

New <importScript> Component

The new <importScript> component lets you ensure that a required UIX Javascript function is loaded. It takes a single parameter, which is a whitespace-separated list of function names. For example:

  <importScript names="openWindow()"/>
  <button text="Show Window" onClick="openWindow(....)"/>

New <agent> Bound Value

The <agent> bound value lets you conditionally change your pages based on the current user agent. For example:

  <switcher>
    <boundAttribute name="childName">
      <if>
        <agent os="mac"/>
        <fixed text="MacContent"/>
      </if>
    </boundAttribute>
    <case name="MacContent">
      <styledText text="You've got a MacOS machine."/>
    </case>
    <default>
      <styledText text="You aren't using a MacOS machine."/>
    </default>
  </switcher>

Additional <decimal> Validater Functionality

The uiXML <decimal> element now supports setting "minValue", "maxValue", "maxPrecision", and "maxScale" attribute to limit the values entered by users.

Miscellaneous

Improvements to BC4J uiXML

BC4J UIX includes improvements in the following areas:

New <bc4j:rowStamp> Element

UIX now makes it much easier to iterate through rows of a view object. The <bc4j:rowStamp> element can be placed inside of a <bc4j:viewObjectScope>, and will stamp out its contents once per row:


  <bc4j:viewObjectScope name="yourVO">
    <bc4j:rowStamp>
      One of these per row!
    </bc4j:rowStamp>
  </bc4j:viewObjectScope>

This was the most requested enhancement for BC4J uiXML.

New <bc4j:attrValue> Element

It is now possible to bind to an attribute value without using <bc4j:attrScope>. Now you can bind two attributes of one UIX element to two different attributes of a BC4J row:


  <link>
    <boundAttribute name="text">
      <bc4j:attrValue name="textAttr"/>
    </boundAttribute>
    <boundAttribute name="destination">
      <bc4j:attrValue name="urlAttr"/>
    </boundAttribute>
  </link>

This was the second most requested enhancement for BC4J uiXML.

New <bc4j:option> and <bc4j:optionList> Elements

UIX now takes advantage of <bc4j:rowStamp> and <bc4j:attrValue> and includes new <bc4j:option> and <bc4j:optionList> elements. These new elements make it much easier to build choices and lists that dynamically load the available options from a view object. For example:

  <bc4j:choice attrName="job">
    <bc4j:contents>
      <bc4j:optionList voName="JobListVO"
                       attrName="jobId"
                       textAttrName="jobName"/>
    </bc4j:contents>
  </bc4j:choice>

interMedia Support

UIX 9.0.3 and later improves the BC4J data binding by adding support for BC4J interMedia. This allows rich multimedia content to be stored directly in the database and displayed in a UIX page via BC4J interMedia domains. UIX's built-in support adds some new uiXML elements specifically for image, audio, and video types. See the new UIX Developers' Guide chapter, Media, for a detailed description of this feature.

Support for CLOB columns

CLOB columns are now correctly displayed and edited.

Improved Integration with Java Code

In UIX 9.0.2, it was difficult to write custom Java code in data providers and event handlers that interacted meaningfully with BC4J uiXML. Two new classes, UIBindingUtils and ServletBindingUtils, make this much easier. With these classes, you can go from a RenderingContext or BajaContext to the currently scoped AttributeDef, Row, ViewObject, or ApplicationModule.

Support for CPX Data Definition Files

UIX now supports the new .cpx data definition file format. Developers can set a new definition attribute on <bc4j:rootAppModuleDef> to use a named definition (instead of setting configName and defFullName).

Improved Localization Support

UIX now does a much better job of using the correct decimal and grouping separators for parsing and formatting numbers.

UIX also does a much better job of using the correctly localized and customized error messages. However, developers who wish to take advantage of this feature must change any <catch> blocks away from the old form:

<try>
  ...
  <catch>
    <header messageType="error">
      <boundAttribute name="text">
        <contextProperty select="ui:currentThrowable"/>
      </boundAttribute>
    </header>
  </catch>
</try>
to:
<try>
  ...
  <catch>
    <displayException/>
  </catch>
</try>

Support for "Equality" Searches

The <bc4j:findByExample> element only supported SQL LIKE comparisons. A new comparison attribute can be set to equals to use EQUALITY comparison.

Improvements to uiXML

Most of the uiXML improvements have already been covered above, but other improvements include:

Improvements to UIX JSP

The UIX JSP tags now support a much higher percentage of the functionality formerly limited to XML and Java, including:

Other improvments include:

Despite all this new functionality, UIX maintains considerable backwards-compatibility. However, some behaviors of the 9.0.2 tag library could not be preserved (though the functionality is entirely a superset!) Specifically, the value of the id attribute may no longer contain whitespace.