Primefaces向导移至事件的下一个选项卡 [英] Primefaces wizard move to the next tab on an event

查看:46
本文介绍了Primefaces向导移至事件的下一个选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个素人向导和一个dataTable,如果我从dataTable中选择了一个项目,我的页面会成功转到下一个向导选项卡,但是我的问题是在向dataTable插入新数据时我希望向导进入下一个选项卡,如果插入成功,请提出任何建议?

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?

推荐答案

插入成功后,可以使用支持Bean的客户端API.

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()");
    }
}

这篇关于Primefaces向导移至事件的下一个选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