是基于InfoPath 2010的浏览器中的脏功能 [英] Is Dirty functionality in an Browser based InfoPath 2010

查看:90
本文介绍了是基于InfoPath 2010的浏览器中的脏功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们请帮助我



目前我正在使用InfoPath 2010并陷入一个功能并寻求帮助。



客户要求: -

•客户要求基于浏览器的InfoPath 2010表单中的Is Dirty功能以及以下几点的Is Dirty功能

1.浏览器后退按钮点击。

2.浏览器刷新。(即按F5或ctrl F5)

3.浏览器关闭。

•如果InfoPath表单上的任何控件值变化,则以上所有点都应该有效。



当前开发的场景: -

•我们知道InfoPath 2010中没有OOB Is Dirty功能,并且默认情况下单击表单库上的Add Document会将其重定向到/_layouts/FormServer.aspx页面,因为它是一个应用程序页面我们不应该在这里做任何事情所以我复制了FormServer.aspx页面并添加了一个新页面sayi单击CustomFormServer.aspx并单击Add Document将其重定向到我的CustomFormServer.aspx页面

•我在此页面中编写了自定义J查询/ JavaScript(即使用其中一个可用的J-query插件用于Is Dirty功能,这里可以使用)



问题/使用上述J-query插件时出现问题: -

•上面的插件工作正常,但是点击我的提交和取消按钮也会被触发(即通过InfoPath设计器添加了两个用于保存和取消的按钮),自保存按钮后我不想要这个按钮有我的自定义代码将信息保存到各种列表和库中,取消按钮只是重定向到该表单库的allitems.aspx。

•所以我做的是添加下面的J查询



$(''input [type =button]'')。dirtyForms(''setClean'');



$(''input [type =button]'')。click(function(){

alert(clicked);

$(this).dirtyForms(''setClean'');

});

其中setClean将从整个InfoPath表单上的所有按钮中删除isdirty功能



•问题是,它在页面上运行良好是第一次加载,因为我们知道如果我们更改InfoPath页面上的任何控件值,它会导致回发,并且添加的J查询函数不会被触发。这个问题的详细内容也是我在MSDN论坛上发布的。



我知道我在困扰你但是如果可能的话,请你提供宝贵的反馈,上述问题或一些可以帮助我满足客户要求的解决方法。



等待您的回复。



=============================================



•我在InfoPath 2010中单击按钮时使用Jquery,但如果表单上的任何字段/ s值发生更改,则InfoPath表单本身会导致回发,而jquery函数会执行' '得到解雇(除了页面没有导致任何回发的时间)。

我的想法就是在每次回发后,Jquery函数被删除或删除,这是在页面加载时应用的。

是否有任何功能可以帮助我在每次回发后再次触发相同的jquery函数?

我尝试添加以下脚本:

Sys。美联社plication.add_load(LoadHandler);

函数LoadHandler(){

alert(嗨);

}

但这不适用于页面加载以及回发。

我也试过:

function pageLoad(sender,args){

setTimeout(准备好,1000);

}

当页面第一次加载而不是回发时,这只能工作一次。

Hi friends please help me

Currently I am working on InfoPath 2010 and got stuck up in one functionality and asking for your help.

Client Requirement :-
• Client is asking for "Is Dirty" functionality in an Browser based InfoPath 2010 form as well "Is Dirty" functionality for the below points
1. Browser back button click.
2. Browser refresh.(i.e. by pressing F5 or ctrl F5)
3. Browser close.
• If any control/s value changes on the InfoPath form then all the above points should work.

Currently Developed Scenario:-
• As we know there is not OOB Is Dirty functionality available in InfoPath 2010 and also by clicking Add Document on the form library by default it gets redirected to /_layouts/FormServer.aspx page, since it’s an application page we should not do anything here so I had copied the FormServer.aspx page and added a new page saying CustomFormServer.aspx and on click on Add Document redirecting it to my CustomFormServer.aspx page
• I have written my Custom J-query/JavaScript in this page (i.e. using one of the available J-query plugin for Is Dirty functionality which is available here)

Issue/Problem in using the above J-query plugin:-
• The above plugin is working properly but it does gets fired on the click of my Submit and Cancel button also(i.e. two buttons added for saving and cancelling, through InfoPath designer) which I don’t want since save button has my custom code for saving the information into various list and libraries and cancel button is just redirecting to allitems.aspx for that form library.
• So what I did is added the below J-query

