You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2019/01/11 08:24:48 UTC
[myfaces-tobago] branch master updated (9a54e84 -> 4e60324)
This is an automated email from the ASF dual-hosted git repository.
lofwyr pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git.
from 9a54e84 cleanup: remove deprecated code
new e4b9b2a TOBAGO-1970: Configure web.xml listeners via JARs (for Mojarra, MyFaces, OWB, etc.)
new c6f6f91 TOBAGO-1973: AJAX inside <tc:selectOneChoice> inside a "begin"/"after" facet doesn't work
new 4e60324 optimize code
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../renderer/SelectOneChoiceInsideInRenderer.java | 5 ++++
.../renderer/SelectOneChoiceRenderer.java | 2 +-
tobago-example/pom.xml | 31 +++-------------------
.../tobago/example/demo/GroupController.java | 26 +++++++++++-------
.../src/main/webapp/WEB-INF/web.xml | 8 ++----
5 files changed, 28 insertions(+), 44 deletions(-)
[myfaces-tobago] 02/03: TOBAGO-1973: AJAX inside
inside a "begin"/"after" facet doesn't work
Posted by lo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git
commit c6f6f91a5e8a1524f8b6873de71f3dd0ffd97418
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Thu Jan 10 17:32:10 2019 +0100
TOBAGO-1973: AJAX inside <tc:selectOneChoice> inside a "begin"/"after" facet doesn't work
---
.../internal/renderkit/renderer/SelectOneChoiceInsideInRenderer.java | 5 +++++
.../tobago/internal/renderkit/renderer/SelectOneChoiceRenderer.java | 2 +-
.../java/org/apache/myfaces/tobago/example/demo/GroupController.java | 1 +
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneChoiceInsideInRenderer.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneChoiceInsideInRenderer.java
index 14a3a1c..ac0d7ac 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneChoiceInsideInRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneChoiceInsideInRenderer.java
@@ -43,4 +43,9 @@ public class SelectOneChoiceInsideInRenderer extends SelectOneChoiceRenderer {
protected CssItem[] getCssItems(final FacesContext facesContext, final UISelectOneChoice select) {
return new CssItem[]{BootstrapClass.CUSTOM_SELECT};
}
+
+ @Override
+ protected String getFieldId(final FacesContext facesContext, final UIComponent component) {
+ return component.getClientId(facesContext);
+ }
}
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneChoiceRenderer.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneChoiceRenderer.java
index 0362945..1b4b444 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneChoiceRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneChoiceRenderer.java
@@ -52,7 +52,7 @@ public class SelectOneChoiceRenderer extends SelectOneRendererBase {
final TobagoResponseWriter writer = getResponseWriter(facesContext);
final String clientId = select.getClientId(facesContext);
- final String fieldId = select.getFieldId(facesContext);
+ final String fieldId = getFieldId(facesContext, select);
final Iterable<SelectItem> items = SelectItemUtils.getItemIterator(facesContext, select);
final String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, select);
final boolean disabled = !items.iterator().hasNext() || select.isDisabled() || select.isReadonly();
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/GroupController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/GroupController.java
index b710c69..cf6e971 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/GroupController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/GroupController.java
@@ -58,6 +58,7 @@ public class GroupController implements Serializable {
sendTo = "";
value = 1000.0;
currency = Currency.getInstance("EUR");
+ compute();
}
public String getChatlog() {
[myfaces-tobago] 03/03: optimize code
Posted by lo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git
commit 4e60324199bd3764d1fa7a623cbb73be301e1ebe
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Thu Jan 10 17:37:55 2019 +0100
optimize code
---
.../tobago/example/demo/GroupController.java | 25 +++++++++++++---------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/GroupController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/GroupController.java
index cf6e971..92d7ac7 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/GroupController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/GroupController.java
@@ -103,16 +103,21 @@ public class GroupController implements Serializable {
}
private void compute() {
- if (currency.getCurrencyCode().equals("JPY")) {
- valueInEuro = value * 0.00884806667;
- } else if (currency.getCurrencyCode().equals("TTD")) {
- valueInEuro = value * 0.133748824;
- } else if (currency.getCurrencyCode().equals("USD")) {
- valueInEuro = value * 0.896097495;
- } else if (currency.getCurrencyCode().equals("EUR")) {
- valueInEuro = value;
- } else {
- valueInEuro = 0;
+ switch (currency.getCurrencyCode()) {
+ case "JPY":
+ valueInEuro = value * 0.00884806667;
+ break;
+ case "TTD":
+ valueInEuro = value * 0.133748824;
+ break;
+ case "USD":
+ valueInEuro = value * 0.896097495;
+ break;
+ case "EUR":
+ valueInEuro = value;
+ break;
+ default:
+ throw new RuntimeException("Unsupported Currency: '" + currency.getCurrencyCode() + "'");
}
LOG.info("euro value: '{}', value: '{}', currency: '{}'", valueInEuro, value, currency.getCurrencyCode());
}
[myfaces-tobago] 01/03: TOBAGO-1970: Configure web.xml listeners
via JARs (for Mojarra, MyFaces, OWB, etc.)
Posted by lo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git
commit e4b9b2a05727d56b4288f6397d131243263d174d
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Thu Jan 10 13:49:52 2019 +0100
TOBAGO-1970: Configure web.xml listeners via JARs (for Mojarra, MyFaces, OWB, etc.)
---
tobago-example/pom.xml | 31 +++-------------------
.../src/main/webapp/WEB-INF/web.xml | 8 ++----
2 files changed, 6 insertions(+), 33 deletions(-)
diff --git a/tobago-example/pom.xml b/tobago-example/pom.xml
index 26554a4..360244a 100644
--- a/tobago-example/pom.xml
+++ b/tobago-example/pom.xml
@@ -86,35 +86,12 @@
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.14.v20181114</version>
<configuration>
+ <!--
+ to run the webapp in jetty in development mode use
+ mvn clean jetty:run -Pdev
+ -->
<scanIntervalSeconds>5</scanIntervalSeconds>
-<!--
- <systemProperties>
- <systemProperty>
- <name>logback.configurationFile</name>
- <value>/Users/lofwyr/t/logback.xml</value>
- </systemProperty>
- <systemProperty>
- <name>java.util.logging.config.file</name>
- <value>logging.properties</value>
- </systemProperty>
- </systemProperties>
--->
</configuration>
-<!--
- <dependencies>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jul-to-slf4j</artifactId>
- <version>${slf4j.version}</version>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <version>${logback.version}</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
--->
</plugin>
</plugins>
</pluginManagement>
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml b/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml
index cc8bc3f..71791e8 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml
@@ -25,12 +25,8 @@
<display-name>Tobago Demo Application</display-name>
- <!-- for local development you can set a Maven profile with -Pdev to set the stage to Development -->
- <context-param>
- <param-name>javax.faces.PROJECT_STAGE</param-name>
- <!--<param-value>Development</param-value>-->
- <param-value>Production</param-value>
- </context-param>
+ <!-- for local development you can set a Maven profile with -Pdev to set the
+ javax.faces.PROJECT_STAGE to Development -->
<context-param>
<param-name>com.sun.faces.validateXml</param-name>