Method from org.apache.tapestry5.internal.services.ClientBehaviorSupportImpl Detail: |
public void addFormFragment(String clientId,
String showFunctionName,
String hideFunctionName) {
JSONObject spec = new JSONObject();
addFunction(spec, "show", showFunctionName);
addFunction(spec, "hide", hideFunctionName);
addElementInit("formFragment", clientId, spec);
}
|
public void addFormInjector(String clientId,
Link link,
InsertPosition insertPosition,
String showFunctionName) {
JSONObject spec = new JSONObject();
spec.put("element", clientId);
spec.put("url", link.toAbsoluteURI());
if (insertPosition == InsertPosition.BELOW)
spec.put("below", true);
addFunction(spec, "show", showFunctionName);
// Always has at least two properties.
renderSupport.addInit("formInjector", spec);
}
|
public void addValidation(Field field,
String validationName,
String message,
Object constraint) {
String fieldId = field.getClientId();
JSONArray specs;
if (validations.has(fieldId)) specs = validations.getJSONArray(fieldId);
else
{
specs = new JSONArray();
validations.put(fieldId, specs);
}
JSONArray thisSpec = new JSONArray();
thisSpec.put(validationName);
thisSpec.put(message);
if (constraint != null) thisSpec.put(constraint);
specs.put(thisSpec);
}
|
public void addZone(String clientId,
String showFunctionName,
String updateFunctionName) {
JSONObject spec = new JSONObject();
addFunction(spec, "show", showFunctionName);
addFunction(spec, "update", updateFunctionName);
addElementInit("zone", clientId, spec);
}
|
public void commit() {
for (String field : validations.keys())
{
JSONArray specs = validations.getJSONArray(field);
JSONArray parameters = new JSONArray();
parameters.put(field);
parameters.put(specs);
renderSupport.addInit("validate", parameters);
}
}
|
public void linkZone(String linkId,
String elementId,
Link eventLink) {
JSONArray spec = new JSONArray();
spec.put(linkId);
spec.put(elementId);
spec.put(eventLink.toAbsoluteURI());
renderSupport.addInit("linkZone", spec);
}
|