How to ignore validation in HDIV when integrating

2019-08-13 00:39发布

问题:

I am using Primefaces Datatable component. This data table component creates a hidden field dynamically on the browser.

<input type="hidden" id="formId:activitydescription_selection" name="formId:activitydescription_selection" autocomplete="off" value="" />

The Primefaces datatable code is as follows

<p:dataTable  id="activitydescription" var="type"
            value="#{activityBean.activityList}" rows="#{activityBean.rowNo}" rowKey="#{type.activitySchemeId}"
            selection="#{activityBean.activityDTO}"
            emptyMessage="No value found with given criteria"
            paginatorPosition="bottom" sortMode="single" paginator="#{empty activityBean.activityList ? 'false':'true' }"
            dynamic="true"
            paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"
            rowIndexVar="rowIndex">

Now when the page is submitted HIDV thinks the hidden field which is created dynamically on the browser is a case of hacking thereby redirecting to error page with the console log as

org.hdiv.logs.Logger log INVALID_PARAMETER_NAME;/hseadmin/pages/secured/admin/Layout.xhtml;**formId:activitydescription_selection**;;0:0:0:0:0:0:0:1;0:0:0:0:0:0:0:1;anonymous

In my hdiv-config.xml file i have modified the file so that HDIV ignore thi validation where this field occurs

<hdiv:paramsWithoutValidation>
         <hdiv:mapping url=".*"  parameters="formId:activitydescription_selection"/>
        </hdiv:paramsWithoutValidation>

But no luck still the same console error and HDIV is redirecting to error page. Can someone help me out on how to avoid these validations on HDIV?

回答1:

try..

<property name="userStartParameters">  
<list>
  <value>hidden1Name</value>
  <value>hidden2Name</value>
</list>
</property>


回答2:

HDIV doesn't support the Primefaces components, only standard JSF components like <h:dataTable>.

http://www.hdiv.org/hdiv-documentation-single/doc.html