-1

We are using Primefaces Datatable component where the values are coming from a database. in our xx.xhtml file below code is present

<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 this page is rendered on the browser we have seen a hidden field is created as below..

<input type="hidden" id="formId:activitydescription_selection" name="formId:activitydescription_selection" autocomplete="off" value="" /></div><script id="formId:activitydescription_s" type="text/javascript">

The field is created dynamically when the datatable component is rendered on browser. So is there any way we can avoid this hidden field to be created.?

I hope i have rephrased my query very clearly.

Any help would be really appreciated.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Joy Chowdhury
  • 73
  • 1
  • 10
  • 1
    Could you try to rephrase the question? I don't understand it at least. You want to acces the value of the activitydescription:Selection field? – W vd L May 18 '15 at 11:58
  • There is one major question in there that you should ask yourself... Please do ;-) – Kukeltje May 19 '15 at 06:26
  • Please enhance your question and refer to you hdiv post – Kukeltje May 19 '15 at 06:40
  • What exactly is your problem with that hidden field? Don't you want the `p:dataTable` being able to prepare values for `selection` attribute? I really don't understand starters asking "How to avoid X" where X is fundamental for the functioning. – BalusC May 19 '15 at 19:15
  • @BalusC: the new super duper framework he uses chockes on it: http://stackoverflow.com/questions/30298563/how-to-ignore-validation-in-hdiv-when-integrating-with-primefaces-datatable-comp Not sure about some of the so called advantages of this framework if you already use jsf and 'think' about what you develop – Kukeltje May 19 '15 at 19:28
  • :o Well, Joy, those are perhaps enlightenend readings: http://stackoverflow.com/q/7722159, http://stackoverflow.com/q/23167104, http://stackoverflow.com/q/4421839 and http://stackoverflow.com/a/5475564 – BalusC May 19 '15 at 19:33
  • @thanks BalusC for the links. – Joy Chowdhury May 19 '15 at 19:57
  • Yes @Kukeltje you are right ..was trying to integrate HDIV filter with Primeface and then this problem came. – Joy Chowdhury May 19 '15 at 19:58

1 Answers1

0

You can't, this field is needed for the component to function correctly. But.... You can always download the source, implement a different solution and file a patch...

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
  • if answers are 'good', please accept them and upvote if it was realy helpful. That is good practice in StackOverflow – Kukeltje May 21 '15 at 00:06