cancel
Showing results for 
Search instead for 
Did you mean: 

Clearing Context in Web Dynpro applications

0 Kudos

Hi All,

I am using a view that is called from multiple places based on different criteria. This view has a table that is fed from the custom controller. Some of the context data for this custom controller are being set from the other views. I need to clear the resultset of the custom controller and retain the input data from the other views. Is there any simple way of clearing data in the context node? I tried invalidating the node, context but nothing seems to work. Any suggestion what I might be doing wrong?

Thanks and regards,

Hemanth

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

hi Hemanth,

Where are u trying to invalidate the node. What is the exact scenario.If u want the custom controller to be updated in different views... u can say

wdThis.wdGet<contr name>Controller().wdGetContext().node<name>().invalidate();

in the init of the view where the value of the custom controller is updated.

Is the problem with invalidate or with the updation in values.Invalidate will always work if u set the lead selection properly.

If u cud elobarate more on the problem someone could really help u out...

Regards

Bharathwaj

0 Kudos

Hi Hemanth,

If "initilaizedLeadSelection" of your context or model node is set to "true", then wdContext.node<nodeName>().invalidate(); itself does not clear up the context node. You have to set LeadSelection to 0 first before invalidate() as shown below:

public void resetMyContextNode()

{

//@@begin resetMyContextNode()

if (wdContext.node<nodeName>().size() > 0) {

wdContext.node<nodeName>().setLeadSelection(IWDNode.NO_SELECTION);

wdContext.node<nodeName>().invalidate();

}

//@@end

}

Hope it helps,

- Nancy

Former Member
0 Kudos

This works too:

wdContext.node<YOUR_NODE>().invalidate();

Former Member
0 Kudos

Yes the above code set the context attributes to null.

Make sure that you call the code at the correct node and at the correct point.

Former Member
0 Kudos

Hi Hemanth,

it's valid to bind null to a context node, so:

wdContext.current<YourNode>().bind(null)

creates an empty list of <YourNode>elements in the corresponding node.

Hope that helps.

Regards

Stefan