jsf 2 - Primefaces: selecting rows from nested DataTables -
I am using Primefaces 3.4 and Groovy. I created the object My idea is to have DataTables like: I want to be able to select an attachment per part. Issue: Only first section 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 I'm still looking for an answer, but I've got an alternate solution. Then, in my backing bean (manager), I have implemented 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)}
& 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;
selected attachments is set to the last selected attachment it happens!
getRowData as many as I do for the hit
& 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;
onRowSelect / onRowUnselect to add / remove my selections from a map. The attachment has an ID key and the attachment value is.
Comments
Post a Comment