How to execute transition on value change in h:selectOneMenu?

半腔热情 提交于 2019-12-04 13:31:09

I recently had a similar issue, and handle primefaces/richfaces events with a similar listener style. Here's an example:

    public void changeListener(AjaxBehaviorEvent event) {  
    RequestContext requestContext = RequestContextHolder.getRequestContext();
    RequestControlContext rec = (RequestControlContext) requestContext;
    //place variables you need in next flow phase here; flash,application,session scope
    rec.getFlashScope().put("someVarIneedInNextFlow", varName);
    rec.handleEvent(new Event(this, "flow transition name here, i.e. next-stage"));
    return;
}

That should transition to whichever flow event you desire :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!