Skip to Content
avatar image
Former Member

no such element inroadmap exception error

Hi,

I have created an roadmap project. The navigation is working. except when i need to skipp a stip.

When i for instance pus a back putton the roadmap shows me that i am at step 2 instead of step 1`

The code i am using in te viewcontroller for the back button:

wdThis.wdGetOm_Webforms_CustController().visibleSelectionContainer();

wdThis.wdGetOm_Webforms_CustController().InvisibleRequestDetailsContainer();

wdThis.wdGetOm_Webforms_CustController().PreviousStep();

code in the custom controller:

String attrName = null;

boolean found = false;

//copy iterator into list to get list iterator

Iterator it = wdContext.nodeRoadMapSteps().getNodeInfo().iterateAttributes();

List steps = new ArrayList();

while (it.hasNext()) {

steps.add(it.next());

}

ListIterator lit = steps.listIterator();

// find current element and deselect it

while (lit.hasNext() && !found) {

//get attribute name

IWDAttributeInfo info = (IWDAttributeInfo) lit.next();

attrName = info.getName();

if (WDRoadMapStepDesign.SELECTED.equals(wdContext.currentRoadMapStepsElement().getAttributeValue(attrName))){

//selected element found

wdContext.currentRoadMapStepsElement().setAttributeValue(attrName, WDRoadMapStepDesign.STANDARD);

found = true;

}

}

found = false;

lit.previous(); // correction

// one step backwards, but skip disabled steps

while(lit.hasPrevious() && !found) {

//get attribute name

IWDAttributeInfo info = (IWDAttributeInfo) lit.previous();

attrName = info.getName();

if (!WDRoadMapStepDesign.DISABLED.equals(wdContext.currentRoadMapStepsElement().getAttributeValue(attrName))) {

// element is not disabled => select it

wdContext.currentRoadMapStepsElement().setAttributeValue(attrName, WDRoadMapStepDesign.SELECTED);

found = true;

}

}

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 19, 2006 at 05:01 PM

    what kind of methods did you make?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 19, 2006 at 08:11 PM

    Your code looks strange to me. You are working with context metadata instead of context data. Why?

    To control the selection of a RoadMap, you simply have to provide a context attribute that stores the ID of the currently selected step.

    Say you have 3 steps with IDs "step0", "step1", "step2".

    Create context attribute "SelectedStep" of type "string" and bind property RoadMap.<b>selectedStep </b>to that attribute.

    If you want to do "step arithmetic", you could create a context attribute "SelectedStepIndex" of type "integer" and make "SelectedStep" a calculated attribute with

    String getSelectedStep(IWDNodeElement element)
    {
      return "step" + wdContext.currentContextElement().getSelectedStepIndex();
    }
    

    Then you can navigate through the steps by the following operations:

    - Goto step "step<i>":

    wdContext.currentContextElement().setSelectedStepIndex(i)
    

    - Goto next step:

    int currentIndex = wdContext.currentContextElement().getSelectedStepIndex();
    if (currentIndex < 2)
    {
      wdContext.currentContextElement().setSelectedStepIndex(currentIndex + 1);
    }

    - Goto previous step:

    int currentIndex = wdContext.currentContextElement().getSelectedStepIndex();
    if (currentIndex > 0)
    {
      wdContext.currentContextElement().setSelectedStepIndex(currentIndex - 1);
    }

    Armin

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 20, 2006 at 09:27 AM

    code in there is following

    // create new steps node element

    IRoadMapStepsElement steps = wdContext.nodeRoadMapSteps().createRoadMapStepsElement();

    // iterate through node attributes and initialize them

    IWDNodeInfo nodeInfo = wdContext.nodeRoadMapSteps().getNodeInfo();

    Iterator it = nodeInfo.iterateAttributes();

    boolean first = true;

    while (it.hasNext()) {

    //get attribute name

    IWDAttributeInfo info = (IWDAttributeInfo) it.next();

    String attrName = info.getName();

    // initialize context value

    if (first) {

    // first step in RoadMap => set to SELECTED

    steps.setAttributeValue(attrName, WDRoadMapStepDesign.SELECTED);

    first = false;

    } else {

    // all other steps set to STANDARD

    steps.setAttributeValue(attrName, WDRoadMapStepDesign.STANDARD);

    }

    }

    wdContext.nodeRoadMapSteps().bind(steps);

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      If all the attributes in your context node RoadMapSteps has the same property (ie.,WDRoadMapStepDesign). if not then exception raises.

  • avatar image
    Former Member
    Sep 20, 2006 at 03:24 PM

    I get a nulpointer exception when i am going to te next step

    code i used for next step

    int currentIndex = wdContext.currentRoadMapElement().getSelectedStepIndex();

    if (currentIndex < 2) {

    wdContext.currentRoadMapElement().setSelectedStepIndex(

    currentIndex + 1);

    erroro message

    java.lang.NullPointerException

    at com.shell.teamflow.wd.omwebforms.Om_Webforms_Cust.NextStep(Om_Webforms_Cust.java:284)

    at com.shell.teamflow.wd.omwebforms.wdp.InternalOm_Webforms_Cust.NextStep(InternalOm_Webforms_Cust.java:205)

    at com.shell.teamflow.wd.omwebforms.RequestType_View.onActionCreatePosition(RequestType_View.java:227)

    at com.shell.teamflow.wd.omwebforms.wdp.InternalRequestType_View.wdInvokeEventHandler(InternalRequestType_View.java:215)

    at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)

    at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)

    at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleAction(WebDynproMainTask.java:101)

    at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:304)

    at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:649)

    at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)

    at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:248)

    at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)

    at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)

    at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:55)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)

    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)

    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)

    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)

    at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)

    at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)

    at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)

    at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)

    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)

    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

    at java.security.AccessController.doPrivileged(Native Method)

    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95)

    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:160)

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Navigation works now, only the steps are not going with the flow. what code do i need to use for that and should i also put this in Getselection method