Forum Stats

  • 3,852,360 Users
  • 2,264,095 Discussions
  • 7,905,046 Comments

Discussions

Error in autoSuggestBehavior with using train.

Perevertkin M A
Perevertkin M A Member Posts: 37 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: 38,729 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: 37 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: 37 Blue Ribbon

    And when i remove custom init, error reproduced.

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

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


    Timo

  • sodzo
    sodzo Member Posts: 5 Blue Ribbon

    Hello, I have the same problem. The error is on JS side. What kind of initialisation it need? I tried to refresh that field, when go back on first train point. It didn't helped =(

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

    @sodzo please open a new thread of your own. This thread has been abandoned by the OP.

    Provide your details like JDev version in the new thread.

    As said here, a reproducible test case would help.


    Timo

  • User_Q0EC5
    User_Q0EC5 Member Posts: 3 Red Ribbon

    were you able to resolve this issue? After upgrading ADF from 12.1.3 Version to 12.2.1.4 Any field with AutoSuggestionBehaviour Doesn't work on page navigations.

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

    @User_Q0EC5 please open a new thread of your own. This thread has been abandoned by the OP.

    Provide your details like JDev version in the new thread.

    As said here, a reproducible test case would help.


    Timo