在jsf的表单错误中重新加载某个jQuery代码 [英] reloading a certain jQuery code on jsf's form error

查看:121
本文介绍了在jsf的表单错误中重新加载某个jQuery代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个jQuery代码让用户在

I have a jQuery code that makes a panel slide for the user to input data in

中输入数据的面板幻灯片我有一些消息会显示在面板中,以便在错误发生,当用户按下提交按钮时,面板消失,为了看到他必须再次按下显示面板按钮的错误消息,

I have messages for errors that will be displayed in the panel in case of error occurance, the thing is when the user presses the submit button the panel disappears and inorder to see the error messages he has to press the display panel button again,

用户再次按下按钮,面板出现错误正确,但必须由用户再次完成。

when the user presses the button again the panel appears with the errors in correctly but it has to be done by the user again.

我正在尝试使面板自动重新出现,当发生错误,我该怎么办?

I am trying to make the panel reappear automaticly when the error occurs, how could i do that ?

我正在使用JSF 2.0和jQuery。

I am using JSF 2.0 and jQuery.

推荐答案

如果有ajax涉及将此代码添加到您的js代码

If there ajax involved add this code to your js code

$(window).load(function() {

    jsf.ajax.addOnEvent(function (data) {
        if (data.status === "success") {
            //your code to show the panel with errors goes here
        }
    });

});

这篇关于在jsf的表单错误中重新加载某个jQuery代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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