I have a table which contains a dropdown, and on the change event of the dropdown it shows and hides various sub forms depending on the selection. The row in which this dropdown lives is repeatable. The first dropdown does as its told, but the second and subsequent ones do not - and I know it is because I am not referencing it correctly and it is looking at the first instance only. I have honestly scoured for hours on this one, but I get confused between [*], _subform, , resolveNodes, resolveNode etc.
Is anyone able to explain to me in simple terms how to reference the dropdown / subforms so it executes the change event in all instances? Or how to reference a repeating object in general?
Hi, so basically what you need is to check the instance number of your Main.tblPartV.Row1 and then reference your Main.sfAccount with that number using resolveNode. Your key to this is .instanceIndex. So if your ddType is located under the Main.tblPartV.Row1, your code will look something like this:
Fair enough - I think I'm just over this one We are blocked from anything Google or DropBox-like here I work for a global firm and they are very strict on that stuff. I'll try and explain better but if it still doesn't make sense, don't worry - I might just find another way to do it!
Table with repeating row is within Main. So Main.tblPartV.Row1 It also has an account number field within that row and a dropdown (ddType) which holds the selections "Individual, Company, Joint" etc.
Further down the page is a subform called sfAccount (so Main.sfAccount) and along with an account number field (which is visible) it contains 5 hidden tables (Individual, Company, Joint etc). These hidden tables will show or hide depending on the selection from ddType back up in tblPartV. For the first line, all works well.
When the "add row" button is clicked up in tblPartV, it not only adds another row to the table (so a new ddType will appear), it also adds another instance of sfAccount further down. The account number for each line in tblPartV is replicated via the exit event to the new instances of the sfAccount account number fieldsbut when I try and select a change in the new ddType in the new row created in tbPartV , no new table is shown in sf Account - I just see the new instance of sfAccount , the account number - but no table.
So I just need to tell the new instance of ddType to look at the new instances of all the tables - and show them when they are supposed to!
Even writing that exhausted me....too hard for a Friday arvo, right?
I think this whole referencing business is going to kill me. I have to travel interstate next week and I have downloaded a truckload of You Tube clips on it to watch on the plane try and wrap my brain around it!!
I have the reference of the subforms ok - what I can't manage is to reference the repeats...and I did try the [*] but I have probably put it in the wrong spot. This is what I have:
Repeating row that contains the dropdown is: Main.tblPartV.Row1
The dropdown has selections (will only name a couple) "Company" "Individual" "Joint"
sfAccount contains tblCompany, tblIndividual and tblJoint tables that should turn on and off as per the selection from the dropdown
So my "add row" button not only adds a row to tblPartV (and subsequently another dropdown) it (should) also add a separate instance of either Individual, Joint or Company. The instances add fine, but it the dd doesn't work because my change event just has: