Web Dynpro API Documentation

com.sap.tc.webdynpro.progmodel.api
Interface IWDNodeElement


public interface IWDNodeElement

Functionality that is common to all elements in any context node and that can be used by Web Dynpro applications. While this class is used when programming dynamically, more convenient, typed subinterfaces of this interface are generated for context nodes whose structure is declared within the Web Dynpro Development Workbench.

Version:
$Id: //tc/WebDynproRuntime/630_VAL_REL/src/_webdynpro_progmodel/java/com/sap/tc/webdynpro/progmodel/api/IWDNodeElement.java#2 $

Method Summary
 void changed(java.lang.String attributeName)
          Sets the changed flag for this element.
 java.lang.String getAttributeAsText(java.lang.String attributeName)
          Returns the value of the attribute with the given name formatted using the session locale.
 java.lang.Object getAttributeValue(java.lang.String attributeName)
          Returns the value of the attribute with the given name as an Object.
 boolean hasModel()
          Returns true if this element has a model object
 int index()
          Returns the index of this element in the collection of its node or -1 if the element has not been assigned to a node.
 boolean isChanged()
          Returns true if the changed flag has been set for this element.
 boolean isChangedByClient()
          Returns true if the changedByClient has been set for this element.
 java.lang.Object model()
          Returns the model object contained in this element.
 IWDNode node()
          Returns the node this element belongs to.
 void setAttributeValue(java.lang.String attributeName, java.lang.Object value)
          Sets the value of the attribute with the given name to the given value.
 

Method Detail

node

public IWDNode node()
Returns the node this element belongs to. If the element has been created but not yet assigned to a node, null is returned.
Returns:
the node this element belongs to or null, if the element has been created but not yet assigned to a node

index

public int index()
Returns the index of this element in the collection of its node or -1 if the element has not been assigned to a node.
Returns:
the index of this element in the collection of its node or -1 if the element has not been assigned to a node

changed

public void changed(java.lang.String attributeName)
Sets the changed flag for this element. The Web Dynpro Runtime uses that flag to determine those elements that have been changed in a request/response cycle.

setAttributeValue(String, Object) and generated mutator methods in generated sub interfaces of IWDNodeElement will call changed() automatically. So applications that modify node elements don't have to call changed() explicitly.

Parameters:
attributeName - The name of the changed attribute or null to mark all attributes changed.

isChanged

public boolean isChanged()
Returns true if the changed flag has been set for this element.

Note: This flag will be used and reset by the Web Dynpro Runtime.

Returns:
true if the changed has been set for this element or false otherwise.

isChangedByClient

public boolean isChangedByClient()
Returns true if the changedByClient has been set for this element. This flag will be set by the framework when an update from the client arrives. It remains true until you reset all flags in the complete context via IWDContext.resetChangedByClient().

Since this flag is kept per element, but each attribute may actually live in a different element, Web Dynpro always marks both the mapped element and the origin element marked if an attribute is changed. This has the consequence that IWDContext.resetChangedByClient() must always be called from the context in which you will look for client changes.

Returns:
true if the changedByClient has been set for this element or false otherwise.

getAttributeValue

public java.lang.Object getAttributeValue(java.lang.String attributeName)
Returns the value of the attribute with the given name as an Object.
Parameters:
attributeName - the name of the attribute
Returns:
the attribute with the given name as an Object
Throws:
ContextException - if no attribute with that name exists
See Also:
setAttributeValue(String, Object)

getAttributeAsText

public java.lang.String getAttributeAsText(java.lang.String attributeName)
Returns the value of the attribute with the given name formatted using the session locale.
Parameters:
attributeName -  
Returns:
the formatted value
Throws:
ContextException - if no attribute with that name exists
See Also:
getAttributeValue(String)

setAttributeValue

public void setAttributeValue(java.lang.String attributeName,
                              java.lang.Object value)
Sets the value of the attribute with the given name to the given value.
Parameters:
attributeName - the name of the attribute
value - the attribute value with the given name as an Object
Throws:
ContextException - if no attribute with that name exists
ClassCastException - if the class of value does not match the declared class for the attribute
See Also:
getAttributeValue(String)

hasModel

public boolean hasModel()
Returns true if this element has a model object
Returns:
true if this element has a model object

model

public java.lang.Object model()
Returns the model object contained in this element.
Returns:
the contained model object
Throws:
ContextException - if this element is not a model node element

Web Dynpro API Documentation

Copyright © 2004 SAP AG. Automatically generated Thu Mar 3 2005, 22:15