ICEfaces
  1. ICEfaces
  2. ICE-5379

Automatic ID assignment for efficient page update

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha2
    • Fix Version/s: 2.0-Alpha3, 2.0.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces 2.0
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.)

      Description

      By default, JSF 2.0 writes a minimum number of IDs to the markup output, particularly for output components (IDs are used to track form input fields, but only Ajax page update generally makes use of IDs on other elements). IDs should be provided on a wider variety of elements so that DOM diff based updates can be targeted to the browser markup.

        Activity

        Hide
        Ted Goddard added a comment -

        This is not currently detected as a problem in the auction demo as that demo already contains many manually added IDs in the markup. These IDs were added for testing and organizational purposes, but they are also being effectively used by the DOM diff updates.

        Show
        Ted Goddard added a comment - This is not currently detected as a problem in the auction demo as that demo already contains many manually added IDs in the markup. These IDs were added for testing and organizational purposes, but they are also being effectively used by the DOM diff updates.
        Hide
        Ted Goddard added a comment -

        The current prototype makes use of a SystemEvent listener to modify the automatically generated IDs on outputText components so that their ID is automatically written to the output markup.

        Show
        Ted Goddard added a comment - The current prototype makes use of a SystemEvent listener to modify the automatically generated IDs on outputText components so that their ID is automatically written to the output markup.
        Hide
        Ted Goddard added a comment -

        PostAddToViewEvent for the following classes are classes are detected and the "j_id*" is modified to "_id*":

        (source instanceof UIOutput) ||
        (source instanceof HtmlDataTable) ||
        (source instanceof HtmlPanelGroup) ||
        (source instanceof UICommand) ) && (!UIOutput.class.equals(source.getClass())) );

        This causes the base component implementation to write the id to the output. The above list will be expanded upon further testing.

        This feature is configurable through the web.xml parameter "org.icefaces.autoid" true/false (default to true). Selective "autoid" behavior (per component class) is likely not necessary, as manual configuration at that level could be performed by directly assigning IDs in the page. It may be desirable to have autoId configuration on a per-page basis through the <ice:config> tag.

        Show
        Ted Goddard added a comment - PostAddToViewEvent for the following classes are classes are detected and the "j_id*" is modified to "_id*": (source instanceof UIOutput) || (source instanceof HtmlDataTable) || (source instanceof HtmlPanelGroup) || (source instanceof UICommand) ) && (!UIOutput.class.equals(source.getClass())) ); This causes the base component implementation to write the id to the output. The above list will be expanded upon further testing. This feature is configurable through the web.xml parameter "org.icefaces.autoid" true/false (default to true). Selective "autoid" behavior (per component class) is likely not necessary, as manual configuration at that level could be performed by directly assigning IDs in the page. It may be desirable to have autoId configuration on a per-page basis through the <ice:config> tag.
        Hide
        Ted Goddard added a comment -

        To test this feature, and auction-raw.xhtml page without ids has been created (attached).

        The following bug is observed with autoid=false:

        Show/hide the demo notes. Then click on a bid button. This will result in a null old DOM on the server because javax.faces.ViewState is not provided in the request. These two buttons are in different forms, but both forms are updated by the show/hide operation (since clocks have also updated). This appears to be a bug in JSF 2.0, where the ViewState is only updated for one of multiple updated forms.

        Show
        Ted Goddard added a comment - To test this feature, and auction-raw.xhtml page without ids has been created (attached). The following bug is observed with autoid=false: Show/hide the demo notes. Then click on a bid button. This will result in a null old DOM on the server because javax.faces.ViewState is not provided in the request. These two buttons are in different forms, but both forms are updated by the show/hide operation (since clocks have also updated). This appears to be a bug in JSF 2.0, where the ViewState is only updated for one of multiple updated forms.
        Hide
        Ken Fyten added a comment -

        Please document this feature in the IF 2 WIki, incl. config. parameter, etc.

        Show
        Ken Fyten added a comment - Please document this feature in the IF 2 WIki, incl. config. parameter, etc.
        Hide
        Ted Goddard added a comment -

        Documentation has been added to the Configuration section of the wiki.

        http://wiki.icefaces.org/display/ICE/Getting+Started

        Show
        Ted Goddard added a comment - Documentation has been added to the Configuration section of the wiki. http://wiki.icefaces.org/display/ICE/Getting+Started

          People

          • Assignee:
            Ted Goddard
            Reporter:
            Ted Goddard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: