Skip to Content
0
Former Member
Jun 29, 2007 at 02:45 PM

Regeneration of dynamic ui elements

11 Views

Hello to all!!! could you help me with this problem? thanks!

I have two views. In the first view the user has to select some items. In the second view, the application has to give an overview of the items selected.

Since the number of selected items is not known at design time, the overview has to be generated dynamically.

The problem is that if I go to the second view and come back to the first and select other items, then the view is not being regenerated.

Some details of my code are the following:

If the first view is called View1 and the second View2:

- In the wdModifyView, when firstTime, I generate the dynamic elements: no problem

- In the wdModifyView of View2. when not firstTime and the user have exited the view (through wdDoExit) I regenerate again the dynamic elements: I'm not sure when this method is executed

-In wdDoExit of View2, I set an attribute 'exited' to detect when the user exits the view

The code I use is as follows:

-


In View2

public static void wdDoModifyView(IPrivateVerificacionSolicitud wdThis, IPrivateVerificacionSolicitud.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

{

//@@begin wdDoModifyView

if (firstTime){

//Crea nodo dinamico

IWDNodeInfo node = wdContext.getNodeInfo().addChild( "DynamicNode", null, true, true, false, false, false, true, null, null, null);

generarDetallesSolicitudUI(wdThis, wdContext, view);

}

if (!firstTime && wdContext.currentContextElement().getVerificacionSolicitudSalio() ) {

view.resetView();

wdContext.getContext().reset();

//Crea nodo dinamico

IWDNodeInfo node = wdContext.getNodeInfo().addChild(

"DynamicNode", null, true, true, false, false, false, true, null, null, null);

generarDetallesSolicitudUI(wdThis, wdContext, view);

}

//@@end

}

public void wdDoExit()

{

//@@begin wdDoExit()

wdContext.currentContextElement().setVerificacionSolicitudSalio(true);

//@@end

}

public void wdDoInit()

{

//@@begin wdDoInit()

wdContext.currentContextElement().setVerificacionSolicitudSalio(false);

//@@end

}

the method generarDetallesSolicitudUI(wdThis, wdContext, view); is the one that generates the dynamic ui elements