Skip to content

Commit

Permalink
Fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
ivy-lli committed Dec 4, 2023
1 parent 41aee71 commit b82f83f
Showing 1 changed file with 66 additions and 78 deletions.
Original file line number Diff line number Diff line change
@@ -1,83 +1,71 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:ic="http://ivyteam.ch/jsf/component"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:ic="http://ivyteam.ch/jsf/component" xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions">
<h:body>
<ui:composition template="/layouts/HtmlDemo.xhtml">
<ui:define name="title">EnterMulipleRowsDemo</ui:define>
<ui:param name="centerHeader" value="Enter data in multiple rows" />
<ui:define name="breadcrumb">MulipleRows Demo</ui:define>
<ui:composition template="/layouts/HtmlDemo.xhtml">
<ui:define name="title">EnterMulipleRowsDemo</ui:define>
<ui:param name="centerHeader" value="Enter data in multiple rows" />
<ui:define name="breadcrumb">MulipleRows Demo</ui:define>

<ui:define name="content">
<h:form id="form">
<h:panelGroup layout="block" id="block">
<p>This demo shows a form with a variable number of rows to
enter some data</p>
<p:messages />
<p:fieldset id="player">
<p:outputLabel>
<b>Player</b>
</p:outputLabel>
<p:panelGrid columns="2" layout="grid" style="width:100%"
styleClass="ui-panelgrid-blanks ui-fluid"
columnClasses="ui-g-12 ui-md-3 ui-lg-1, ui-g-12 ui-md-9 ui-lg-10, ui-g-12 ui-md-3 ui-lg-2, ui-g-12 ui-md-9 ui-lg-4">
<p:outputLabel for="playerName" value="Name" />
<p:inputText id="playerName" value="#{data.player}"
required="true">
</p:inputText>
</p:panelGrid>
</p:fieldset>
<p:fieldset id="score">
<p:outputLabel>
<b>Scores</b>
</p:outputLabel>
<br />
<ui:repeat var="score" value="#{data.scores}" varStatus="row">
<p:panelGrid id="score_grid" columns="4" layout="grid"
styleClass="ui-panelgrid-blank ui-fluid"
columnClasses="ui-g-12 ui-md-3 ui-lg-1, ui-g-12 ui-md-9 ui-lg-5, ui-g-12 ui-md-3 ui-lg-1, ui-g-12 ui-md-9 ui-lg-5">
<p:outputLabel value="Date"/>
<p:calendar value="#{score.date}" pattern="dd.MM.yyyy" size="20" id="Date"
required="#{row.index eq 0}"
requiredMessage="Score: At least one score is required">
<f:convertDateTime pattern="dd.MM.yyyy"></f:convertDateTime>
</p:calendar>
<p:outputLabel value="Points" />
<h:panelGroup>
<p:inputText value="#{score.points}" size="20" id="Points"
required="#{row.index eq 0}" requiredMessage="Points is required" converterMessage="Points must be a number"></p:inputText>
<p:commandLink title="Delete this score"
actionListener="#{logic.delRow(row.index)}"
update="form:score" rendered="#{row.index > 0}"
process="@this">
<i class="fa-solid fa-trash" style="margin: 5px" />
</p:commandLink>
</h:panelGroup>
</p:panelGrid>
</ui:repeat>
<p:spacer width="2" />
<p:commandLink id="addRowButton" title="Add a score"
actionListener="#{logic.addRow}" update="form:score"
process="form:score">
<i class="fa-solid fa-add"> </i>
</p:commandLink>
</p:fieldset>
<br />
</h:panelGroup>
<h:panelGrid columns="2">
<p:commandLink id="cancel"
actionListener="#{ivyWorkflowView.cancel()}" value="Cancel "
process="@this" />
<p:commandButton id="submit" actionListener="#{logic.close}"
value="Submit" update="form" icon="pi pi-check" />
</h:panelGrid>
</h:form>
<ui:define name="content">
<h:form id="form">
<h:panelGroup layout="block" id="block">
<p>This demo shows a form with a variable number of rows to
enter some data</p>
<p:messages />
<p:fieldset id="player">
<p:outputLabel>
<b>Player</b>
</p:outputLabel>
<p:panelGrid columns="2" layout="grid" style="width:100%" styleClass="ui-panelgrid-blanks ui-fluid"
columnClasses="ui-g-12 ui-md-3 ui-lg-1, ui-g-12 ui-md-9 ui-lg-10, ui-g-12 ui-md-3 ui-lg-2, ui-g-12 ui-md-9 ui-lg-4">
<p:outputLabel for="playerName" value="Name" />
<p:inputText id="playerName" value="#{data.player}" required="true">
</p:inputText>
</p:panelGrid>
</p:fieldset>
<p:fieldset id="score">
<p:outputLabel>
<b>Scores</b>
</p:outputLabel>
<br />
<ui:repeat var="score" value="#{data.scores}" varStatus="row">
<p:panelGrid id="score_grid" columns="4" layout="grid" styleClass="ui-panelgrid-blank ui-fluid"
columnClasses="ui-g-12 ui-md-3 ui-lg-1, ui-g-12 ui-md-9 ui-lg-5, ui-g-12 ui-md-3 ui-lg-1, ui-g-12 ui-md-9 ui-lg-5">
<p:outputLabel value="Date" />
<p:calendar value="#{score.date}" pattern="dd.MM.yyyy" size="20" id="Date" required="#{row.index eq 0}"
requiredMessage="Score: At least one score is required">
<f:convertDateTime pattern="dd.MM.yyyy"></f:convertDateTime>
</p:calendar>
<p:outputLabel value="Points" />
<h:panelGroup>
<p:inputText value="#{score.points}" size="20" id="Points" required="#{row.index eq 0}"
requiredMessage="Points is required" converterMessage="Points must be a number"></p:inputText>
<p:commandLink title="Delete this score" actionListener="#{logic.delRow(row.index)}"
update="form:score" rendered="#{row.index > 0}" process="@this">
<i class="fa-solid fa-trash" style="margin: 5px" />
</p:commandLink>
</h:panelGroup>
</p:panelGrid>
</ui:repeat>
<p:spacer width="2" />
<p:commandLink id="addRowButton" title="Add a score" actionListener="#{logic.addRow}" update="form:score"
process="form:score">
<i class="fa-solid fa-add"> </i>
</p:commandLink>
</p:fieldset>
<br />
</h:panelGroup>
<h:panelGrid columns="2">
<p:commandLink id="cancel" actionListener="#{ivyWorkflowView.cancel()}" value="Cancel " process="@this" />
<p:commandButton id="submit" actionListener="#{logic.close}" value="Submit" update="form"
icon="pi pi-check" />
</h:panelGrid>
</h:form>

</ui:define>
</ui:composition>
</ui:define>
</ui:composition>
</h:body>

</html>
</html>

0 comments on commit b82f83f

Please sign in to comment.