on 04-15-2009 4:07 PM
Hi,
In the exit event of a field, I want to check whether the data is changed or not. I have found a method 'hasDataChanged()' in the Adobe LiveCycle Designer help, but not enough documentation is given.
I tried multiple possibilities for using that method, but I ended in error always. How can we use this method in script ?
Thanks,
Prabhakar.
Hi,
As this method returns a boolean it might return '1' or '0'.
So click on the field which you want to check if changed, and check if the status is '1'(changed) or else if it is '0(not changed).
Select JavaScript Language and just check if the below code works.
if (this.hasDataChanged() == '1')
{
<put your logic>
}
else
{
<put your logic>
}
Regards,
Vidya Chowdhary A.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
I have managed to solve that issue, by implementing a work-around. I created another field(hidden) , theis field will have the same value as in the respective visible fields. In script, I will compare the new value(in visible field) with the old one(in corresponding hidden field) , and I will go further only when these two are different.
As this above solution is only a work-around, I will keep this question as open.
Best Regards,
Prabhakar.
Hi Prabhakar,
I use a following work-around:
The enter event (javaScript):
var myEnterRawValue=this.rawValue;
The exit event (javaScript):
if (myEnterRawValue!=this.rawValue) {
// your code
}
Michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michal,
I tried to implement your code, but I am getting the following error in exit event.
"myEnterRawValue is not defined".
I used other way, I created a script object for global varibles, declared a global variable in that script object, in enter event I strored the raw value in that global variable in script object, in exit event I get the value from the script object and compare with the current value.
In ScriptObject,
var Value1;
In enter event,
<ScriptObject>.Value1 = this.rawValue;
In Exit event,
if(this.rawValue != <ScriptObject>.Value1 )
{
// Code
}
Thanks,
Prabhakar.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.