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 2017/06/14 15:02:30 UTC
svn commit: r1798702 - in /myfaces/tobago/trunk:
tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/
tobago-example/tobago-example-demo/src/main/webapp/
tobago-example/tobago-example-demo/src/main/webapp/content/20-component/040-command/...
Author: lofwyr
Date: Wed Jun 14 15:02:30 2017
New Revision: 1798702
URL: http://svn.apache.org/viewvc?rev=1798702&view=rev
Log:
TOBAGO-1752: DeltaSpike WindowId doesn't work correctly with Tobago
Modified:
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/RenderUtils.java
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/040-command/00-button+link/button+link.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/main.xhtml
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/RenderUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/RenderUtils.java?rev=1798702&r1=1798701&r2=1798702&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/RenderUtils.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/RenderUtils.java Wed Jun 14 15:02:30 2017
@@ -32,6 +32,7 @@ import org.apache.myfaces.tobago.util.Co
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import javax.faces.application.ViewHandler;
import javax.faces.component.EditableValueHolder;
import javax.faces.component.UIComponent;
import javax.faces.component.UIParameter;
@@ -205,15 +206,18 @@ public final class RenderUtils {
public static String generateUrl(final FacesContext facesContext, final AbstractUICommandBase component) {
- final ExternalContext externalContext = facesContext.getExternalContext();
-
String url = null;
if (component.getLink() != null) {
-
+ final ExternalContext externalContext = facesContext.getExternalContext();
final String link = component.getLink();
if (link.startsWith("/")) { // internal absolute link
- url = externalContext.encodeResourceURL(externalContext.getRequestContextPath() + link);
+ final ViewHandler viewHandler = facesContext.getApplication().getViewHandler();
+ url = viewHandler.getBookmarkableURL(
+ facesContext,
+ externalContext.getRequestContextPath() + link,
+ null,
+ true);
} else if (StringUtils.isUrl(link)) { // external link
url = link;
} else { // internal relative link
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/040-command/00-button+link/button+link.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/040-command/00-button%2Blink/button%2Blink.xhtml?rev=1798702&r1=1798701&r2=1798702&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/040-command/00-button+link/button+link.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/040-command/00-button+link/button+link.xhtml Wed Jun 14 15:02:30 2017
@@ -37,6 +37,8 @@
The image leads to www.apache.org.</p>
<tc:section label="<tc:link>">
<pre><code class="language-markup"><tc:link label="apache.org" link="https://www.apache.org/"/></code></pre>
+ <tc:link id="l0" label="This page" link="/content/20-component/040-command/00-button+link/button+link.xhtml"/>
+ |
<tc:link id="l1" label="apache.org" link="https://www.apache.org/"/>
|
<tc:link id="l2" label="Disabled" disabled="true" link="https://www.apache.org/"/>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/main.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/main.xhtml?rev=1798702&r1=1798701&r2=1798702&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/main.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/main.xhtml Wed Jun 14 15:02:30 2017
@@ -25,6 +25,10 @@
xmlns="http://www.w3.org/1999/xhtml">
<f:view locale="#{clientConfigController.locale}">
<tc:page applicationIcon="#{request.contextPath}/icon/favicon.ico" label="#{demoBundle.pageTitle} - #{title}" id="page">
+<!--
+xmlns:ds="http://deltaspike.apache.org/jsf"
+ <ds:windowId/>
+-->
<!--
<tc:dataAttribute name="tobago-log-level" value="DEBUG"/>