"Update" Function |
![]() ![]() ![]() |
Update function is used to update the sub nodes of the item nodes existing in an ADOM. All the item nodes that matches the where expression can be updated with one function call. If no where expression is given, then all the item nodes in the ADOM will be updated. Syntax: Update(adom-scope:adom-name, target-subnodes, new-values, [where-expression])
adom-scope The scope of the ADOM. Values are "r" Request, "s" Session and "a" Application. adom-name The name of the ADOM. target-subnodes The names of the ADOM sub nodes that will be assigned new values. new-values The new values for the target adom sub nodes. If no source specifier is given for a symbol, the source is searched in "f:", "v:", "i:", "a:" order. where-expression The expression that is tested against each item node of the ADOM. All the item nodes that satisfy the precondition defined with the expression given here are updated with the values provided with source fields. If no source specifier is given for a symbol in the where expression, the source is searched in "a:", "f:", "v:", "i:" order. If this parameter is omitted then all the item nodes of the ADOM will be updated. Examples: Update(s:cart, *, *, a:@id = f:@id) Locate the item node in the session ADOM cart whose id attribute value equals to the value of the current ADOMItemID and transfer the values of all the current process block fields to the sub nodes of it. Update(s:cart, [LINE_TOTAL], [a:PRICE * a:QUANTITY]) Update all the item nodes of the cart session ADOM by multiplying the sub nodes PRICE and QUANTITY and assigning the result to the sub node LINE_TOTAL. Update( |