Next we extend the target path. We need to extend the target path to ensure the form item value is processed by the Marshaller attached to the Pod-Container. The Marshaller is configured to process a number of specific target paths. Example 7.3 shows how to extend the target path in the correct format.
038 String targetPathExt = 039 "choice/" + field.getID() + "/selected-options"; 040 Path targetPath = 041 field.getBinding().getTargetPath().extendPath(targetPathExt); 042 fieldBuilder.setTargetPath(targetPath);
choice/ podId / filterId /selected-options /option-value |--1--| --2--| ---3----| --------4-------| -----5------|
The extended target path is broken in to what are known as steps which are divided by the '/' character. Each step in our target path is defined below.
Step | Description |
---|---|
1 | This acts as the marker for the marshal. The 'choice' text indicates that this field is to be processed by the Pod-Container. |
2 | Contains the unique identifier (as specified in the PodType codetable) for the Pod to which the filter is attached. E.g. PT9001 |
3 | Contains the unique identifier for the filter attached to the Pod. This Id is created when the PodFilter is constructed in the PodLoader. |
4 | The selected-options step indicates that this is a filter. Knowing this, the infrastructure will process the form values as a Pod filter. |
5 | The option-value step is optional and is used to uniquely identify selections in multi-select filters. E.g a checkbox filter can select more than 1 value, so each option gets an option-value step to distinguish it from it's siblings. |
In our code extract in Example 7.3 we have extended the target path using the id passed from the PodFiltersRenderer to map our text input form item. At runtime its value will be...
choice/PT9001/title/selections