Skip to content

Instantly share code, notes, and snippets.

@KiryhaPikoff
Created May 26, 2020 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KiryhaPikoff/8a48ad558b084cadbf4c75db0865226f to your computer and use it in GitHub Desktop.
Save KiryhaPikoff/8a48ad558b084cadbf4c75db0865226f to your computer and use it in GitHub Desktop.
<p:panelGrid columns="2" style="width:100%; align-items: stretch;" columnClasses="half-column">
<p:dataScroller value="#{medicalServiceCreationBean.medicamentsInstock}" var="medicamentCount"
chunkSize="10"
style="width: 100%">
<f:facet name="header">
Выберите медикаменты:
</f:facet>
<h:panelGrid columns="2" style="width:100%;" columnClasses="detail,buttons">
<p:outputPanel>
<h:panelGrid columns="2" cellpadding="5">
<h:outputText value="Название: " />
<h:outputText value="#{medicamentCount}" />
<h:outputText value="Количество: " />
<h:outputText value="#{medicamentCount.count} шт." />
</h:panelGrid>
</p:outputPanel>
<p:outputPanel>
<p:spinner id="countSpinner" value="#{medicalServiceCreationBean.count}" min="1" max="#{medicamentCount.count}"/>
&lt;!&ndash; Наверное будет баг с последним количеством &ndash;&gt;
<p:commandButton value="Добавить" update=":mainForm:mainPanel" action="#{medicalServiceCreationBean.addToSelected(medicamentCount)}" />
</p:outputPanel>
</h:panelGrid>
</p:dataScroller>
<p:dataScroller id="selectedDataScroller" value="#{medicalServiceCreationBean.selectedMedicaments}" var="selectedMedicament"
chunkSize="10"
style="width: 100%;">
<f:facet name="header">
Вы выбрали:
</f:facet>
<h:panelGrid columns="2" style="width:100%" columnClasses="logo,detail">
<p:outputPanel>
<h:panelGrid columns="2" cellpadding="5">
<h:outputText value="Название: " />
<h:outputText value="#{selectedMedicament}" />
<h:outputText value="Количество: " />
<h:outputText value="#{selectedMedicament.count} шт." />
</h:panelGrid>
</p:outputPanel>
<p:outputPanel style="align-content: center">
<p:commandButton value="Убрать" update=":mainForm:mainPanel" action="#{medicalServiceCreationBean.removeFromSelected(selectedMedicament)}" />
</p:outputPanel>
</h:panelGrid>
</p:dataScroller>
</p:panelGrid>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment