-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #491 from axonivy-market/add_enterMultipleRows_demo
new EnterMultipleRows Demo
- Loading branch information
Showing
7 changed files
with
264 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...d/ch/ivyteam/htmldialog/demo/input/EnterMulipleRowsDemo/EnterMulipleRowsDemo.rddescriptor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<richDialogDescriptor> | ||
<property> | ||
<name>viewTechnology</name> | ||
<value>JSF</value> | ||
</property> | ||
</richDialogDescriptor> |
83 changes: 83 additions & 0 deletions
83
...s/src_hd/ch/ivyteam/htmldialog/demo/input/EnterMulipleRowsDemo/EnterMulipleRowsDemo.xhtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<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: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> | ||
</h:body> | ||
|
||
</html> |
6 changes: 6 additions & 0 deletions
6
...d/ch/ivyteam/htmldialog/demo/input/EnterMulipleRowsDemo/EnterMulipleRowsDemoData.ivyClass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
EnterMulipleRowsDemoData #class | ||
ch.ivyteam.htmldialog.demo.input.EnterMulipleRowsDemo #namespace | ||
scores List<ch.ivyteam.htmldialog.demo.Score> #field | ||
scores PERSISTENT #fieldModifier | ||
player String #field | ||
player PERSISTENT #fieldModifier |
118 changes: 118 additions & 0 deletions
118
.../ch/ivyteam/htmldialog/demo/input/EnterMulipleRowsDemo/EnterMulipleRowsDemoProcess.p.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
{ | ||
"$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", | ||
"id" : "18C24BCF7C02BFE6", | ||
"kind" : "HTML_DIALOG", | ||
"config" : { | ||
"data" : "ch.ivyteam.htmldialog.demo.input.EnterMulipleRowsDemo.EnterMulipleRowsDemoData" | ||
}, | ||
"elements" : [ { | ||
"id" : "f0", | ||
"type" : "HtmlDialogStart", | ||
"name" : "start()", | ||
"config" : { | ||
"signature" : "start", | ||
"guid" : "18C24BCF7C731527" | ||
}, | ||
"visual" : { | ||
"at" : { "x" : 120, "y" : 64 } | ||
}, | ||
"connect" : [ | ||
{ "id" : "f2", "to" : "f18" } | ||
] | ||
}, { | ||
"id" : "f1", | ||
"type" : "HtmlDialogEnd", | ||
"visual" : { | ||
"at" : { "x" : 376, "y" : 64 } | ||
} | ||
}, { | ||
"id" : "f3", | ||
"type" : "HtmlDialogEventStart", | ||
"name" : "close", | ||
"config" : { | ||
"guid" : "18C24BCF7C94FED3" | ||
}, | ||
"visual" : { | ||
"at" : { "x" : 120, "y" : 288 } | ||
}, | ||
"connect" : [ | ||
{ "id" : "f5", "to" : "f4" } | ||
] | ||
}, { | ||
"id" : "f4", | ||
"type" : "HtmlDialogExit", | ||
"visual" : { | ||
"at" : { "x" : 248, "y" : 288 } | ||
} | ||
}, { | ||
"id" : "f10", | ||
"type" : "HtmlDialogEventStart", | ||
"name" : "addRow", | ||
"config" : { | ||
"guid" : "18C24D01CACDF1BA", | ||
"output" : { | ||
"code" : [ | ||
"import ch.ivyteam.htmldialog.demo.Score;", | ||
"out.scores.add(new Score());" | ||
] | ||
} | ||
}, | ||
"visual" : { | ||
"at" : { "x" : 120, "y" : 144 } | ||
}, | ||
"connect" : [ | ||
{ "id" : "f16", "to" : "f11" } | ||
] | ||
}, { | ||
"id" : "f11", | ||
"type" : "HtmlDialogEnd", | ||
"visual" : { | ||
"at" : { "x" : 248, "y" : 144 } | ||
} | ||
}, { | ||
"id" : "f12", | ||
"type" : "HtmlDialogMethodStart", | ||
"name" : "delRow(Number)", | ||
"config" : { | ||
"signature" : "delRow", | ||
"input" : { | ||
"params" : [ | ||
{ "name" : "index", "type" : "Number", "desc" : "" } | ||
], | ||
"map" : { }, | ||
"code" : "out.scores.removeAt(param.index);" | ||
}, | ||
"guid" : "18C24D01CACEF5FA" | ||
}, | ||
"visual" : { | ||
"at" : { "x" : 120, "y" : 224 } | ||
}, | ||
"connect" : [ | ||
{ "id" : "f17", "to" : "f13" } | ||
] | ||
}, { | ||
"id" : "f13", | ||
"type" : "HtmlDialogEnd", | ||
"visual" : { | ||
"at" : { "x" : 248, "y" : 224 } | ||
} | ||
}, { | ||
"id" : "f18", | ||
"type" : "Script", | ||
"name" : "init", | ||
"config" : { | ||
"output" : { | ||
"code" : [ | ||
"import ch.ivyteam.htmldialog.demo.Score;", | ||
"out.scores.add(new Score());" | ||
] | ||
} | ||
}, | ||
"visual" : { | ||
"at" : { "x" : 248, "y" : 64 } | ||
}, | ||
"connect" : [ | ||
{ "id" : "f19", "to" : "f1" } | ||
] | ||
} ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters