fix selection

This commit is contained in:
Anton Romanov 2020-04-24 13:06:06 +04:00
parent 9f21850767
commit 6b717f26d3

View File

@ -13,7 +13,10 @@
<div class="ui-fluid">
<div class="ui-g">
<div class="ui-md-5 ui-g-12">
<p:inputText placeholder="Создать новую статью" value="#{papersView.newPaperTitle}"/>
<p:inputText placeholder="Создать новую статью" id="newPaperName"
value="#{papersView.newPaperTitle}" required="true"
requiredMessage="Введите название новой статьи"/>
<p:message for="newPaperName"/>
</div>
<div class="ui-md-2 ui-g-12">
<p:commandButton action="#{papersView.create}" value="Создать" ajax="true" process="@form"
@ -23,8 +26,9 @@
<div class="ui-md-3 ui-g-12">
<p:commandButton value="Удалить выделенные" id="papersRemoveButton"
disabled="#{papersView.selectedPapers.isEmpty()}"
action="#{papersView.deleteSelected}" ajax="true" process="@form"
update="messages @form">
action="#{papersView.deleteSelected}" ajax="true"
process="mainForm:papersRemoveButton"
update="messages mainForm:papersTable">
<p:confirm header="Подтверждение" message="Удалить выделенные статьи?"
icon="pi pi-exclamation-triangle"/>
</p:commandButton>
@ -32,7 +36,7 @@
<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
<p:commandButton value="Да" type="button" styleClass="ui-confirmdialog-yes" icon="pi pi-check"/>
<p:commandButton value="Нет" type="button" styleClass="ui-confirmdialog-no" icon="pi pi-times"/>
</p:confirmDialog>te
</p:confirmDialog>
</div>
<p:dataTable value="#{papersView.papers}" var="paper" paginator="true" paginatorPosition="bottom"
@ -46,10 +50,11 @@
placeholder="Строка поиска..."/>
</p:outputPanel>
</f:facet>
<p:ajax event="rowSelect" update="mainForm:papersRemoveButton" process="@form"/>
<p:ajax event="rowSelectCheckbox" update="mainForm:papersRemoveButton" process="@form"/>
<p:ajax event="rowUnselectCheckbox" update="mainForm:papersRemoveButton" process="@form"/>
<p:ajax event="rowUnselect" update="mainForm:papersRemoveButton" process="@form"/>
<p:ajax event="rowSelect" update="mainForm:papersRemoveButton" process="mainForm:papersTable"/>
<p:ajax event="rowSelectCheckbox" update="mainForm:papersRemoveButton" process="mainForm:papersTable"/>
<p:ajax event="rowUnselectCheckbox" update="mainForm:papersRemoveButton"
process="mainForm:papersTable"/>
<p:ajax event="rowUnselect" update="mainForm:papersRemoveButton" process="mainForm:papersTable"/>
<p:column selectionMode="multiple" style="width:16px;text-align:center"/>
<p:column headerText="Название" filterBy="#{paper.title}" filterMatchMode="contains">
<h:outputLink value="/paper/paper.xhtml">