protected final int before(Writer out) throws Exception {
super.before(out);
if (StringUtils.isBlank(handler)) {
// One of elemenId/event must be specified
if ((elementId == null && fullElementId == null) || event == null)
throw new JspException("You must specify handler or elementId/event for UiFormKeyboardHandlerTag (elementId=" + elementId + ", fullElementId=" + fullElementId + ", event=" + event + ",subscope=" + subscope);
// Only one of elementId/fullElementId must be specified
if (!(elementId == null ^ fullElementId == null))
throw new JspException("Either elementId or fullElementId must be specified, not both.");
// If elementId was given, translate to fullElementId
if (fullElementId == null)
fullElementId = elementIdToFullElementId(pageContext, elementId);
handler = createHandlerToInvokeJavascriptEvent(fullElementId, event);
}
else {
// None of the elementId/event attributes may be specified
if (fullElementId != null || elementId != null || event != null)
throw new JspException("You should specify either handler or event for UiFormKeyboardHandlerTag (handler=" + handler + ")");
}
// Scope here means the analogue of "scope" attribute in UiKeyboardHandlerTag
// It must be prefixed by componentId when the surrounding systemForm's "scope" is "screen".
String scope = (String) pageContext.getAttribute(UiFormTag.FORM_SCOPED_FULL_ID_KEY_REQUEST,