You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@click.apache.org by sa...@apache.org on 2009/05/31 22:14:23 UTC
svn commit: r780500 -
/incubator/click/trunk/click/extras/src/org/apache/click/extras/control/SubmitLink.java
Author: sabob
Date: Sun May 31 20:14:22 2009
New Revision: 780500
URL: http://svn.apache.org/viewvc?rev=780500&view=rev
Log:
render prefix unless its blank
Modified:
incubator/click/trunk/click/extras/src/org/apache/click/extras/control/SubmitLink.java
Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/control/SubmitLink.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/control/SubmitLink.java?rev=780500&r1=780499&r2=780500&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/control/SubmitLink.java (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/control/SubmitLink.java Sun May 31 20:14:22 2009
@@ -356,7 +356,7 @@
buffer.append(getName());
if (value != null) {
buffer.append("&");
- if (hasParentForm()) {
+ if (StringUtils.isNotBlank(prefix)) {
// Value parameter is prefixed when SubmitLink is included
// inside a Form
buffer.append(prefix);
@@ -375,10 +375,12 @@
if (paramValue instanceof String[]) {
String[] paramValues = (String[]) paramValue;
for (int j = 0; j < paramValues.length; j++) {
- renderParameter(name, paramValues[j], buffer, context);
+ renderParameter(name, paramValues[j], prefix,
+ buffer, context);
}
} else {
- renderParameter(name, paramValue, buffer, context);
+ renderParameter(name, paramValue, prefix, buffer,
+ context);
}
}
}
@@ -499,10 +501,11 @@
*
* @param name the parameter name
* @param value the parameter value
+ * @param prefix the parameter prefix value
* @param buffer the buffer to render the parameter to
* @param context the request context
*/
- private void renderParameter(String name, Object value,
+ private void renderParameter(String name, Object value, String prefix,
HtmlStringBuffer buffer, Context context) {
// Don't render null values
@@ -512,10 +515,10 @@
String encodedValue = ClickUtils.encodeUrl(value, context);
buffer.append("&");
- if (hasParentForm()) {
+ if (StringUtils.isNotBlank(prefix)) {
// Parameters are prefixed when SubmitLink is included
// inside a Form
- buffer.append(getParameterPrefix());
+ buffer.append(prefix);
}
buffer.append(name);
buffer.append("=");