12-02-2016 05:21 AM
I want to edit some values of form fields when a user views an existing node (view mode). In edit mode I don´t want to modify these values... My
Currently, I have configured a form filter for changing some form field values.
<bean id="formFilter"
class="xxx"
parent="baseFormFilter">
<property name="filterRegistry" ref="nodeFilterRegistry" />
</bean>
I have implemented the method, but this method runs in view and edit mode
public void afterGenerate(final ItemType item, final List<String> fields, final List<String> forcedFields,
final Form form, final Map<String, Object> context) {
How can I differentiate these two modes?
I know that it is possible to define fields for certain modes (example: <show id="cm:creator" for-mode="view" />) in the share-config.xml, but maybe this information (if the user views or edit a node) is only available in Share, not in the repository?
Thanks
Jens
12-02-2016 05:36 AM
You cannot - the Repository-tier filters are oblivious to the mode the form is to be displayed in. That information is not even passed to the Repository-tier. What I typically do when I need some specially constructed values for read-only views is to generate transient fields in the form and configure those fields (instead of the actual property) in the view form in Share.
12-02-2016 05:36 AM
You cannot - the Repository-tier filters are oblivious to the mode the form is to be displayed in. That information is not even passed to the Repository-tier. What I typically do when I need some specially constructed values for read-only views is to generate transient fields in the form and configure those fields (instead of the actual property) in the view form in Share.
12-02-2016 07:40 AM
12-02-2016 07:57 AM
Not really. But it is effectively not different to what a transient field processor would do - create the field definition and add it to the form, and additionally add the data for it to the form as well.
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.