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) View mode
  • Edit mode (here is what I would like to have on view mode! Well without the “Add” button of ) Edit mode

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.

0 votes

1 answers

951 views

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

1 votes



Thanks for your answer, I'll try that !
05/12/2017

Tried it and it's working, thanks ! However I didn't change the template name, so I'm overriding the behaviour (because I want this behaviour to apply in all cases and also because I wasn't sure on how to use it if I renamed it)
05/12/2017