cancel
Showing results for 
Search instead for 
Did you mean: 

return to a first time state ...

Former Member
0 Kudos

Hi everyone, I have an app that have a "return" button, this button is used when the user wants to return to a previous view, these previous view is the "main view" where the application starts and also the component controller, the problem is that I need to reload all the app (like a first time state) but I´m not sure if calling the wdDoInit of the component controller makes the job. ¿

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Manage the context with the invalidate method

Former Member
0 Kudos

If your doing in the ESS and MSS development i can help you,

in the ESS and mss we do have single line of coding for this,

Cheers,

Apparao

Former Member
0 Kudos

Hi,

You can use two approaches for this requireement :-

1. Use of invalidate - This will clear the node contents.

Node.invalidate();

2. Use of Link to action UI Element - Create a link to action UI Element & bind the action to it. In the binded action implement the below code.

WDPortalNavigation.navigateAbsolute("ROLES://...",WDPortalNavigationMode.SHOW_INPLACE,null,null,WDPortalNavigationHistoryMode.ALLOW_DUPLICATIONS,null,null,null,null,false,false);

This will reload the entire application.

Hope this will help.

Regards

Shruti

Former Member
0 Kudos

Hi,

Anyway you want to load the entire screen and nodes again. So why dont you navigate to your applicaton again using the below code.

For example:

You have

App1 ---> Window1 ---> View1 (DefaultView)

Window1 ---> View2

You are navigating from View1 to View2. When user clicks on View2 invoke App1 which loads all the application again. Use this below code to navigate to application.


// Get name of deployable object this component belongs to
String deployableObjectName =
wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();

try {
// Get deployable object part of target application.
// Precondition: assume, that other application belongs to the same
// Web Dynpro Project (Deployable Object)
WDDeployableObjectPart deployableObjectPart =
WDDeployableObject.getDeployableObjectPart(
deployableObjectName,
"App1",
WDDeployableObjectPartType.APPLICATION);
// Get target URL based on deployable object part and URL parameters

String urlToTargetApp =
WDURLGenerator.getApplicationURL(deployableObjectPart, urlParameters);
// Fire exit plug to target URL via IPublic-API of used interface view
// controller
wdThis.wdGetStartCompInterfaceViewController()
.wdFirePlugStartAppExit(urlToTargetApp);
} catch (WDURLException e) {
messageMgr.reportException(e.getLocalizedMessage(), false);
} catch (WDDeploymentException ex) {
messageMgr.reportException(ex.getLocalizedMessage(), false);
}

Regards,

Charan

pravesh_verma
Active Contributor
0 Kudos

Hi Isaac,

Even I had a similar requirement at one stage in my project. However I must tell you that calling of the wdDoInit() of the component controler is not possible as such. Calling of the wdDoint() of the component controller is purely framework controlled. So youmust not try to go aginst the usual flow of the code.

However there are ways in which you can simulate the requirement which you want. You can call a particular method from wdDoInit() of component controller. The same method can be called from the main view when you are coming back to that view.

Doing this you are actually replicating the action which you would be doing in the wdDoInit() of the component controller. However please note that in such cases you have to very carefully take care of the nodes initializations and constant initializations which would havebeen done due to the earlier calls.

Few functions which could come handy for you are:-


view.resetView();           // In wdDoModify() method.
node.invalidate();           // for refreshing the nodes.
node.removeElement(element)    // for deleting the elements in the node.

I hope this information will help you. Please revert back in case you need anyfurther information on this.

Thanks and Regards,

Pravesh