How to ignore validation in HDIV when integrating with primefaces datatable component

给你一囗甜甜゛ 提交于 2019-12-11 07:28:47

问题


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



来源:https://stackoverflow.com/questions/30298563/how-to-ignore-validation-in-hdiv-when-integrating-with-primefaces-datatable-comp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!