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 -->
+ * <s:url id="url" action="AjaxTest" />
* <s:div
* id="once"
* theme="ajax"
- * href="/AjaxTest.action"
+ * href="%{url}"
* loadingText="Loading..."
* refreshListenTopic="/refresh"
* updateInterval="3000"
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);