From c9a8e64aaea0e0f7f538d8bdc10053f25a44984c Mon Sep 17 00:00:00 2001 From: Michele Silva Date: Tue, 24 Jan 2012 16:54:36 -0200 Subject: [PATCH] Changed ui controllers to let primefaces handle the pagination. --- .../org/ufcspa/simdecs/bn/ui/AnswerController.java | 11 +- .../simdecs/bn/ui/BayesianNetworkController.java | 11 +- .../org/ufcspa/simdecs/bn/ui/NodeController.java | 11 +- .../ufcspa/simdecs/bn/ui/QuestionController.java | 11 +- web/bn.xhtml | 456 ++++++++++---------- web/bn/answer/Create.xhtml | 7 +- web/bn/node/Create.xhtml | 7 +- web/bn/question/Create.xhtml | 7 +- web/img/bn/remove.png | Bin 928 -> 344 bytes 9 files changed, 268 insertions(+), 253 deletions(-) diff --git a/src/java/org/ufcspa/simdecs/bn/ui/AnswerController.java b/src/java/org/ufcspa/simdecs/bn/ui/AnswerController.java index ccd3712..3045d8c 100644 --- a/src/java/org/ufcspa/simdecs/bn/ui/AnswerController.java +++ b/src/java/org/ufcspa/simdecs/bn/ui/AnswerController.java @@ -162,14 +162,21 @@ public class AnswerController implements Serializable { } } - public DataModel getItems() { + public DataModel getPaginatedItems() { if (items == null) { items = getPagination().createPageDataModel(); } return items; } + + public DataModel getItems() { + if (items == null) { + items = new ListDataModel(getJpaController().findAnswerEntities()); + } + return items; + } - private void recreateModel() { + public void recreateModel() { items = null; } diff --git a/src/java/org/ufcspa/simdecs/bn/ui/BayesianNetworkController.java b/src/java/org/ufcspa/simdecs/bn/ui/BayesianNetworkController.java index 9dbe96f..019a90f 100644 --- a/src/java/org/ufcspa/simdecs/bn/ui/BayesianNetworkController.java +++ b/src/java/org/ufcspa/simdecs/bn/ui/BayesianNetworkController.java @@ -162,14 +162,21 @@ public class BayesianNetworkController implements Serializable { } } - public DataModel getItems() { + public DataModel getPaginatedItems() { if (items == null) { items = getPagination().createPageDataModel(); } return items; } + + public DataModel getItems() { + if (items == null) { + items = new ListDataModel(getJpaController().findBayesianNetworkEntities()); + } + return items; + } - private void recreateModel() { + public void recreateModel() { items = null; } diff --git a/src/java/org/ufcspa/simdecs/bn/ui/NodeController.java b/src/java/org/ufcspa/simdecs/bn/ui/NodeController.java index 11604a3..f8f82d3 100644 --- a/src/java/org/ufcspa/simdecs/bn/ui/NodeController.java +++ b/src/java/org/ufcspa/simdecs/bn/ui/NodeController.java @@ -168,14 +168,21 @@ public class NodeController implements Serializable { } } - public DataModel getItems() { + public DataModel getPaginatedItems() { if (items == null) { items = getPagination().createPageDataModel(); } return items; } + + public DataModel getItems() { + if (items == null) { + items = new ListDataModel(getJpaController().findNodeEntities()); + } + return items; + } - private void recreateModel() { + public void recreateModel() { items = null; } diff --git a/src/java/org/ufcspa/simdecs/bn/ui/QuestionController.java b/src/java/org/ufcspa/simdecs/bn/ui/QuestionController.java index 711712f..8c53542 100644 --- a/src/java/org/ufcspa/simdecs/bn/ui/QuestionController.java +++ b/src/java/org/ufcspa/simdecs/bn/ui/QuestionController.java @@ -162,14 +162,21 @@ public class QuestionController implements Serializable { } } - public DataModel getItems() { + public DataModel getPaginatedItems() { if (items == null) { items = getPagination().createPageDataModel(); } return items; } - private void recreateModel() { + public DataModel getItems() { + if (items == null) { + items = new ListDataModel(getJpaController().findQuestionEntities()); + } + return items; + } + + public void recreateModel() { items = null; } diff --git a/web/bn.xhtml b/web/bn.xhtml index 91d29ea..e4df77e 100644 --- a/web/bn.xhtml +++ b/web/bn.xhtml @@ -9,267 +9,263 @@ -

SimDeCS - Cadastro de Redes Bayesianas

- +

SimDeCS - Cadastro de Redes Bayesianas

+ + + + + + fileUploadListener="#{fileUploadController.handleFileUpload}" + image="/img/bn/browse.png" customUI="true" + multiple="true" label="Selecione..." allowTypes="*.xml;" description="Images" + update="tabView"/> Enviar Redes Bayesianas + style="font-weight:bold;color:#616D7E">Enviar Redes Bayesianas -
- - - - + +

+ +
+ + + - - -

- -
- - - + + + + + - + + + + + + + + + + + + + + + + + + + + +
- + +

+ +
+ + + + - - + rowEditListener="#{nodeController.rowEditListener}"> + + + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + -
- - - - -

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +

+ +
+
+ + + +

+ +
+ + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + - + + - - -

- -
- -
- - -

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- -
-
- - -

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +

+ +
+
+ + + +

+ +
+ + + + + + + - - - - - - - -

- -
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ +
+
diff --git a/web/bn/answer/Create.xhtml b/web/bn/answer/Create.xhtml index 90e700c..9f24209 100644 --- a/web/bn/answer/Create.xhtml +++ b/web/bn/answer/Create.xhtml @@ -27,13 +27,10 @@
- +

- -
-
- + diff --git a/web/bn/node/Create.xhtml b/web/bn/node/Create.xhtml index 9c8ad32..69cd073 100644 --- a/web/bn/node/Create.xhtml +++ b/web/bn/node/Create.xhtml @@ -31,13 +31,10 @@
- +

- -
-
- + diff --git a/web/bn/question/Create.xhtml b/web/bn/question/Create.xhtml index cdcbc6e..c81855c 100644 --- a/web/bn/question/Create.xhtml +++ b/web/bn/question/Create.xhtml @@ -25,13 +25,10 @@
- +

- -
-
- + diff --git a/web/img/bn/remove.png b/web/img/bn/remove.png index 03e317066d577609e5a3d77bf0663b9dfc14fdbd..b18352b718ff31476f080b3af15d1696076b511a 100644 GIT binary patch literal 344 zcmV-e0jK_nP)yU5JXEA5{X12 z`3(L53ySawDBvpy3eDdjkw_#GcYR^g3#AlDsA@XmGE8>n_I48trPS>j?ic+(9+9SL zRaGky1^rY6b*5?deZNeBqo8l57|W$LP1Clm>$>o+>+rxK(==((^SmGkK1Rre)QMpn z$6*+3+qNuA{OEBU?{y(4iUOykXy7L+%d&%qXe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