cancel
Showing results for 
Search instead for 
Did you mean: 

adding the values fed in the table

former_member187658
Participant
0 Kudos

Hi

i want to add the values of one column in the table that are given by the user. I set the "calculated" property of the corresponding context element in the controller as true and then writing the code for it. But when i run my application, then even if i give valid data in the corresponding column, it still shows the message errors i have set for the validations and clears the field.

is there any way in which this can be calculated without setting the "calculated" property as true?

If yes, then how to access the values of the column?

Thanks & regards,

Anupreet

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

n is the size of the node !

Example :

for (int i = 0; i < n; ++i) {

IProductsElement item = wdContext.nodeProducts().getProductsElementAt(i);

int quantity = item.getQUANTITY();

total = total +quantity ;

}

total will have the total.. create a calculated attribute and put this code in it !

Validations wont be affected because of calc attr..

what error s are it givin

Regards

Bharathwaj

Former Member
0 Kudos

Hi,

Without using the Calculated property you can proceed the following way suppose you have a Node A with attribute a,b,c.

then you can get each of these values using

wdContext.current<name of node>element().get<attribute>();

The above code gives the value for currently selected row.

Similarly you can get all attributes and perform the required operations.

To get values for particular row you can use

wdContext.node<name of node>().get<name of node>ElementAt(i).get<attribute name>();

Here i is the index of the particular row.

Hope this helps.

Revert back for further clarification.

Regards,

Leena