From: Michele Silva Date: Tue, 24 Jan 2012 18:54:36 +0000 (-0200) Subject: Changed ui controllers to let primefaces handle the pagination. X-Git-Url: http://200.18.67.61/gitweb/?p=simdecs.git;a=commitdiff_plain;h=c9a8e64aaea0e0f7f538d8bdc10053f25a44984c Changed ui controllers to let primefaces handle the pagination. --- 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 03e3170..b18352b 100644 Binary files a/web/img/bn/remove.png and b/web/img/bn/remove.png differ