Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Problem with the dropdown list

Avatar

Level 2

Hi,

I am working on live cycle designer 8.2

The issue that i am facing is as follows:

I have a drop down field in my form which has four vlaues : Fixed,calculated, User specified and department specified.

Based on the values selected new text fields appear and old one gets reset.

This drop down is present in a repeatable fragment.

If dropdown value =Fixed >> Textfield named Value appears ; class-name disappears and gets reset

If dropdown value =Calculated >> Textfield named class-name appears; vlaue field gets reset and disappears

If dropdown value =user specified or department >> Textfield named Value and class name should disappear and get reset to blank

I am able to achieve this if i have only one fragment.

if i repeat this fragment and try to select drop down vlaue as user specified the Vlaue text field that was present in teh previous window gets reset to blank

this happens for both vlaue field as well as calculated field.

I want that if i repeat this fragment the drop down value should not affect the value in previous fragment.

Please suggest.

I have attached the form for reference.

Thanks in advance

5 Replies

Avatar

Former Community Member

Each field in the subform has a unique somExpression to describe it. You will have to address the field by it complete expression. You can get this by adding a line of script to the enter event of the dropdown.

app.alert(this.somExpression)

Add a couple of those subforms and then access the dropdown. An alert with the somExpression for that field will appear. Note that the names are the same but you will see occurance numbers on the repeating subform. These must be incorporated into your commands to affect the right fields.

To get the instance of the subform that you are on you can use:

this.parent.index

So modify your commands toi look like this:

xfa.resolveNode("service-configuration.mainSubForm.payment-component.component[" + this.parent.index + "]").value_sub.presence

= "visible";

Paul

Avatar

Level 2

Hi,

I tried doing this. But unable to get the desired result.

I think I am doing some mistake to get the address of the field.

Please suggest

Thanks and Regards,

-Soni Gupta

Avatar

Level 2

Hi,

I am unable to resolve how to reset fields of repeatable fragments.

Can you please provide me syntax of how to reset the data of a field in current instance of a form

Help from your end would be really appreciated.

Thanks and Regards,

-Soni Gupta

Avatar

Former Community Member

There were numerous syntax errors in the script as well as you shoudl never use a dash in a field name (it gets interpretted as a minus sign by javascript). I renamed the fields with dashes to underscore and fixed the code .....I think it works as you wanted .....see attached modified sample.

Paul

Avatar

Level 2

Thanks paul for the help.

Can you also tell me how to reset field values if we have multiple instance of the subform.

I tried doing that but whenever I edit the code it flags run time error and my form becomes zero byte and I have to start again from scratch.

Since you have the form with you. I can explain the problem.

The problem is that when I repeat my form fragment, fields like service window class name, form name, form code, LC URL, and all other fields of that section get reset only for first occurrence not on every instance.

To get the "resetData" code working on every instance what should I do..?

I am relatively new to the technology so I would really appreciate if you can guide me.

My form has dependency on fields like form type(Main Form) and form already exists(Yes/No) fields.

If form is a main form few subforms appear and if it main form all the forms appear.

So to have the combination of form exists-yes , form type= main form

Form Exists : Yes Yes No No

Form Type : Main form Subform Main form Sub form

These vertical combinations have various fields dependency.

And I am not able to reset the data in other occurrence of form.

I can reset data only on first occurrence.