How to display subwidget's label of a widget List when empty
Hello everyone,
I am trying to change the display of one widget. Here is my configuration on studio:
- Widget type “List” - Display “Table” on a complex multivalued field. With “Hide Label” checked and “Hide subwidgets labels” at “No”.
Here is what I see when i log on to the plateform:
- View mode (all i can see is a bar, not showing the user there's tons of things to fill in here)
- Edit mode (here is what I would like to have on view mode! Well without the “Add” button of )
I would like to see on view mode, even when my field is empty, subwidgets labels.
How can I achieve that ? Is there an existing “custom properties” for this ?
Thank for your answer.
Hi, When there are no values to display in view mode, the widget will not show subwidget labels. You can always take example on the original xhtml template to reference a custom template changing the behaviour. Depending on your target version, you can find the original file at https://github.com/nuxeo/nuxeo/blob/release-8.10/nuxeo-jsf/nuxeo-platform-forms-layout-client/src/main/resources/web/nuxeo.war/widgets/js_list_widget_template.xhtml for 8.10 for instance. Note l.59:
ui:fragment rendered="#{displaySubLabels and (isEditMode or not empty fieldOrValue)}"
I suggest that you rename the template to avoid overriding the behaviour of the widget in all cases.
Hope this helps