These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Subform relative reference

cyprd
Registered: Oct 21 2008
Posts: 49

Hi,

I was experimenting with noderesolve and I have some stuff that I can not figure out.
Scenario that I am developing is, that you have a repeating subform with some elements in it. One of the elements is drop-down list box. I have managed to make sure, that only last one is enabled (active to the user). Now, I have remove button in that subform, that removes that specific instance.
The drop-down consists of number row e.g. 1..5 If you pick 2 in the fisrt occurance, in the new subform the number 2 won't be available.
I have also managed, that when you delete specific instance, the number that was selected returns to the array of available numbers (stored in hidden textfield).
My question is, how can I force to populate the drop-down in the last occurance. I would like to clearItems and than manually populate it again from updated array.
Problem I am facing is how to targer that specific element.

The hierarchy is:

Subform "repeater"
-sub "pt1"
-element drop-down list
-sub "pt2" (elements are not important)
-sub (untitled subform)
-element delete button

--- out of the repeater subform ---
-element add new occurance of repeater button

Advices would be highly appreciated. I want to populate the drop-down list element in the last occurance of repetative subform "repeater" through action click on the delete button in subform "(untitled subform)" in any occurance exept the last one.

Thanks

J.

Adobe LiveCycle ES 8.2.1 (JBoss & Win)

My Product Information:
LiveCycle Designer, Windows
cyprd
Registered: Oct 21 2008
Posts: 49
I did solve it finally.
If you neded the code, post something here.

J.

Adobe LiveCycle ES 8.2.1 (JBoss & Win)

Vin2k4u
Registered: Feb 12 2009
Posts: 5
Hi - Even i am looking something similar to your requirement, i.e. could want to catch the dynamic instance of the subform value and validate. It will great if you can share your thoughts.

Regards
Vinodh
cyprd
Registered: Oct 21 2008
Posts: 49
Vin2k4u wrote:
Hi - Even i am looking something similar to your requirement, i.e. could want to catch the dynamic instance of the subform value and validate. It will great if you can share your thoughts.Regards
Vinodh
Hi Vinodh,

I will post the code and hiarchy soon so you can check if the same principle works for you too.
Best,

J.

Adobe LiveCycle ES 8.2.1 (JBoss & Win)

cyprd
Registered: Oct 21 2008
Posts: 49
I will post the form section here this evening, that would be the easiest way...
J.

Adobe LiveCycle ES 8.2.1 (JBoss & Win)

suewhitehead
Registered: Jun 3 2008
Posts: 232
I am looking for an answer to something like this. Have you figured it out yet?
cyprd
Registered: Oct 21 2008
Posts: 49
suewhitehead wrote:
I am looking for an answer to something like this. Have you figured it out yet?
Hi,

sorry for delay. Here is the snippet of the form that I have been working on. I had to translate some stuff to english. I didnt bother too much, the script still contain variables and functions in CZECH, but I was trying to explain stuff in ENGLISH in commented sections.

The scritp works, but is not cleaned out of not used parts of the script that I used for debug etc.. so please ignore that...

File can be downloaded from here: http://www.cyprd.cz/example.pdf

It is a dynamic form and it contain just a snippet of the actual form.
Let me know if you need some more explanation (if comments in script are not enough)

The behaveiour should be, like this:

- user selects one type of whatever which is represented by number. Once number is selected or text is written, both fields becomes mandatory

- remove button is visible only if there are two or more occurances of the subform

- user can not add multiple instances of the subform without selecting the number from the drop down first

- once subform is added, drop down list in the one before last becomes unavailable and the dropdown list is updated

- once any subform occurance is removed, last drop down list becomes available and is updated (the number in the removed subform is populated back to the list)

I think that this is all. There are three hidden fields idx, idxx and idxxx, sorry for such a bad example, I was copying over the same hidden field (was lazy to set preferences over and over) during the debug and once it started to work, I did not bother to rename them. Basicaly, one contains the list of available numbers from where the drop down is updated (initialized) another one contains the selected value from the dropdown (is included in the subform occurance) and I can address it directy if I want the value and last one is for checking if subform can be removed or added (i guess)
More info in the script...

J.


Edit:
Just found a bug in this example, if last subform is removed with the empty space, user can not add another one and it is NOT intended to have last occurance of the drop down again user accessible once it was made read only (it was specification from the customer)

Oh one more thing, excuse my scritp, I am not a programmer

Adobe LiveCycle ES 8.2.1 (JBoss & Win)

cyprd
Registered: Oct 21 2008
Posts: 49
I did fix the bug and removed the empty class number (space character) from the drop-down.
If anyone is interested, I can repost the form section here again.

J.

Adobe LiveCycle ES 8.2.1 (JBoss & Win)