Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## nextapp.echo2.webrender.servermessage
Class DomUpdate

    java.lang.Object
      nextapp.echo2.webrender.servermessage.DomUpdate

    public class DomUpdate

extends java.lang.Object

A utility class to add `EchoDomUpdate` message parts to the `ServerMessage`. `EchoDomUpdate` message parts are used to directly update the client DOM with HTML code generated on the server.

Constructor Summary
`DomUpdate()`

Method Summary
`static void` | `renderAttributeUpdate(ServerMessage serverMessage, java.lang.String targetId, java.lang.String attributeName, java.lang.String attributeValue)` Creates a `attribute-update` operation to update an element attribute of the element identified by `targetId` in the client DOM.
`static org.w3c.dom.Element` | `renderElementAdd(ServerMessage serverMessage)` Prepares a `dom-add` operation by immediately appending an empty `dom-add` element to the end of the `ServerMessage`'s 'update' group.
`static void` | `renderElementAdd(ServerMessage serverMessage, java.lang.String parentId, org.w3c.dom.DocumentFragment htmlFragment)` Creates a `dom-add` operation to append HTML content to the end of the element identified by `parentId`.
`static void` | `renderElementAdd(ServerMessage serverMessage, java.lang.String parentId, java.lang.String siblingId, org.w3c.dom.DocumentFragment htmlFragment)` Creates a `dom-add` operation to insert HTML content in the element identified by `parentId`.
`static void` | `renderElementAddContent(ServerMessage serverMessage, org.w3c.dom.Element domAddElement, java.lang.String parentId, org.w3c.dom.DocumentFragment htmlFragment)` Adds content to be added to an existing `dom-add` operation.
`static void` | `renderElementAddContent(ServerMessage serverMessage, org.w3c.dom.Element domAddElement, java.lang.String parentId, java.lang.String siblingId, org.w3c.dom.DocumentFragment htmlFragment)` Adds content to be added to an existing `dom-add` operation.
`static void` | `renderElementRemove(ServerMessage serverMessage, java.lang.String targetId)` Creates a `dom-remove` operation to remove the HTML element identified by `targetId` from the client DOM.
`static void` | `renderElementRemoveChildren(ServerMessage serverMessage, java.lang.String targetId)` Creates a `dom-remove` operation to remove all child elements of the element identified by `targetId` from the client DOM.
`static void` | `renderStyleUpdate(ServerMessage serverMessage, java.lang.String targetId, java.lang.String attributeName, java.lang.String attributeValue)` Creates a `style-update` operation to update a CSS style attribute of the element identified by `targetId` in the client DOM.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DomUpdate

    public DomUpdate()

Method Detail

### renderAttributeUpdate

    public static void renderAttributeUpdate(ServerMessage serverMessage,
                                             java.lang.String targetId,
                                             java.lang.String attributeName,
                                             java.lang.String attributeValue)

  Creates a `attribute-update` operation to update an element attribute of the element identified by `targetId` in the client DOM.

  Parameters:
    `serverMessage` - the outgoing `ServerMessage`
    `targetId` - the id of the element whose attribute is to be updated
    `attributeName` - the name of the attribute to update
    `attributeValue` - the new value of the attribute

### renderElementAdd

    public static org.w3c.dom.Element renderElementAdd(ServerMessage serverMessage)

  Prepares a `dom-add` operation by immediately appending an empty `dom-add` element to the end of the `ServerMessage`'s 'update' group. Content is added to the `dom-add` element by invoking `renderElementAddContent()`.

  Parameters:
    `serverMessage` - the `ServerMessage`
  Returns:
    the created `dom-add` `Element`.

### renderElementAdd

    public static void renderElementAdd(ServerMessage serverMessage,
                                        java.lang.String parentId,
                                        org.w3c.dom.DocumentFragment htmlFragment)

  Creates a `dom-add` operation to append HTML content to the end of the element identified by `parentId`.

  Parameters:
    `serverMessage` - the outgoing `ServerMessage`
    `parentId` - the id of the element the HTML code will be appended to
    `htmlFragment` - the HTML fragment to add to the DOM deprecated use of this method can result in DOM modifications being performed in improper order (instead use `renderElementAdd(ServerMessage)` followed by `renderElementAddContent()`)

### renderElementAdd

    public static void renderElementAdd(ServerMessage serverMessage,
                                        java.lang.String parentId,
                                        java.lang.String siblingId,
                                        org.w3c.dom.DocumentFragment htmlFragment)

  Creates a `dom-add` operation to insert HTML content in the element identified by `parentId`.

  Parameters:
    `serverMessage` - the outgoing `ServerMessage`
    `parentId` - the id of the element into which the HTML code will be inserted
    `siblingId` - The id of the element which the content will be inserted before (this element must be an immediate child of the element specified by `parentId`)
    `htmlFragment` - the HTML fragment to add to the DOM deprecated use of this method can result in DOM modifications being performed in improper order (instead use `renderElementAdd(ServerMessage)` followed by `renderElementAddContent()`)

### renderElementAddContent

    public static void renderElementAddContent(ServerMessage serverMessage,
                                               org.w3c.dom.Element domAddElement,
                                               java.lang.String parentId,
                                               org.w3c.dom.DocumentFragment htmlFragment)

  Adds content to be added to an existing `dom-add` operation. The content will be appended to the end of the DOM element identified by `parentId`

  Parameters:
    `serverMessage` - the `ServerMessage`
    `domAddElement` - the `dom-add` element created by a previous invocation of `renderAdd(ServerMessage)`
    `parentId` - the id of the element the HTML code will be appended to
    `htmlFragment` - the HTML fragment to add to the DOM

### renderElementAddContent

    public static void renderElementAddContent(ServerMessage serverMessage,
                                               org.w3c.dom.Element domAddElement,
                                               java.lang.String parentId,
                                               java.lang.String siblingId,
                                               org.w3c.dom.DocumentFragment htmlFragment)

  Adds content to be added to an existing `dom-add` operation. The content will be inserted into the DOM element identified by `parentId` before the specified `siblingId`.

  Parameters:
    `serverMessage` - the `ServerMessage`
    `domAddElement` - the `dom-add` element created by a previous invocation of `renderAdd(ServerMessage)`
    `parentId` - the id of the element the HTML code will be appended to
    `siblingId` - The id of the element which the content will be inserted before (this element must be an immediate child of the element specified by `parentId`)
    `htmlFragment` - the HTML fragment to add to the DOM

### renderElementRemove

    public static void renderElementRemove(ServerMessage serverMessage,
                                           java.lang.String targetId)

  Creates a `dom-remove` operation to remove the HTML element identified by `targetId` from the client DOM.

  Parameters:
    `serverMessage` - the outgoing `ServerMessage`
    `targetId` - the id of the element to remove

### renderElementRemoveChildren

    public static void renderElementRemoveChildren(ServerMessage serverMessage,
                                                   java.lang.String targetId)

  Creates a `dom-remove` operation to remove all child elements of the element identified by `targetId` from the client DOM.

  Parameters:
    `serverMessage` - the outgoing `ServerMessage`
    `targetId` - the id of the element whose children ware to be removed

### renderStyleUpdate

    public static void renderStyleUpdate(ServerMessage serverMessage,
                                         java.lang.String targetId,
                                         java.lang.String attributeName,
                                         java.lang.String attributeValue)

  Creates a `style-update` operation to update a CSS style attribute of the element identified by `targetId` in the client DOM.

  Parameters:
    `serverMessage` - the outgoing `ServerMessage`
    `targetId` - the id of the element whose style attribute is to be updated
    `attributeName` - the name of the style attribute
    `attributeValue` - the new value of the style attribute

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD