You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by he...@apache.org on 2006/12/06 21:40:24 UTC

svn commit: r483215 - in /struts/struts2/trunk: apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/ apps/showcase/src/main/webapp/ajax/autocompleter/ core/src/main/java/org/apache/struts2/components/

Author: hermanns
Date: Wed Dec  6 12:40:24 2006
New Revision: 483215

URL: http://svn.apache.org/viewvc?view=rev&rev=483215
Log:
URL tag: webapp root repeats when path saved to local variable
o fixed AutoCompleter samples
o added some javadocs about correct href usage
o changed AutoCompleter href to static value instead of a processed one

Issue Number: WW-1537

Modified:
    struts/struts2/trunk/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/AjaxTestAction.java
    struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/autocompleter/index.jsp
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Autocompleter.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Div.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/RemoteUICallBean.java

Modified: struts/struts2/trunk/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/AjaxTestAction.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/AjaxTestAction.java?view=diff&rev=483215&r1=483214&r2=483215
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/AjaxTestAction.java (original)
+++ struts/struts2/trunk/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/AjaxTestAction.java Wed Dec  6 12:40:24 2006
@@ -22,10 +22,12 @@
 
 import com.opensymphony.xwork2.Action;
 
+import java.io.Serializable;
+
 
 /**
  */
-public class AjaxTestAction implements Action {
+public class AjaxTestAction implements Action, Serializable {
 
     private static int counter = 0;
     private String data;

Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/autocompleter/index.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/autocompleter/index.jsp?view=diff&rev=483215&r1=483214&r2=483215
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/autocompleter/index.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/autocompleter/index.jsp Wed Dec  6 12:40:24 2006
@@ -55,14 +55,14 @@
 <br/>
 
 
-<s:url id="autoex" value="/nodecorate/AutocompleterExample.action"/>
+<s:url id="autoex" action="AutocompleterExample" namespace="/nodecorate"/>
 
 Link two autocompleter elements. When the selected value in 'Autocompleter 1' changes, the available values in 'Autocompleter 2' will change also.
 <br/>
 <form id="selectForm">
   <p>Autocompleter 1 <s:autocompleter theme="simple" name="select" list="{'fruits','colors'}"  value="colors" onValueChangedPublishTopic="/Refresh" forceValidOption="true"/></p>
 </form>
-Autocompleter 2 <s:autocompleter theme="ajax" href="%{autoex}" autoComplete="false" formId="selectForm" refreshListenTopic="/Refresh" forceValidOption="true"/>
+Autocompleter 2 <s:autocompleter theme="ajax" href="%{#autoex}" autoComplete="false" formId="selectForm" refreshListenTopic="/Refresh" forceValidOption="true"/>
 
 <br/>
 <br/>

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Autocompleter.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Autocompleter.java?view=diff&rev=483215&r1=483214&r2=483215
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Autocompleter.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Autocompleter.java Wed Dec  6 12:40:24 2006
@@ -41,7 +41,7 @@
  * </pre>
  * <B>THE FOLLOWING IS ONLY VALID WHEN AJAX IS CONFIGURED</B>
  * <ul>
- *      <li>href</li>
+ *      <li>href - Note: The href attribute value needs to be set as an url tag id.</li>
  * </ul>
  * @s.tag name="autocompleter" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.AutocompleterTag"
  *        description="Renders a combobox with autocomplete and AJAX capabilities"
@@ -93,8 +93,7 @@
         if (disabled != null)
             addParameter("disabled", findValue(disabled, Boolean.class));
         if (href != null) {
-            addParameter("href", UrlHelper.buildUrl(findString(href), request,
-                    response, null));
+            addParameter("href", findString(href));
             addParameter("mode", "remote");
         }
         if (dropdownHeight != null)

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Div.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Div.java?view=diff&rev=483215&r1=483214&r2=483215
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Div.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Div.java Wed Dec  6 12:40:24 2006
@@ -53,6 +53,7 @@
  * </ul>
  * 'targets' is a list of element ids whose content will be updated with the
  * text returned from request.<p/>
+ * 'href' needs to be set as an url tag reference value.<p/>
  * 'errorText' is the text that will be displayed when there is an error making the request.<p/>
  * 'afterLoading' is the name of a function that will be called after the request.<p/>
  * 'beforeLoading' is the name of a function that will be called before the request.<p/>
@@ -76,10 +77,11 @@
  *
  * <pre>
  *       <!-- START SNIPPET: example -->
+ * &lt;s:url id="url" action="AjaxTest" />
  * &lt;s:div
  *    id=&quot;once&quot;
  *    theme=&quot;ajax&quot;
- *    href=&quot;/AjaxTest.action&quot;
+ *    href=&quot;%{url}&quot;
  *    loadingText=&quot;Loading...&quot;
  *    refreshListenTopic=&quot;/refresh&quot;
  *    updateInterval=&quot;3000&quot;

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/RemoteUICallBean.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/RemoteUICallBean.java?view=diff&rev=483215&r1=483214&r2=483215
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/RemoteUICallBean.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/RemoteUICallBean.java Wed Dec  6 12:40:24 2006
@@ -10,7 +10,7 @@
     void setRefreshListenTopic(String refreshListenTopic);
 
     /**
-     * The URL to call to obtain the content
+     * The URL to call to obtain the content. Note: If used with ajax context, the value must be set as an url tag value.
      * @s.tagattribute required="false" type="String"
      */
     void setHref(String href);