Hi,
Question 1: What is the correct way to reference the 'name' attribute
on the 'RULE-POOL' element in 'ecm-types-contrib.xml'?
You cannot bind individual sub-elements (like the RULE/name field) to a
widget.
Each schema element is seen as an indivisible entity when editing it.
(you cannot edit only parts of a element)
So when you have complex elements in a schema like in your case you need
to bind the complex element to an widget
to edit it as an indivisible entity.
For this you may create a custom JSF widget that is able to show two
text boxes for your 2 sub-elements.
For simple elements like strings it is easy because you can use existing
widgets but for complex elements I think you need
to create your own widgets.
In future we will provide a generic widget for complex types (that will
generate forms to edit a complex type)
but for now we don't have such a widget.
May be people more experienced with JSF can help you on this.
So the question is how a complex field can be bound to an widget or how
can it be edited.
Is nuxeo web framework providing some generic mechanism for this?
Anahide any hint?
When we have the API to set a sub property on a document model, maybe
this will be possible. Currently we're using the current syntax:
<h:inputText value="#{document.schemaName.fieldName}" />
This will trigger the document.setProperty(schemaName, fieldName, value)
when setting the value.
A syntax like would not be able to trigger the setProperty method on the
document:
<h:inputText value="#{document.schemaName.fieldName.subFieldName}" />
Question 2: Is there any documentation on the the '<widget>'s that are
available to use in 'ecm-types-contrib.xml'? Specifically, I would
like to know how to change the display name of this field, so it
doesn't appear to the user as 'RULE-POOL:name', but something more
human-readable, and would also know what types of widgets are
available to display the data.
There is no documentation yet as this mecanism is not done yet: the
layout system is not configurable enough to address non-simple use cases.
If you can, I would suggest that you change your schema for now into:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://policy.policymatter.com"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="qualified">
<xsd:element name="name" type="xsd:string" use="required" />
<xsd:element name="version" type="xsd:string" use="required" />
</xsd:schema>
Regards,
--
Anahide Tchertchian, Nuxeo
Mail: [EMAIL PROTECTED] - Tel: +33 (0)1 40 33 79 87
http://www.nuxeo.com - http://www.nuxeo.org
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm