This message was posted in the Adobe LiveCycle ES Forum but as yet I have not had a reply. If my example/problem is not clear then please tell me.
Entering the event, tf_Company = " Integral" and the 'if' statement will change the value to " TBA" (and it can be clearly seen on the screen).
However, after the 'if' statement the value of tf_Company is now null and I don't know why.
dd_Type is in a subform.
// At this point tf_Company is " Integral"
xfa.host.messageBox("tf_Company: " + tf_Company.rawValue, "Debugging", 3);
// The if statement executes as true
if (dd_Type.rawValue == "M" && tf_Company.rawValue == " Integral")
{
tf_Company.rawValue = " TBA";
// At this point " TBA" displays in the form
xfa.host.messageBox("Company has been changed to 'TBA'", "Company",3,0);
};
// At this point tf_Company is null - Why???
xfa.host.messageBox("tf_Company: " + tf_Company.rawValue, "Debugging", 3);
1) instead of "dd_Type.rawValue" write "xfa.event.newText" (if your event is in dd_Type)
2) instaed of "dd_Type.rawValue" write "dd_Type.value.text.value"
One of that variants should work. If not, write to me.
explanation:
Your code "dd_Type.rawValue" returns the previous value of dd_Type, also NULL and not the actual value.
Greets
Daniel