cancel
Showing results for 
Search instead for 
Did you mean: 

Reload of a view

Former Member
0 Kudos

Hi Everybody,

does anybody know if it's possible to reload view (simulate things which happen when lifespan is set to when_visible and view is switched off and on again)?

In my case I've got a dynamically created context items and elements in layout. When the view is triggered by an input plug - everything is ok as the view replaces another one (and lifespan is set to "when_visible"). But the content of the view should be recreated also when a portal event is received.

Thank you!

Best regards,

Nick

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Does wdContext.reset() + re-creating dynamic context nodes work for you? If no, please provide more details...

VS

Former Member
0 Kudos

Hi Valery,

there is no method reset in wdContext (I'm on SP7).

What I tried is:

- save boolean property "refreshNeeded"=true into context,

- call action, which reacts on input plug (thus context nodes will be overriden/additionally created - I've not found methods to remove anything from NodeInfo - so old context attributes/subnodes remain)

- add to wdDoModify view check if context "refreshNeeded" is set to true to recreate layout elements and reset "refreshNeeded" back to false.

So far this doesn't work for me - I'm still in debugging to find out how to make it working (seems to be possible).

I just thought there should be an easier way to do things.

Best regards,

Nick

Former Member
0 Kudos

Oops -- my fault

It is wdContext.getContext().reset();

Available since "The very beginning"

It drops <b>all</b> dynamic nodes / attributes created. Also it invalidates node content (you can use <i>wdContext.getContext().reset(false)</i> to preserve existing data)

Thoughts?

VS

Former Member
0 Kudos

Aha, that sounds promising

Thank you very much!

Best regards,

Nick

Answers (0)