Primefaces wizard move to the next tab on an event

a 夏天 提交于 2020-01-05 03:44:19

问题


I have a prime faces wizard and a dataTable, my page successfully go to the next wizard tab if I selected an item from the dataTable, but my problem is when inserting a new data to the dataTable I want the wizard to go to the next tab if the insert was successful, any suggestions please?


回答1:


You can use the client side API from backing bean, after the insert was successful.

Add a widgetVar to your wizard

<p:wizard widgetVar="wiz" ...>
     ...
<p/wizard>

Add the client execute, after the data is successfully inserted.

public void insertData() {
    // Insert data
    if (successfully) {
        RequestContext context = RequestContext.getCurrentInstance();
        context.execute("PF('wiz').next()");
    }
}


来源:https://stackoverflow.com/questions/42607076/primefaces-wizard-move-to-the-next-tab-on-an-event

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