<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Nuxeo IDE Document CrossValidation in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-ide-document-crossvalidation/m-p/315398#M2399</link>
    <description>&lt;P&gt;Hello,
I'm trying to make a validation of a custom document based on a cross validation (make a validation on a field based on what the user has filled on a second one).
I made this technique based on a post here : &lt;A href="http://www.nuxeo.com/blog/cross-validation-with-jsf/"&gt;http://www.nuxeo.com/blog/cross-validation-with-jsf/&lt;/A&gt;.  -&amp;gt; An hidden field, that has two attributes that have the value of the fields I want to check.&lt;/P&gt;
&lt;P&gt;This works fine in one case:  two fields, a widget of type single vocabulary radio and the other of type single vocabulary
But doesn't work with: two fields: a widget document suggestion (that has a "Document page provider name" that will query the database) and the other of  type single vocabulary.&lt;/P&gt;
&lt;P&gt;Here is the xhtml of template:&lt;/P&gt;
&lt;DIV F="http://java.sun.com/jsf/core" H="http://java.sun.com/jsf/html" C="http://java.sun.com/jstl/core"&gt;
&lt;IF test="#{widget.mode == 'edit'}"&gt;
&lt;INPUTHIDDEN value="needed" validator="#{nomenclature_liste_nomenclature.validaterListeEtNomenclatureLiee}" id="#{widget.id}"&gt;
&lt;ATTRIBUTE name="firstElts" value="#{layout.widgetMap['nomenclature_liee'].id}"&gt;&lt;/ATTRIBUTE&gt;
&lt;ATTRIBUTE name="secondElts" value="#{layout.widgetMap['type_de_metadonnees'].id}"&gt;&lt;/ATTRIBUTE&gt;
&lt;/INPUTHIDDEN&gt;
&lt;MESSAGE for="#{widget.id}" styleclass="errorMessage"&gt;&lt;/MESSAGE&gt;
&lt;/IF&gt;
&lt;/DIV&gt;
&lt;P&gt;When I try the retrieve the value  I have a null object on the fields that has the document suggestion:
String inputId = (String) attributes.get(componentId);
UIInput component = (UIInput) anchor.findComponent(inputId);
if(component != null)
{
return component.getLocalValue();
}&lt;/P&gt;
&lt;P&gt;Can somewone help me?&lt;/P&gt;</description>
    <pubDate>Thu, 28 Apr 2016 08:12:05 GMT</pubDate>
    <dc:creator>Guillaume_Estev</dc:creator>
    <dc:date>2016-04-28T08:12:05Z</dc:date>
    <item>
      <title>Nuxeo IDE Document CrossValidation</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-ide-document-crossvalidation/m-p/315398#M2399</link>
      <description>&lt;P&gt;Hello,
I'm trying to make a validation of a custom document based on a cross validation (make a validation on a field based on what the user has filled on a second one).
I made this technique based on a post here : &lt;A href="http://www.nuxeo.com/blog/cross-validation-with-jsf/"&gt;http://www.nuxeo.com/blog/cross-validation-with-jsf/&lt;/A&gt;.  -&amp;gt; An hidden field, that has two attributes that have the value of the fields I want to check.&lt;/P&gt;
&lt;P&gt;This works fine in one case:  two fields, a widget of type single vocabulary radio and the other of type single vocabulary
But doesn't work with: two fields: a widget document suggestion (that has a "Document page provider name" that will query the database) and the other of  type single vocabulary.&lt;/P&gt;
&lt;P&gt;Here is the xhtml of template:&lt;/P&gt;
&lt;DIV F="http://java.sun.com/jsf/core" H="http://java.sun.com/jsf/html" C="http://java.sun.com/jstl/core"&gt;
&lt;IF test="#{widget.mode == 'edit'}"&gt;
&lt;INPUTHIDDEN value="needed" validator="#{nomenclature_liste_nomenclature.validaterListeEtNomenclatureLiee}" id="#{widget.id}"&gt;
&lt;ATTRIBUTE name="firstElts" value="#{layout.widgetMap['nomenclature_liee'].id}"&gt;&lt;/ATTRIBUTE&gt;
&lt;ATTRIBUTE name="secondElts" value="#{layout.widgetMap['type_de_metadonnees'].id}"&gt;&lt;/ATTRIBUTE&gt;
&lt;/INPUTHIDDEN&gt;
&lt;MESSAGE for="#{widget.id}" styleclass="errorMessage"&gt;&lt;/MESSAGE&gt;
&lt;/IF&gt;
&lt;/DIV&gt;
&lt;P&gt;When I try the retrieve the value  I have a null object on the fields that has the document suggestion:
String inputId = (String) attributes.get(componentId);
UIInput component = (UIInput) anchor.findComponent(inputId);
if(component != null)
{
return component.getLocalValue();
}&lt;/P&gt;
&lt;P&gt;Can somewone help me?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2016 08:12:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-ide-document-crossvalidation/m-p/315398#M2399</guid>
      <dc:creator>Guillaume_Estev</dc:creator>
      <dc:date>2016-04-28T08:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Nuxeo IDE Document CrossValidation</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-ide-document-crossvalidation/m-p/315399#M2400</link>
      <description>&lt;P&gt;Here is the xhtml of template:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;div xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jstl/core"&amp;gt;
&amp;lt;c:if test="#{widget.mode == 'edit'}"&amp;gt;
&amp;lt;h:inputHidden value="needed" validator="#{nomenclature_liste_nomenclature.validaterListeEtNomenclatureLiee}"
id="#{widget.id}"&amp;gt;
&amp;lt;f:attribute name="firstElt"
value="#{layout.widgetMap['nomenclature_liee'].id}" /&amp;gt;
&amp;lt;f:attribute name="secondElt"
value="#{layout.widgetMap['type_de_metadonnees'].id}" /&amp;gt;
&amp;lt;/h:inputHidden&amp;gt;
&amp;lt;h:message for="#{widget.id}" styleClass="errorMessage" /&amp;gt;
&amp;lt;/c:if&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Java code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;	public static Object retrieveInputComponentValue(UIComponent anchor, String componentId) {
		Map&amp;lt;String,Object&amp;gt; attributes = anchor.getAttributes();

		if(attributes != null)
		{
			String inputId = (String) attributes.get(componentId);

			UIInput component = (UIInput) anchor.findComponent(inputId);
			if(component != null)
			{
				return component.getLocalValue();
			}
		}
		return null;
	}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Apr 2016 08:14:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-ide-document-crossvalidation/m-p/315399#M2400</guid>
      <dc:creator>Guillaume_Estev</dc:creator>
      <dc:date>2016-04-28T08:14:51Z</dc:date>
    </item>
  </channel>
</rss>

