after updating to Tapestry 5.3.2, my @ActivationRequestParameter does not work anymore ..
having a form like this
<t:zone t:id="formZone" id="formZone" t:update="show">
<form t:id="ajaxForm" t:type="form" t:zone="formZone" style="border: 2px solid #eee; padding: 15px">
<input type="submit" id="sub" type="submit" value="Accept"/><br/><br/>
<t:errors/>
${form}
</form>
</t:zone>
trying to catch the input’s id like this
@ActivationRequestParameter("t:submit")
private String submitter;
void onSuccess() {
logger.debug("onSuccess ," +submitter);
if (request.isXHR()) {
ajaxResponseRenderer.addRender(formZone);
}
}
gives me the error
org.apache.tapestry5.runtime.ComponentEventException
Input string '["sub","sub"]' is not valid; the character '[' at position 1 is not valid.
org.apache.tapestry5.ioc.internal.OperationException
Input string '["sub","sub"]' is not valid; the character '[' at position 1 is not valid.
java.lang.IllegalArgumentException
Input string '["sub","sub"]' is not valid; the character '[' at position 1 is not valid.
Filter stack frames Stack trace
org.apache.tapestry5.internal.services.URLEncoderImpl.decode(URLEncoderImpl.java:144)
org.apache.tapestry5.internal.transform.ActivationRequestParameterWorker$2.handleEvent(ActivationRequestParameterWorker.java:128)
org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl$TransformationSupportImpl$1$1.invoke(ComponentInstantiatorSourceImpl.java:443)
Desired Behavoir
actually my goal is to be able to get submit-inputs dynamically in the form via
<t:outputraw value="buttonHtml"/>
like
public Object getButtonHtml(){
ContentType contentType = new ContentType("text/plain");//responseRenderer.findContentType(this);
MarkupWriter writer = factory.newPartialMarkupWriter(contentType);
if(isFavorite){
writer.element("input").attribute("type", "submit").attribute("class", "sButton")
.attribute("id", ACTION_REMOVE).attribute("value", messages.get("button_removeFavorite"));
writer.end();
} else {
writer.element("input").attribute("type", "submit").attribute("class", "sButton")
.attribute("id", ACTION_ADD).attribute("value", messages.get("button_addFavorite"));
writer.end();
}
return writer.toString();
}
any hints are warmly welcome 😀
using the
did the trick for me