cancel
Showing results for 
Search instead for 
Did you mean: 

How to use widget List without studio

geekonspace
Star Contributor
Star Contributor

Hi, I want to use this widget in a view jsf but I dont know how to configure this without nuxeo studio. I have defined a document in nuxeo studio and it has a schema "myschema" and field "myfield". Now I want show this field in my view view.xhtml but without use documentLayout tag because only have to show one field and field has to be a list widget.

My configurations: -myschema:telefonos multi valued in nuxeo studio -mydocument type in nuxeo studio

-In my plugin: layout definition:

	<layout name="telefonos">
		<templates>
			<template mode="any">/layouts/layout_default_template.xhtml
			</template>
		</templates>
		<rows>
			<row>
				<widget>listArrayWidget</widget>
			</row>
		</rows>
		<widget name="listArrayWidget" type="list">
			<labels>
				<label mode="any">Teléfonos</label>
			</labels>
			<translated>false</translated>
			<fields>
				<field>data.telefonos</field>
			</fields>
			<properties widgetMode="edit">
				<property name="required">true</property>
			</properties>
			<properties widgetMode="any">
				<property name="hideSubLabels">true</property>
			</properties>
			<subWidgets>
				<widget name="listItem" type="text">
					<fields>
						<field></field>
					</fields>
					<labels>
						<label mode="any"></label>
					</labels>
					<properties widgetMode="edit">
						<property name="required">true</property>
						<property name="validator">#{dmValidatorBean.validateTelefono}</property>
					</properties>
				</widget>
			</subWidgets>
		</widget>
	</layout>

-In my view xhtml:

<a4j:outputPanel ajaxRendered="true">
<nxl:layout name="telefonos" mode="edit" value="#{mySolicitud.currentDocNuxeo}" />
</a4j:outputPanel>

This is showed well in my wizard but when press save button, the changes are not saved. Only are saved the fields text, datetime ... Someone can help me?

1 ACCEPTED ANSWER

Marwane_K_A_
Star Contributor
Star Contributor

Hi,

Here is the documentation you're looking for.

For this kind of problems the Platform Explorer is very useful: assuming you already know how to create and use a widget through XML (otherwise, you'll have to read this), see this page to find examples of widgets that use the "list" widget type in Nuxeo.

The layout showcase can also be useful.

Here is one:

   <widget name="dr_listing_no_comments" type="list">
    <labels>
      <label mode="any">label.content.header.comments</label>
    </labels>
    <translated>true</translated>
    <fields>
     <field>data.document.tkst.comments</field>
    </fields>
    <properties widgetMode="edit">
      <property name="orderable">false</property>
      <property name="diff">false</property>
      <property name="display">table</property>
      <property name="required">false</property>
      <property name="hideSubLabels">true</property>
    </properties>
    <properties mode="any"/>
    <subWidgets>
      <widget name="sub0" type="text">
        <labels>
          <label mode="any"/>
        </labels>
        <translated>false</translated>
        <fields>
          <field/>
        </fields>
        <properties mode="any"/>
      </widget>
    </subWidgets>
  </widget>

Is your property is just a list of strings, you can get things done by just copy/pasting and tweaking the above XML.

View answer in original post

3 REPLIES 3

Marwane_K_A_
Star Contributor
Star Contributor

Hi,

Here is the documentation you're looking for.

For this kind of problems the Platform Explorer is very useful: assuming you already know how to create and use a widget through XML (otherwise, you'll have to read this), see this page to find examples of widgets that use the "list" widget type in Nuxeo.

The layout showcase can also be useful.

Here is one:

   <widget name="dr_listing_no_comments" type="list">
    <labels>
      <label mode="any">label.content.header.comments</label>
    </labels>
    <translated>true</translated>
    <fields>
     <field>data.document.tkst.comments</field>
    </fields>
    <properties widgetMode="edit">
      <property name="orderable">false</property>
      <property name="diff">false</property>
      <property name="display">table</property>
      <property name="required">false</property>
      <property name="hideSubLabels">true</property>
    </properties>
    <properties mode="any"/>
    <subWidgets>
      <widget name="sub0" type="text">
        <labels>
          <label mode="any"/>
        </labels>
        <translated>false</translated>
        <fields>
          <field/>
        </fields>
        <properties mode="any"/>
      </widget>
    </subWidgets>
  </widget>

Is your property is just a list of strings, you can get things done by just copy/pasting and tweaking the above XML.

Hi, it works but in my attribute field I wrote this

geekonspace
Star Contributor
Star Contributor

Hi in my field attribute wrote this

Getting started

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.