Hi All.
In my LiveCycle Designer form would like to add two ComboBox and one TextBox1. First ComboBox will have list of devices (PC, Printer, Other). Second ComboBox will have list of models of device. For instance, in ComboBox1 selected PC then ComboBox2 will fill by model of PC.
Let say, if ComboBox1 selected PC so ComboBox2 will have GX300, GX400, GX500.
If ComboBox1 selected Printer so ComboBox2 will have AA11, BB11,CC22, FF44.
If ComboBox1 selected Other so ComboBox2 is collapsed and TextBox1 will appears on same place where was ComboBox2.
If is it possible how it to do? I will appreciate for sample.
Thanks.
Views
Replies
Total Likes
Hi,
Here are a couple of examples that show how to script addItems() for dropdowns:
Then there is an example that shows how you can use the presence property: http://assure.ly/h7whb8.
Niall
Views
Replies
Total Likes
Hi Niall. Thanks for replay.
Now in my form I have subform with DeviceComboBox, ModelComboBox and ModelTextBox. And I would like when user select PC the ModelComboBox will visible and ModelTextBox invisible. If other ModelComboBox will invisible and ModelTextBox visible. My code looks like:
var oAssemblyModel = {
PC: [ ["GX150"], ["GX240"]],
Printer: [ [" "]],
Scanner: [ [" "]]
};
function SetModelNo()
{
ModelNoComboBox.clearItems();
ModelNoComboBox.rawValue = null;
var aParts = oAssemblyModel[xfa.event.change];
if(aParts && aParts.length)
{
for(var i=0; i<aParts.length; i++)
ModelNoComboBox.addItem(aParts[i][0]);
}
}
form1.#subform[0].ModelNoSubform[0].DeviceComboBox::change - (JavaScript, client)
SetModelExample.SetModelNo();
if(ModelNoSubform.DeviceComboBox.rawValue = "PC")
{
ModelNoComboBox.presence = "visible";
ModelNoTextBox.presence = "invisible";
}
else
{
ModelNoComboBox.presence = "invisible";
ModelNoTextBox.presence = "visible";
}
How to fix that problem?
Thanks.
Views
Replies
Total Likes
Hi,
I can't get to Designer at the moment, but a few things.
In your script in the change event, you are using .rawValue. However at this stage the change is not committed to the object, so .rawValue will not work. You could move the script to the exit event OR of you leave it in the change event, you would need to test against xfa.event.newText, eg:
if (xfa.event.newText == "PC") {
// your script
}
In addition please note that when testing a condition you need a double equals (as a minimum, there are other operators). See above.
Good luck,
Niall
Views
Replies
Total Likes