|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
Object
|
+--PBEAction
|
+--PBEAttributeAction
|
+--PBESetMaxAction
PBESetMaxAction looks up the highest current value of this attribute in all rows of this object. This value gets increased by 1 and set to the attribute this event is declared on. PBESetMaxAction can be used in attribute events.
setmax
setmax
PBESetMaxAction does not support any parameters.
PBE:attributeEvent( "item", "number", "on:new:setmax");The last event causes the attribute "number" of the object "item" to be set to the highest occuring value of the "number" attribute plus 1 before activation of the "new" method.Practically this event leads to "number" being increased with each new record being added. However if a record gets deleted that does not have the highest value in all current records, its "number" value does not get reassigned to a new record.
Consider the following example:
When adding a new record now, "setmax" looks up the highest value of "number", which in this example is 2, increases it by 1 and sets the value of the attribute "number" of the to be added set of data to that value (3).
Data records of object "item" "name" "number" ... First Record 1 ... Second Record 2 ... Thus the object would look like this after adding a new record:
When deleting the first record now, the object would look like this:
Data records of object "item" "name" "number" ... Fork 1 ... Knife 2 ... Spoon 3 ... After adding a new entry at this point, the object would look like this:
Data records of object "item" "name" "number" ... Knife 2 ... Spoon 3 ...
The above example can be found in the file "initdemo.pbt" of the "PBE Demo" module (approx. line 277).
Data records of object "item" "name" "number" ... Knife 2 ... Spoon 3 ... Teaspoon 4 ...
| Fields inherited from class PBEAction |
iParameters,
iType,
name,
procName |
| Constructor Summary | |
PBESetMaxAction(varchar name)
|
|
| Methods inherited from class PBEAction |
actionArguments,
actionCall,
actionParameters,
attributeReference,
callString,
checkEvent,
getObject,
methodReference,
nestedInput,
objectReference,
parameter,
parameters,
perform,
performParameterCount,
printPerform,
tracePerform |
| Constructor Detail |
public PBESetMaxAction(varchar name)
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||