cancel
Showing results for 
Search instead for 
Did you mean: 

Enumerated DropDown List - WD4A - Maintaining value on form

Former Member
0 Kudos

Hello:

I have some questions about setting values in an enumerated dropdown list in a sample program using WD4A. Designer 7.1 ZCI Layout and Library WD Native.

In the DOINIT method, to populate the dropdown lilst on the form, I have loaded and binded the WD context with data from the backend system.

The PDF Source has been created as an attribute of type XSTRING.

When the form appears, the dropdown list correctly appears with its values. In the form, the binding is done using dynamic properties.

Question 1 --

I have not been able to set the lead selection in WD so that the a value appears by default rather than have an empty selection. How to do this? In WD or Javascript?

When I press the Submit button, and load other data from from the backend system, any selection from the dropdown list disappears.

Question 2 --

What is the best practice to retain the selected values from the dropdown list.

Question 3 --

What is the best practice to validate screen data on the form - the Check Fields button (validation in formCalc or Javascript) or the Submit button? If one uses the Submit button, what is the best way to distinquish between validation and saving data to the backend system.

Can someone provide detail when to use JS or formCalc?

Thanks to all,

John

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks Swathi for your replies...

Please explain more regarding "Now u set the context element of DDL in the event which is used to call the pdf".

I have bound the DDL in the component controller and the view. In the Comp Controller WDDOPOSTPROCESSING event, I have set the lead selection and the debugger shows this value as well.

How about in the Designer? I have used dynamic binding.

Thanks for your help.

john

Former Member
0 Kudos

Differnce between JS and formcalc ---

If you are developing forms for use with a server-based process (for example, using Adobe document services), with the intent of rendering your forms in HTML, you should develop your calculations and scripts in JavaScript.

FormCalc treats each new line in the Script Editor as a new expression to evaluate.

FormCalc

-Native Adobe calculation language valid in Designer and Adobe document services

-Shorter scripts (typically one line only)

-Contains a variety of useful built-in functions to reduce the amount of scripting required to accomplish common form design tasks

-Support for international dates, times, currencies, and number formats

-Built-in URL functions for Post, Put, and Get allow web-based interactions

Compatible on all Designer and Adobe document services supported platforms

Javascript

-Standard scripting language used in many popular software applications

-Potential for longer scripts if necessary with the ability to use looping

-Provides access to the Acrobat Object Model and the JavaScript capabilities of Acrobat

-Debugging possible using Acrobat JavaScript debugger

-Create custom functions for your own specific needs

-Compatible on all Designer and Adobe document services supported platforms

Swathi

Do offer pts:-)

Former Member
0 Kudos

Hi ,

Starting form first :

you can set the default value of the dropdown in WD .As u have a context attribute for the DDL .Bind the context to the controller too .Now u set the conetxt element of DDL in the event which is used to call the pdf.

1.

-When u submit the pdf and call backend data to retain the DDL values.

You can create a method like setForm()

which sets the values entered or selected in the pdf again in WD implementation.

Now when u submit the form and call backend method.Call the setform() method before to retain the values.

2.

Best way to retain values is setting a method which sets the values for the context elements after every kind of action.

3.

Best way to validate date depends on the kind of application and form u building .when u using submit to validate and saving .I would suggest u use a validation method in WD rather than interactive form validation for controls.

Because all the test cases wouldnt be working .The validation data pattern u can set is of only one type like

dd-mm-yyyy .It doesnt check for spl chars etc.So its always better u use a WD method before saving .

Cheers

Swathi

Do offer pts:-)