Hi, I'm new with LiveCycle Designer (using ES2) and haven't got any previous experience with Javascript, hence my question may seem basic.
I've looked for the answer in this forum and elsewhere but haven't found it so far.
The aim is to show the contact info of a certain Project Manager based on who is selected in a drop down menu. I've created a Text-object for each person (not Text Field since I want to to be able to use different font and size on name, phone number etc.)
Is there a way to say "hide all objects except one" without having to hide every single object individually? It want to avoid too much editing each time a new Project Managers is added.
This is my current code:
form1.FrontPage.Subform1.#subform[1].SELECT-PRJ-MNGR::change - (JavaScript, client)
if ($.boundItem(xfa.event.newText) == "ProjectManager-1") {
this.resolveNode("ProjectManagersForm.PROMA1").presence = "visible";
this.resolveNode("ProjectManagersForm.PROMA2").presence = "hidden";
this.resolveNode("ProjectManagersForm.PROMA3").presence = "hidden";
this.resolveNode("ProjectManagersForm.PROMA4").presence = "hidden";
}
if ($.boundItem(xfa.event.newText) == "ProjectManager-2") {
this.resolveNode("ProjectManagersForm.PROMA1").presence = "hidden";
this.resolveNode("ProjectManagersForm.PROMA2").presence = "visible";
this.resolveNode("ProjectManagersForm.PROMA3").presence = "hidden";
this.resolveNode("ProjectManagersForm.PROMA4").presence = "hidden";
}
if ($.boundItem(xfa.event.newText) == "ProjectManager-3") {
this.resolveNode("ProjectManagersForm.PROMA1").presence = "hidden";
this.resolveNode("ProjectManagersForm.PROMA2").presence = "hidden";
this.resolveNode("ProjectManagersForm.PROMA3").presence = "visible";
this.resolveNode("ProjectManagersForm.PROMA4").presence = "hidden";
}
if ($.boundItem(xfa.event.newText) == "ProjectManager-4") {
this.resolveNode("ProjectManagersForm.PROMA1").presence = "hidden";
this.resolveNode("ProjectManagersForm.PROMA2").presence = "hidden";
this.resolveNode("ProjectManagersForm.PROMA3").presence = "hidden";
this.resolveNode("ProjectManagersForm.PROMA4").presence = "visible";
}
I've seen somewhere that you could give the objects the same name and then hide them based one the name[*] , but I'm not sure how to use it:
form1.FrontPage.DropDownList1::change - (JavaScript, client)
if ($.boundItem(xfa.event.newText) == "ProjectManager-4") {
this.resolveNode("ProjectManagersForm.PROMA[*]").presence = "hidden";
this.resolveNode("ProjectManagersForm.PROMA[4]").presence = "visible";
}
Any help is welcome!