Forum Stats

  • 3,757,133 Users
  • 2,251,200 Discussions
  • 7,869,738 Comments

Discussions

Error in autoSuggestBehavior with using train.

Perevertkin M A
Perevertkin M A Member Posts: 31 Blue Ribbon

I have:

  1. Train in Bounded task flow.
  2. 2 ore more jsff pages.

In first jsff page i have af:inputText with af:autoSuggestBehavior ( minChars="2", suggestedItems=<value added in pageFlowScope bean>

When i open train, af:inputText with af:autoSuggestBehavior worked correctly, but when i go to second page and returned to page with af:inputText then af:autoSuggestBehavior don't displayed suggested values. In pageFlowScope bean all values returns, but on client displayed load ring. Weblogic has no error, but the browser has the following error:

suggest-92s23k.js:7 Uncaught TypeError: e._cacheSuggestedItems is not a function
    at Function.AdfAutoSuggestBehaviorImpl.showAutoSuggestPopup (suggest-92s23k.js:7)
    at <anonymous>:1:28
    at AdfSafariAgent.execScript (boot-nmkpup.js:282)
    at AdfInlineLoadableScript.AdfLoadableScript.ExecScript (core-d0yor4.js:13)
    at AdfInlineLoadableScript.load (core-d0yor4.js:14)
    at AdfScriptLoadingService._loadNextScript (core-d0yor4.js:7)
    at AdfScriptLoadingService._addLoadableScript (core-d0yor4.js:6)
    at AdfScriptLoadingService.addInlineScript (core-d0yor4.js:3)
    at AdfDhtmlPage._handleRichResponseScript (boot-nmkpup.js:653)
    at AdfDhtmlPage._applyRichResponse (boot-nmkpup.js:612)

Jdev version: Build JDEVADF_12.2.1.4.0_GENERIC_200613.1114.S

WebLogic Server Version: 12.2.1.4.0

Please, help

Tagged:

Answers

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 37,540 Red Diamond

    How do you go back?

    The error is a javascript error pointing to a wrong initialisation. Does your stop have any init method?


    Timo


  • Perevertkin M A
    Perevertkin M A Member Posts: 31 Blue Ribbon

    I'm use


    <af:train var="trainNode" value="#{controllerContext.currentViewPort.taskFlowContext.trainModel}" id="pt_t1">
        <f:facet name="nodeStamp">
             <af:commandNavigationItem text="#{trainNode.textAndAccessKey}" id="cni1"
                                      visited="#{trainNode.visited}"
                                      action="#{trainNode.action}"
                                      selected="#{pageFlowScope.popupMasterBean.currentTab}"/>
        </f:facet>
    </af:train>
    


    I have custom init method for train. This method used for start train from selected step. In this case initStep = null


    private void initTrain(Integer initialStep) {
        ControllerContext controllerContext = ControllerContext.getInstance();
        ViewPortContext currentViewPortCtx = controllerContext.getCurrentViewPort();
        TaskFlowContext taskFlowCtx = currentViewPortCtx.getTaskFlowContext();
        TaskFlowTrainModel taskFlowTrainModel = taskFlowCtx.getTaskFlowTrainModel();
    
        oracle.adfinternal.controller.train.TrainModel trainModel =
            (oracle.adfinternal.controller.train.TrainModel) taskFlowTrainModel;
    
        if (initialStep == null || initialStep < 0) {
            logger.info("Information: No stop set -> Nothing to do");
            return;
        }
    
        Map<ActivityId, oracle.adfinternal.controller.train.TrainStopModel> mapTrainStops = trainModel.getTrainStops();
        Set<ActivityId> keySet = mapTrainStops.keySet();
        Object[] array = keySet.toArray();
        if (initialStep > array.length) {
            logger.info("Information: no stop with number " + initialStep);
            return;
        }
    
        TaskFlowTrainStopModel currentStop = mapTrainStops.get(array[initialStep - 1]);
        logger.info("Information:" + currentStop);
    
        TaskFlowTrainStopModel prevStop = taskFlowTrainModel.getPreviousStop(currentStop);
        while (prevStop != null) {
            oracle.adfinternal.controller.train.TrainStopModel ts =
                (oracle.adfinternal.controller.train.TrainStopModel) prevStop;
            ts.setVisited(true);
            prevStop = taskFlowTrainModel.getPreviousStop(prevStop);
        }
    }
    
    
  • Perevertkin M A
    Perevertkin M A Member Posts: 31 Blue Ribbon

    And when i remove custom init, error reproduced.

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 37,540 Red Diamond

    Well, the code looks OK. Can you provide a reproducible est case build on the HR DB schema?


    Timo