Personnalisation de base > User Interface Customization > Constructing Wizards > Client Generated Form Data > Solution
  
Solution
The solution involves three or four application-provided parts:
1. Define hidden table columns for the tables that are to appear in the wizard and supply default values for the cells in those columns (by associating an appropriate data utility with those columns). You may use an existing data utility if appropriate, but it is more likely that you will provide a new, custom, application-specific data utility to fulfill this need.
This step is optional and may be omitted in some cases. If your application adds hidden values for table(s) that appear in your wizard, but those values are associated with the entire table and not any specific row(s) in the table, then there is no means by which to supply a server-generated default value, and you will not need to perform this step. In that case, your client-side logic will add one or more hidden input values to the form data, identifying each value as pertaining to a specific table, if necessary.
If your application requires hidden input values that are associated with specific rows in a table, you may define one or more hidden columns in that table and have your client-side logic manipulate the values in the cells in those columns. Your table builder must associate some data utility with each column, and that data utility must return a non-null value for each object in the table (otherwise, no corresponding field for the object will be present in the client's data store). If you need to supply a per-object default value, then use a data utility that returns the required value.
2. Add a <script/> block to your wizard's JSP file that loads an application-provided JavaScript file which will contain your custom, hidden-data manipulating logic.
3. Create the JavaScript file that contains your custom, hidden-data manipulating logic.
4. Modify your wizard's form processor to extract the hidden data fields from the submitted form and perform the required processing on those fields.
Prerequisite Knowledge
To achieve this result, you need to understand:
Basic development of Windchill web pages
JavaScript
JCA/MVC table builders
JCA Form Processing
Solution Elements
Element
Type
Description
<MyTableBuilder.java>
Java class
This file defines the table that appears in your application's wizard. You will modify this class to include definitions for hidden table columns for which the server will provide default values. This element is optional, and is not required if your application does not need per-table-row hidden values.
<MyScript.js>
JavaScript
This file will contain your application's client-side logic that adds, modifies, or removes hidden inputs from the form data submitted to the server.
<MyWizard.jsp>
JSP
This file defines your wizard's page. You will modify this file to include a <script/> block that loads your JavaScript file containing the logic to manipulate the hidden data elements.
<MyFormProcessor.java>
Java class
This file will contain your application's form processor for the form data sent by the wizard to the server. In this class you will extract and process the hidden data that was generated or manipulated by your client-side JavaScript logic.
Client Generated Form Data