Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to avoid some parameters from HDIV validations #82

Closed
jchowdhary opened this issue May 19, 2015 · 10 comments
Closed

how to avoid some parameters from HDIV validations #82

jchowdhary opened this issue May 19, 2015 · 10 comments

Comments

@jchowdhary
Copy link

I am using Primefaces Datatable component.
<p:dataTable id="activitydescription" var="type"
value="#{activityBean.activityList}" rows="#{activityBean.rowNo}" rowKey="#{type.activitySchemeId}"

This data table component creates a hidden field dynamically on the browser.

HDIV prevents and display the error page by sending this on console
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

so how we an avoid using validation for these type of parameters...
i have used
hdiv:paramsWithoutValidation
<hdiv:mapping url=".*" parameters="formId:activitydescription_selection"/>
/hdiv:paramsWithoutValidation
bu still no luck..can somebody provide some pointers

@fernandolozano
Copy link

Hello,

You can solve this problem in two different ways:

  • In the hdiv-config.xml, you can define your parameter as startParameter, it will never be validated:
<hdiv:startParameters>formId:activitydescription_selection</hdiv:startParameters>
  • In the hdiv-config.xml, you can leave your parameter without validation for the view that you want:
<hdiv:paramsWithoutValidation>
    <hdiv:mapping url="/hseadmin/pages/secured/admin/Layout.xhtml" parameters="formId:activitydescription_selection" />
</hdiv:paramsWithoutValidation>

I hope it helps.

@jchowdhary
Copy link
Author

Thanks fernandolozano, infact i tried putting the below script in my initial question but somehow it didn't came up..

<hdiv:paramsWithoutValidation>
    <hdiv:mapping url="/hseadmin/pages/secured/admin/Layout.xhtml" parameters="formId:activitydescription_selection" />
</hdiv:paramsWithoutValidation>

Still no luck when i used it , So if i do this , do i need to update

<hdiv:editableValidations registerDefaults="true">
    <hdiv:validationRule url=".*" parameters="formId:activitydescription_selection"       
     enableDefaults="false" \>
</hdiv:editableValidations>

pls. confirm

@fernandolozano
Copy link

My previous solution works for all frameworks except JSF. In this case you can only use <hdiv:startParameters> configuration option.

@jchowdhary
Copy link
Author

Hi fernando,I will try this piece as you advised...
One question..Can we place multiple hdiv:startParameters or if i need to put multiple parameters can we do it coma seperated or what is the way...

@fernandolozano
Copy link

You can do it like this:

<hdiv:startParameters>parameter1,parameter2</hdiv:startParameters>

@jchowdhary
Copy link
Author

thanks fernando, i will try this step and let you know the outcome :-)
Just a query i am using HDIV 2.1.8 jars but when i use hdiv:validationRule url=".*" parameters="formId:activitydescription_selection"
error message suggest , parameters is not allowed here...

is it something done in new version of HDIV ?

@fernandolozano
Copy link

In the newest versions of HDIV there is no work done in this area but I would recommend you to update to the last HDIV version.

@jchowdhary
Copy link
Author

thanks fernando, startParameters worked :-)
But i am stuck with another problem ,where the javascript create dynamic parameter name like
"tabView:j_id1219615953_33c666f2_input" or "tabView:j_id1219615953_33c7782_input"

is there any way we can use wildcard for parameter name like
<h:startParameters>tabView*</hdiv:startParameters> can you suggest something how we can ignore these type of parameter name.

@fernandolozano
Copy link

You can use any Java regular expression (Java Regex).

@jchowdhary
Copy link
Author

hmm...can you share some examplle with reges used within startParameters, as <h:startParameters>tabView*</hdiv:startParameters> is not working..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants