cancel
Showing results for 
Search instead for 
Did you mean: 

Initialize all context values at one shot

Former Member
0 Kudos

Hi,

Is there a way i can initialize all the context values of a view. I mean when i click "Reset" all the values should be cleared at one shot instead of setting each value attribute to space.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
wdContext.invalidate()

It clears all the values.

Former Member
0 Kudos

This setting my input fields and tables to "disabled"

Former Member
0 Kudos

Hi Aditya,

try this out :

wdContext.getContext.reset(true);

Regards

Rohit

Former Member
0 Kudos

Hi Aditya,

Whether you use wdContext.invalidate() or wdContext.reset(), all the elements of the entire context will be deleted and hence the table will be disbaled since it's datasource node has no elements. Each row of a table corresponds to an element in it's datasource node. If you create n elements for the node, those many rows will be enabled. So when you remove all the elements of the node, all the rows of the table will also be disbaled. So you have two options here:

1) After removing the elements, create as many of them as required with the default values.

2) Instead of removing the elments, explicitly access each attribute and set it's value to null or space. It will involve just a for loop:

IPrivate<View_name>.I<node_name>Element elmt;

for(int i=0;i<wdContext.node<node_name>().size();i++)

{

elmt = wdContext. node<node_name>().get<node_name>ElementAt(i);

elmt.set<parameter1>("");

elmt.set<parameter2>("");

.

.

}

Hope this helps,

Best Regards,

Nibu.

(Please take care to close your solved problem's threads by awarding appropriate points . If you haven't got a solution for your problems, please update the forum on their status. Kindly consider awarding points for helpful answers on SDN !)

Former Member
0 Kudos

This message was moderated.

Answers (0)