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

        Ted Goddard created issue -
        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.
        Ken Fyten made changes -
        Field Original Value New Value
        Salesforce Case []
        Fix Version/s 2.0-Alpha3 [ 10032 ]
        Affects [Documentation (User Guide, Ref. Guide, etc.)]
        Assignee Ted Goddard [ ted.goddard ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #20931 Thu Mar 11 11:48:25 MST 2010 ted.goddard SystemEventListener for automatically adding IDs (ICE-5379)
        Files Changed
        Commit graph ADD /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/event/MainEventListener.java
        Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/util/EnvUtils.java
        Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/render/DOMRenderKit.java
        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.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #20938 Thu Mar 11 15:02:57 MST 2010 ted.goddard added ViewState logging to help diagnose null DOM problems (ICE-5379)
        Files Changed
        Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/context/DOMPartialViewContext.java
        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.
        Ted Goddard made changes -
        Attachment auction-raw.xhtml [ 12256 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #21048 Tue Mar 23 10:44:30 MDT 2010 ted.goddard do not modify IDs on ICEfaces components (ICE-5379)
        Files Changed
        Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/event/MainEventListener.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #21124 Wed Mar 31 13:20:42 MDT 2010 ted.goddard applying id modification to ICEfaces pages only (ICE-5379)
        Files Changed
        Commit graph MODIFY /icefaces/scratchpads/glimmer/core/src/main/java/org/icefaces/event/MainEventListener.java
        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
        Ted Goddard made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 2.0.0 [ 10230 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: