on 04-23-2010 1:09 PM
Hi All,
I have a requirement where there are two list boxes (Say L1 and L2). Multi selection has been enabled for both the List boxes. There is an add button and a remove button.
On clicking Add button, the selected entries should be removed from L1 and to be added to L2.
On clicking Remove button, the selected entries should be removed from L2 and to be added to L1.
I am using javascript as the scripting language and Adobe Live Cycle Designer 7.1.
Can anyone tell me how can I achieve this using javascript.
Thank You.
Fahad Hamsa
Hello,
these threads should give you the complete idea:
Upgrade to LCD 8.1: Note 1176858 - Adobe LiveCycle Designer 8.1 Installation
Scripting guide for JavaScripts: http://www.adobe.com/devnet/livecycle/articles/lc_designer_scripting_basics/lc_designer_scripting_ba...
Regards Otto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Otto,
Your reply was very helpful and awarded points for that.
Still I am facing some issues. Let me explain the context structure and the elements that I use here.
DataSource for adobeform is a node named "MaterialMaster".
I have two list boxes: ProhibitedPlants_ListBox & PemittedPlants_ListBox, which is bound to the nodes "ProhibitedPlant" and "PermittedPlants" respectively.
So, my node structure is as below:
MaterialMaster(RootNode for adobe form)[1:N]
--*ProhibitedPlants (Source for ProhibitedPlants_ListBox )[0:N]
--PlantID (String Attribute)
--PlantDesc (String Attribute)
--PermittedPlants (Source for PemittedPlants_ListBox )[0:N]
--PlantID (String Attribute)
--PlantDesc (String Attribute)
Multiselection has been enabled for both the list boxes. I had populated values in both the list boxes and it is working perfect.
I have one "Add" button in the form. In click event of add button, I wrote the following coding to move the selected items from ProhibitedPlants_ListBox to PemittedPlants_ListBox. But it is not working. Can you please expedite the code and guide me further to resolve this issue.
var nodeAllow = xfa.resolveNodes("xfa.record.MaterialMaster.PermittedPlants[*].value");
var length1 = ProhibitedPlants_ListBox.items.nodes.length;
for (var i = 0; i < length1 ; i++)
{
if (ProhibitedPlants_ListBox.getItemState(i)==true )
{
xfa.host.messageBox("Selection"+i);
var nodeRestrict = xfa.resolveNodes("xfa.record.MaterialMaster.ProhibitedPlants<i>.value");
xfa.host.messageBox("Value Selected is: "+nodeRestrict.item(i).value);
PemittedPlants_ListBox.addItem(nodeRestrict.item(i).value, nodeRestrict.item(i).value);
}
else
{
xfa.host.messageBox("No Selection");
}
}
I am suspecting the following lines of codes:
1. var nodeAllow = xfa.resolveNodes("xfa.record.MaterialMaster.PermittedPlants[*].value");//FIrst line in the code
2. var nodeRestrict = xfa.resolveNodes("xfa.record.MaterialMaster.ProhibitedPlants<i>.value"); //THis is inside the for loop in the above coding.
Any help will be highly appreciated.
Thank you
Fahad Hamsa
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.