Skip to content

Commit

Permalink
Implement one more scenario by using the business process to navigate…
Browse files Browse the repository at this point in the history
… between master and dialog.

Clean up and streamline more. Put hardcoded labels to CMS. Remove inline editing, as it's not related to master-detail demo.
  • Loading branch information
ivy-tru committed Jun 29, 2023
1 parent 06891a9 commit d1787a4
Show file tree
Hide file tree
Showing 8 changed files with 209 additions and 294 deletions.
4 changes: 4 additions & 0 deletions master-detail-demo/cms/cms_en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ Dialogs:
save: Save
state: State
title: Stateful Datatable
tooltipAddNewByDialog: Add new product by using a modal dialog.
tooltipEditByLink: Edit product by navigation to a new process start link.
tooltipEditThroughProcess: Edit product by navigation through business process.
tooltipEditWithViews: Edit product by navigation through multiple views of same Axon Ivy dialog.
validThrough: Valid Through
'yes': 'Yes'
Labels:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
MasterDetailDemoData #class
com.axonivy.demo #namespace
lazyDataModel com.axonivy.demo.masterdetail.ui.ProductLazyDataModel #field
productID String #field
76 changes: 38 additions & 38 deletions master-detail-demo/processes/MasterDetailDemo.p.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,36 @@
"config" : {
"callSignature" : "showProductList",
"outLink" : "showProductList.ivp",
"input" : {
"code" : [
"import com.axonivy.demo.masterdetail.ui.ProductRepoLazyDataModel;",
"",
"out.lazyDataModel = new ProductRepoLazyDataModel();"
]
},
"startName" : "Show Product List"
},
"visual" : {
"at" : { "x" : 104, "y" : 160 }
"at" : { "x" : 104, "y" : 80 }
},
"connect" : { "id" : "f8", "to" : "f7" }
}, {
"id" : "f6",
"type" : "TaskEnd",
"visual" : {
"at" : { "x" : 360, "y" : 160 }
"at" : { "x" : 544, "y" : 80 }
}
}, {
"id" : "f7",
"type" : "DialogCall",
"name" : "List all products",
"config" : {
"dialogId" : "com.axonivy.demo.masterdetail.ProductList",
"startMethod" : "start(com.axonivy.demo.masterdetail.ui.ProductLazyDataModel)",
"call" : {
"params" : [
{ "name" : "lazyModel", "type" : "com.axonivy.demo.masterdetail.ui.ProductLazyDataModel" }
],
"startMethod" : "start()",
"output" : {
"map" : {
"param.lazyModel" : "in.lazyDataModel"
"out" : "in",
"out.productID" : "result.selectedProductId"
}
}
},
"visual" : {
"at" : { "x" : 232, "y" : 160 }
"at" : { "x" : 232, "y" : 80 }
},
"connect" : { "id" : "f9", "to" : "f6" }
"connect" : { "id" : "f13", "to" : "f12" }
}, {
"id" : "f0",
"type" : "RequestStart",
Expand All @@ -68,15 +59,9 @@
"showInStartList" : false
},
"visual" : {
"at" : { "x" : 104, "y" : 256 }
"at" : { "x" : 104, "y" : 304 }
},
"connect" : { "id" : "f3", "to" : "f2" }
}, {
"id" : "f1",
"type" : "TaskEnd",
"visual" : {
"at" : { "x" : 544, "y" : 256 }
}
}, {
"id" : "f2",
"type" : "DialogCall",
Expand All @@ -94,30 +79,45 @@
}
},
"visual" : {
"at" : { "x" : 232, "y" : 256 }
"at" : { "x" : 232, "y" : 304 }
},
"connect" : { "id" : "f11", "to" : "f10" }
"connect" : { "id" : "f15", "to" : "f7" }
}, {
"id" : "f10",
"id" : "f12",
"type" : "Alternative",
"visual" : {
"at" : { "x" : 424, "y" : 80 }
},
"connect" : [
{ "id" : "f17", "to" : "f6", "label" : {
"name" : "exit"
}, "condition" : "in.productID.length() == 0" },
{ "id" : "f9", "to" : "f14", "label" : {
"name" : [
"edit",
"product"
]
} }
]
}, {
"id" : "f14",
"type" : "DialogCall",
"name" : "List all products",
"name" : "Product Detail",
"config" : {
"dialogId" : "com.axonivy.demo.masterdetail.ProductList",
"startMethod" : "start(com.axonivy.demo.masterdetail.ui.ProductLazyDataModel)",
"dialogId" : "com.axonivy.demo.masterdetail.ProductDetail",
"startMethod" : "start(String)",
"call" : {
"params" : [
{ "name" : "lazyModel", "type" : "com.axonivy.demo.masterdetail.ui.ProductLazyDataModel" }
{ "name" : "id", "type" : "String" }
],
"code" : [
"import com.axonivy.demo.masterdetail.ui.ProductRepoLazyDataModel;",
"",
"param.lazyModel = new ProductRepoLazyDataModel();"
]
"map" : {
"param.id" : "in.productID"
}
}
},
"visual" : {
"at" : { "x" : 408, "y" : 256 }
"at" : { "x" : 424, "y" : 200 }
},
"connect" : { "id" : "f4", "to" : "f1" }
"connect" : { "id" : "f16", "to" : "f7", "via" : [ { "x" : 248, "y" : 200 } ] }
} ]
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,9 @@
</div>
<div class="ui-g">
<div class="ui-g-12">
<p:commandButton id="saveProduct" value="Save" styleClass="buttonMargin"
icon="fa fa-check" iconPos="right"
actionListener="#{logic.save}" style="float:right" />
<p:commandButton value="Cancel" icon="fa fa-times" iconPos="right" style="float:right"
actionListener="#{logic.close}"/>
<p:commandButton id="saveProduct" value="#{ivy.cms.co('/Dialogs/com/axonivy/demo/masterdetail/ui/ProductList/save')}" styleClass="buttonMargin"
icon="fa fa-check" actionListener="#{logic.save}" style="float:right" />
<p:commandButton value="#{ivy.cms.co('/Dialogs/com/axonivy/demo/masterdetail/ui/ProductList/cancel')}" icon="fa fa-times" style="float:right" actionListener="#{logic.close}"/>
</div>
</div>
</h:form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,10 @@
</div>
<div class="ui-g">
<div class="ui-g-12">
<p:commandButton id="saveProduct" value="#{ivy.cms.co('/Dialogs/com/axonivy/demo/masterdetail/ui/ProductList/save')}" styleClass="buttonMargin"
icon="fa fa-check" iconPos="right"
actionListener="#{logic.save}" action="ProductList" style="float:right" />
<p:commandButton value="#{ivy.cms.co('/Dialogs/com/axonivy/demo/masterdetail/ui/ProductList/cancel')}" icon="fa fa-times" iconPos="right" style="float:right"
action="ProductList" />
<p:commandButton id="saveProduct" value="#{ivy.cms.co('/Dialogs/com/axonivy/demo/masterdetail/ui/ProductList/save')}"
styleClass="buttonMargin" icon="fa fa-check" actionListener="#{logic.save}" action="ProductList" style="float:right" />
<p:commandButton value="#{ivy.cms.co('/Dialogs/com/axonivy/demo/masterdetail/ui/ProductList/cancel')}"
icon="fa fa-times" style="float:right" action="ProductList" />
</div>
</div>
</h:form>
Expand Down
Loading

0 comments on commit d1787a4

Please sign in to comment.