cancel
Showing results for 
Search instead for 
Did you mean: 

Controller Supply Function for table one entry works

former_member540174
Participant
0 Kudos

I am displaying a table. For the employee I show all their hours by type (regular, vacation, etc). Each hour type line has a validation flag that I have to compute. I'm obviously doing something wrong as I only seem to be able to get my supply function to supply the flag to the first record the remaining are blank.

OutputHours

-EmplHours - 0..n

--wkHours - 0..n

-


TimeType

-


Hours

-


Contkz

-


ComputedCompValues <== Value node I added others above are bound from model

-


Contlz_String <==Value attribute I'm trying to populate based on Contkz containing "something"

Here is the code -

public void supplyComputedCompValues(IPrivateEmployeeTimeVerificatioinCust.IComputedCompValuesNode node, IPrivateEmployeeTimeVerificatioinCust.IWkhoursElement parentElement)

{

//@@begin supplyComputedCompValues(IWDNode,IWDNodeElement)

IComputedCompValuesElement elem = node.createComputedCompValuesElement();

if (wdContext.currentWkhoursElement().getContkz().trim().length() > 0)

{

elem.setContlz_String("Verified");

}

else

{

elem.setContlz_String("HI!");

}

node.bind(elem);

//@@end

}

WHen I run the code my view only has Verified for the first entry in wkhours all others are blank. I did check the fields (bound Contlz directly to the field in the view) and they all contained a "2".

Regards,

Diane

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Diane, I would better make ComputedCompValues node as non singleton, cardinality 1..1, selection 1..1 and make Contlz_String as calculated attribute. Supply function on ComputedCompValues gonna be called only if lead selection of wkHours is changed.

former_member540174
Participant
0 Kudos

Solved problem. Question for you. During my iterations trying to figure this out I had created calculated values but had the node set at singleton, cardinality 0..n, selection 0..n.

Would you please explain the relationship between singleton/cardinality/selection?

Thank you,

Diane

former_member182372
Active Contributor
0 Kudos

Singleton - property showing whether instance of node is assigned exlusivly to parent`s node element (Singleton=false, multiple instances of child node exist at the same time) or it is assigned to the parent node`s lead selected element only (Singleton=true, only ONE instances of child node exist at the same time). Using singleton=true is useful in combination with supply function - when lead selection of parent node is changed, supply function for child node is called and you can load data depending on lead selected node element from parent node. Useful by implementing table - detail pattern.

Cardinality - how many elements could node have.

Selection - how many elements could be selected in the node (lead selection and plain selection).

Answers (0)