I have two views in my Java Web Dynpro application and I want to share one variable between them so that when a string is submitted in the StartView I can show it in the ResultView. I'm a little confused about how the mapping works though.
I created a value attribute
called Username
inside my component context like this and this. Then I created a data link between my StartView and my Component Controller. I dragged the Username attribute from the right side (where the component is) onto my StartView context. The result looks like this.
And this is where I'm stuck: I don't know how to reference this username attribute from the Component to the ResultView. Obviously I need to create a datalink between the two but then what?
- Do I create a new value attribute on the ResultView context [this way][4].
- Or do I once again drag the Username attribute from the component context to the ResultView context the same way as I did for the StartView.
Basically I want to get this code working:
String headerText = wdThis.wdGetWelcomeComponentController().
wdGetContext().currentContextElement().getUsername();
wdContext.currentContextElement().setHeaderText(headerText);
// headerText is the name of the attribute that I want to create in the ResultView