public class ConfirmationTag extends FreeMarkerTag
<@confirm text="Are you sure you want to delete post: \\\'${post.title}\\\'?" form=post.id>Delete</@confirm>
<@form controller="posts" id=post.id action="delete" method="delete">
<input type="hidden" name="id" value="${post.id}">
</@form>
The code above will generate the following HTML:
<a href="#" onClick="if(confirm('Are you sure you want to delete post: \'ActiveWeb Rocks.\'?')) { $('#' + 17).submit(); return true; } else return false;">Delete</a>
<form action="/kitchensink/posts/delete" method="post" id="17">
<input type='hidden' name='_method' value='delete' /> <input type="hidden" name="id" value="17">
</form>
Constructor and Description |
---|
ConfirmationTag() |
Modifier and Type | Method and Description |
---|---|
protected void |
render(Map params,
String body,
Writer writer)
Implement this method ina concrete subclass.
|
appContext, context, cookie, cookies, cookieValue, execute, exists, format, get, getAllVariables, getContextPath, getId, getLocale, getRequestHost, getRequestPort, getRequestProtocol, getRoute, getUnwrapped, getUnwrapped, header, headers, host, ipAddress, ipForwardedFor, isDelete, isGet, isHead, isMethod, isPost, isPut, isXhr, locale, logger, method, overrideContext, param, params, params, params1st, path, port, process, protocol, queryString, remoteAddress, remoteHost, requestHas, session, session, sessionObject, uri, url, userAgent, validateParamsPresence, xhr
protected void render(Map params, String body, Writer writer) throws Exception
FreeMarkerTag
render
in class FreeMarkerTag
params
- this is a list of parameters as provided to tag in HTML.body
- body of tagwriter
- writer to write output to.Exception
- if anyCopyright © 2019 JavaLite. All rights reserved.