$(''input[type="button"]'').dirtyForms(''setClean'');

$(''input[type="button"]'').click(function() {
alert("clicked");
$(this).dirtyForms(''setClean'');
});
where setClean will remove isdirty functionality from all the buttons on the entire InfoPath form

• The problem is, its works well when the page is loaded for the first time and as we know if we change any control value on InfoPath page it causes post back and the added J-query function doesn’t get fired. The detailed of this issue is also posted by me on MSDN forum here.

I know that I am troubling you but can you please provide your valuable feedback if possible, for the above issue or some workaround which can help me in satisfying the client requirement.

Waiting for an response from you.

=============================================

• I am using Jquery on button click in InfoPath 2010 but if any filed/s value changes on the form then InfoPath form itself causes postback and the jquery function does''nt get fired(except for the time when the page does not cause any postback).
My thinking is like that after each postback the Jquery function is getting erased or removed which was applied on page load.
Is there any functionality which can help me triggering the same jquery function again after each postback ?
I tried adding following script:
Sys.Application.add_load(LoadHandler);
function LoadHandler() {
alert("Hi");
}
But this is not working on page load as well on postback.
I also tried:
function pageLoad(sender, args) {
setTimeout(ready, 1000);
}
This is working only once when page loads for the first time and not on postback.

推荐答案

(''input [type =button]'')。dirtyForms(''setClean'');


(''input[type="button"]'').dirtyForms(''setClean'');


(''input [type =button]'')。点击(function(){

alert(clicked);
(''input[type="button"]'').click(function() {
alert("clicked");


(this).dirtyForms(''setClean'');

});

其中setClean将从整个InfoPath表单上的所有按钮中删除isdirty功能



•问题是,它在页面上运行良好是第一次加载,因为我们知道如果我们更改InfoPath页面上的任何控件值,它会导致回发,并且添加的J查询函数不会被触发。这个问题的详细内容也是我在MSDN论坛上发布的。



我知道我在困扰你但是如果可能的话,请你提供宝贵的反馈,上述问题或一些可以帮助我满足客户要求的解决方法。



等待您的回复。



=============================================



•我在InfoPath 2010中单击按钮时使用Jquery,但如果表单上的任何字段/ s值发生更改,则InfoPath表单本身会导致回发,而jquery函数会执行' '得到解雇(除了页面没有导致任何回发的时间)。

我的想法就是在每次回发后,Jquery函数被删除或删除,这是在页面加载时应用的。

是否有任何功能可以帮助我在每次回发后再次触发相同的jquery函数?

我尝试添加以下脚本:

Sys。美联社plication.add_load(LoadHandler);

函数LoadHandler(){

alert(嗨);

}

但这不适用于页面加载以及回发。

我也试过:

function pageLoad(sender,args){

setTimeout(准备好,1000);

}

这是第一次加载页面而不是回发时只工作一次。
(this).dirtyForms(''setClean'');
});
where setClean will remove isdirty functionality from all the buttons on the entire InfoPath form

• The problem is, its works well when the page is loaded for the first time and as we know if we change any control value on InfoPath page it causes post back and the added J-query function doesn’t get fired. The detailed of this issue is also posted by me on MSDN forum here.

I know that I am troubling you but can you please provide your valuable feedback if possible, for the above issue or some workaround which can help me in satisfying the client requirement.

Waiting for an response from you.

=============================================

• I am using Jquery on button click in InfoPath 2010 but if any filed/s value changes on the form then InfoPath form itself causes postback and the jquery function does''nt get fired(except for the time when the page does not cause any postback).
My thinking is like that after each postback the Jquery function is getting erased or removed which was applied on page load.
Is there any functionality which can help me triggering the same jquery function again after each postback ?
I tried adding following script:
Sys.Application.add_load(LoadHandler);
function LoadHandler() {
alert("Hi");
}
But this is not working on page load as well on postback.
I also tried:
function pageLoad(sender, args) {
setTimeout(ready, 1000);
}
This is working only once when page loads for the first time and not on postback.


这篇关于是基于InfoPath 2010的浏览器中的脏功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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