Skip to content

Commit

Permalink
closes #10241 (#10242)
Browse files Browse the repository at this point in the history
  • Loading branch information
DamithDeshan authored Jan 26, 2025
1 parent 0c0d559 commit 5dbfd5a
Showing 1 changed file with 88 additions and 28 deletions.
116 changes: 88 additions & 28 deletions src/main/webapp/admin/lims/report_template_names.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:ez="http://xmlns.jcp.org/jsf/composite/ezcomp"
xmlns:autocomplete="http://xmlns.jcp.org/jsf/composite/autocomplete">
xmlns:f="http://xmlns.jcp.org/jsf/core">

<h:body>
<ui:composition template="/admin/lims/index.xhtml">
Expand All @@ -15,33 +13,95 @@
<p:panel header="Manage Report Template Names" >
<p:focus id="selectFocus" for="lstSelect" />
<p:focus id="detailFocus" for="txtName" />
<p:panelGrid columns="2" styleClass="alignTop">
<p:panel >
<p:selectOneListbox id="lstSelect" value="#{reportFormatController.current}" styleClass="listBox">
<f:selectItems value="#{reportFormatController.items}" var="myItem" itemValue="#{myItem}" itemLabel="#{myItem.name}" ></f:selectItems>
<f:ajax render=":#{p:resolveFirstComponentWithId('gpDetail',view).clientId}" execute="lstSelect" >
</f:ajax>
</p:selectOneListbox>
<p:commandButton id="btnAdd" ajax="false" value="Add" action="#{reportFormatController.prepareAdd()}" styleClass="buttons" >


<div class="row">
<div class="col-md-5">

<p:commandButton
id="btnAdd"
value="Add New"
action="#{reportFormatController.prepareAdd()}"
class="ui-button-success"
update="lstSelect gpDetail"
icon="fa fa-plus"
process="btnAdd">
</p:commandButton>
<p:commandButton id="btnDelete" ajax="false" onclick="if (!confirm('Are you sure you want to delete this record?'))
return false;" action="#{reportFormatController.delete()}" value="Delete" >

<p:commandButton
id="btnDelete"
icon="fa fa-trash"
onclick="if (!confirm('Are you sure you want to delete this record?'))
return false;"
action="#{reportFormatController.delete()}"
value="Delete"
update="lstSelect gpDetail msg" process="btnDelete"
class=" m-1 ui-button-danger w-25">
</p:commandButton>
</p:panel>
<p:panel style="float: right;display: block;">
<h:panelGrid id="gpDetail" columns="2" >
<h:outputText id="lblName" value="Name" ></h:outputText>
<p:inputText autocomplete="off" id="txtName" value="#{reportFormatController.current.name}" ></p:inputText>
<h:outputText id="lblCode" value="Code" >
</h:outputText>
<p:inputTextarea id="txtCode" value="#{reportFormatController.current.description}" >
</p:inputTextarea>
<p:commandButton ajax="false" id="btnSave" value="Save" action="#{reportFormatController.saveSelected()}" styleClass="buttons" >
</p:commandButton>
<p:defaultCommand target="btnSave"/>
</h:panelGrid>
</p:panel>
</p:panelGrid>

<p:selectOneListbox
id="lstSelect"
value="#{reportFormatController.current}"
class="w-100 mt-3"
filter="true">
<f:selectItems value="#{reportFormatController.items}" var="myItem" itemValue="#{myItem}" itemLabel="#{myItem.name}" ></f:selectItems>
<p:ajax update="gpDetail" process="lstSelect" >
</p:ajax>
</p:selectOneListbox>
</div>

<div class="col-md-7">
<p:panel class="w-100 form-control m-1" id="gpDetail" header="Details of the Template">
<div class="d-flex">
<h:outputText id="lblName" class="col-3 mt-2" value="Name" ></h:outputText>
<p:inputText
autocomplete="off"
id="txtName"
class="w-100"
value="#{reportFormatController.current.name}" >
</p:inputText>
</div>

<div class="d-flex mt-2">
<h:outputText id="lblCode" class="col-3 mt-2" value="Code" ></h:outputText>
<p:inputText
id="txtCode"
class="w-100"
value="#{reportFormatController.current.description}" >
</p:inputText>
</div>

<div class="d-flex mt-2">
<h:outputText id="lblsite" class="col-3 mt-2" value="Site" ></h:outputText>
<p:autoComplete
class="w-100"
inputStyleClass="w-100"
completeMethod="#{institutionController.completeSite}"
var="site"
itemLabel="#{site.name}"
itemValue="#{site}"
forceSelection="true"
value="#{reportFormatController.current.institution}" >
</p:autoComplete>

</div>

<div class="d-flex mt-4 justify-content-end">
<p:commandButton
id="btnSave"
value="Save"
action="#{reportFormatController.saveSelected()}"
process="btnSave gpDetail"
update="lstSelect msg"
class=" m-1 ui-button-warning w-25"
icon="fas fa-save">
</p:commandButton>
</div>

</p:panel>
</div>
</div>

</p:panel>
</h:form>
</ui:define>
Expand Down

0 comments on commit 5dbfd5a

Please sign in to comment.