I'm having trouble using 'resetData'. Maybe I'm using the wrong thing. I've set up a button to selectively reset my dropdown field within one category [which is TechSF.TACDrop], but it's resetting all the equivalent dropdowns in all categories.
This is my code:
----- form1.TACPg1.TechSF.ResetListBtn::mouseUp: - (JavaScript, client) ----------------------------
if(xfa.host.messageBox("This will clear the current list and your details field, and redisplay the dropdown box. Are you sure?", "Reset List?",2,3) == 4)
{
TechSF.TACResults.clearItems();
TechSF.TACResults.presence = "hidden";
TechSF.TACDtls.presence = "hidden";
TechSF.ResetListBtn.presence = "hidden";
TechSF.TACDrop.presence = "visible"
xfa.host.resetData("xfa.form1.TACPg1.TechSF.TACDrop");
}
As you can see this is also designed to clear a field and hide and redisplay other fields.
I did a search here on 'resetData' and found a reply to a similar query from ThomP in which he uses this code:
xfa.host.resetData("xfa.form.form1.TextField1,xfa.form.form1.TextField2");
I also found the above example in 'LiveCycle Help'. Because this is standalone and not in context, I don't understand the two references contained within the brackets & separated by commas. Seeing as my code isn't working, I assume this is important.
So can someone explain to me why there are 2 references within the brackets and what they mean?
Thanks in advance,
Peta
With this script, you can reset several specific objects to their default value.
The comma is to separate the single objects.
xfa.host.resetData("object1,object2,object3,...,object99");
If you write
xfa.host.resetData();
the wohle form will be reseted.
radzmar
• LoveCycle Blog
Documents you need:
• LiveCycle Designer ES2 Docs