Hello All,
I am fairly new to Livecycle (designer now) and am having a small issue with a table on my form. I have created 4 radio buttons which correspond to 4 different currencies.
I have the table below this in a different subform which contains on one row qty, unit cost and sub total fields. Through the magic of java on the radio button change script I have managed to have the GST and Grant total subforms disappear when another currency is selected and the locale of these currency fields change depending on currency, so the formatting of the prices changes for Euro or AUD etc.
The problem occurs when I add a new row to the table using add instance buttons, it defaults back to AUD. The top line is correct but all subsequently added rows are back to AUD settings. Is there a way I can add into the script for it to change the locale for all subsequent instances?
Here is the code I added to the change script of the radio buttons.
form1.MainPage.UserInformationTable.Table1.Row8.Currency.CurrencyRB::change - (JavaScript, client)
if (this.rawValue == "AUD")
{
form1.MainPage.GST.presence= "visible";
form1.MainPage.TotalincGST.presence= "visible";
form1.MainPage.Itemtable.ItemTable.Row1.SubtotalCalc.locale= "en_AU";
form1.MainPage.Itemtable.ItemTable.Row1.UnitcostTxt.locale= "en_AU";
form1.MainPage.Itemtable.ItemTable.Grandtotal.Grandtotal.locale= "en_AU";
}
else if (this.rawValue == "EUR")
{
form1.MainPage.GST.presence= "hidden";
form1.MainPage.TotalincGST.presence= "hidden";
form1.MainPage.Itemtable.ItemTable.Row1.SubtotalCalc.locale= "fr_FR";
form1.MainPage.Itemtable.ItemTable.Row1.UnitcostTxt.locale= "fr_FR";
form1.MainPage.Itemtable.ItemTable.Grandtotal.Grandtotal.locale= "fr_FR";
}
else if (this.rawValue == "USD")
{
form1.MainPage.GST.presence= "hidden";
form1.MainPage.TotalincGST.presence= "hidden";
form1.MainPage.Itemtable.ItemTable.Row1.SubtotalCalc.locale= "en_US";
form1.MainPage.Itemtable.ItemTable.Row1.UnitcostTxt.locale= "en_US";
form1.MainPage.Itemtable.ItemTable.Grandtotal.Grandtotal.locale= "en_US";
}
else if (this.rawValue == "CHF")
{
form1.MainPage.GST.presence= "hidden";
form1.MainPage.TotalincGST.presence= "hidden";
form1.MainPage.Itemtable.ItemTable.Row1.SubtotalCalc.locale= "de_CH";
form1.MainPage.Itemtable.ItemTable.Row1.UnitcostTxt.locale= "de_CH";
form1.MainPage.Itemtable.ItemTable.Grandtotal.Grandtotal.locale= "de_CH";
}
As I said i am new to this and am sure there is a more elegant way of doing this, I have tried removing the three object references and simply changing the local of the table or the subform but this doesn't seem to work.
Any assistance on this would be much appreciated!!
Best Regards
Paul