cancel
Showing results for 
Search instead for 
Did you mean: 

wdDoModifyView/Refresh view

Former Member
0 Kudos

I've read a few threads on SDN in regards to the use of the view.resetView() command in the wdDoModifyView method. I am seeing some strange behavior and wanted to check with someone to see if I'm using this correctly...

I have a MainView (actually it's called MainView) which contains 2 push buttons and a Table UI which I populate the context within the code of the View Controller- I am building a list of shipping receipts that are entered by the users. This works great when you first start up the application- the user sees the 2 push buttons and an up-to-date list of the receipts entered - the latest ones entered are first in the table.

What my problem is is when a user enters a receipt and hits the "Save" button I want to bring them back to the MainView and have the newly-entered receipt at the top of the table without them having to do anything. This is not happening. If I manually press the Refresh button on the browser I do see the newly-added items.

At this time I can't use the debugger because I don't have my dev system available to me and the basis folks don't want to change a node on test to non-productive (long story) so I can't even see if the view.resetView() is ever being kicked off. I can see that it IS kicked off when the application starts originally because there is a pause when the app starts up when I believe the refresh is happening. To make it more obvious I added myself a simple for loop that ran from, say 1 to 10000, and there was a larger pause when the app started up. When I enter a receipt and press Save and get back to the MainView I do not see a pause however.

I put the view.resetView() code in the wdDoModifyView of the MainView (the one I want a refresh to happen for). Is there something I am missing or not doing correctly? Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I've got the code that populates the table UI in the Supply Function- I am making a JDBC call and selecting data and then adding items to the context- this seems to work fine when initially loading the app but it doesn't look like I ever get back here to add new items to the context.

How do I force the CC to re-run the Supply Function?

roberto_tagliento
Active Contributor
0 Kudos

from view you can call CC methods

wdThis.wdGet$YOUR_CC$().$SUPPLY_FUNCTION$();

Before the call maybe it´s better remove the old list of element.

Or add only the NEW element INSERTED, select it at the NODE and MOVE it to the like first.

wdContext.node$YOUR_NODE$().moveTo(0);

Message was edited by:

Roberto Tagliento

Former Member
0 Kudos

Dana,

wdContext.node<NAME_OF_NODE_WITH_SUPPLY_FN>().invalidate().

Works both with original node in controller or mapped node in view.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

Thanks! That did it!

Former Member
0 Kudos

Hi Valery

I have similar requirement. When I click on a LinkToAction in main view it opens external window(from different component).As soon as external window opens for first time my main view actions are all disabled automatically. second time user cannot click on any links provided. I guess node is getting invalidated. If I refresh I was able to again click on another LinkToAction in main view.

I used Supply funtions for setting colors and visibility in model node. Please

suggest me how to refresh my main view when external window opens.

Answers (3)

Answers (3)

roberto_tagliento
Active Contributor
0 Kudos

If as i guess when hits the "Save" button, do also some method recall of CC.

lajitha_menon
Contributor
0 Kudos
roberto_tagliento
Active Contributor
0 Kudos

With WD never click browser refresh 😛

Probably isn´t only a problem of view refresh, but also of some Component Controller context that is binded to your view!