jsf 2 - Primefaces: selecting rows from nested DataTables -


I am using Primefaces 3.4 and Groovy. I created the object part and the attachment :

  square section {attachment selectedAttachment from the list & lt; Attachment & gt; Attachment = [] AttachmentDataModel getAttachmentModel ()} class attachment {string fileName string filetype string description} {new attachmentDataModel (return)}   

My idea is to have DataTables like:

  & lt; P: DataTable value = "# {mybean.parts}" var = "part" provided = "# {mybean.attachmentsFound}" & gt; & Lt; P: column & gt; & Lt; P: DataTable var = "attachment" selectionMode = "single" value = "# {part.attachmentModel}" selection = "# {part.selectedAttachment}" & gt; & Lt; P: column headerText = "file name" & gt; # {Attachment.fileName} & lt; / P: column & gt; & Lt; P: column headerText = "file description" style = "width: 200px" & gt; # {Attachment.description} & lt; / P: column & gt; & Lt; P: column headerText = "file type" style = "width: 20px" & gt; # {Attachment.fileType} & lt; / P: column & gt; & Lt; / P: DataTable & gt; & Lt; / P: column & gt; & Lt; / P: DataTable & gt;   

I want to be able to select an attachment per part.

Issue: Only first section selected attachments is set to the last selected attachment it happens!

Question: How can I enable the example of each part to save my selected attachment? Thanks for your time

Note: .. If I debug my AttachmentDataModel, I'm seeing getRowData as many as I do for the hit

I'm still looking for an answer, but I've got an alternate solution.

  & lt; P: I changed my mind to DataTable value = "# {mybean.parts}" var = "part" sung = "# {mybean.attachmentsFound}" & gt; & Lt; P: column & gt; & Lt; P: DataTable var = "attachment" selectionMode = "single" value = "# {part.attachmentModel}" selection = "# {part.selectedAttachment}" & gt; & Lt ;! - Carcond - & gt; & Lt; P: ajax event = "select row" listener = "# {mybean.onRowSelect}" /> & Lt; P: ajax event = "lineAniaSell" listener = "# {mybean.onRowUnselect}" /> & Lt ;! / / Carcond - & gt; & Lt; P: column headerText = "file name" & gt; # {Attachment.fileName} & lt; / P: column & gt; & Lt; P: column headerText = "file description" style = "width: 200px" & gt; # {Attachment.description} & lt; / P: column & gt; & Lt; P: column headerText = "file type" style = "width: 20px" & gt; # {Attachment.fileType} & lt; / P: column & gt; & Lt; / P: DataTable & gt; & Lt; / P: column & gt; & Lt; / P: DataTable & gt;   

Then, in my backing bean (manager), I have implemented onRowSelect / onRowUnselect to add / remove my selections from a map. The attachment has an ID key and the attachment value is.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -