Search in sources :

Example 6 with AfterRender

use of org.apache.tapestry5.annotations.AfterRender in project flowlogix by flowlogix.

the class LoginFormBase method detectJavaScript.

@AfterRender
public void detectJavaScript() {
    Link link = componentResources.createEventLink(ENABLE_JS_EVENT);
    String eventURI = link.toAbsoluteURI(requestGlobals.getRequest().isSecure());
    jsSupport.addInitializerCall("detectJS", eventURI);
}
Also used : Link(org.apache.tapestry5.Link) ExternalPageLink(com.flowlogix.web.services.ExternalPageLink) AfterRender(org.apache.tapestry5.annotations.AfterRender)

Example 7 with AfterRender

use of org.apache.tapestry5.annotations.AfterRender in project tapestry-5 by apache.

the class ZoneRefresh method addJavaScript.

@AfterRender
void addJavaScript() {
    Link link = resources.createEventLink("zoneRefresh", context);
    javaScriptSupport.require("t5/core/zone-refresh").with(zone.getClientId(), period, link.toString());
}
Also used : Link(org.apache.tapestry5.http.Link) AfterRender(org.apache.tapestry5.annotations.AfterRender)

Example 8 with AfterRender

use of org.apache.tapestry5.annotations.AfterRender in project tapestry-5 by apache.

the class FormGroup method afterRender.

void afterRender(MarkupWriter writer) {
    if (fieldWrapper != null) {
        // field wrapper
        writer.end();
    }
    // TAP5-2662
    final Element inputElement = writer.getDocument().getElementById(field.getClientId());
    if (inputElement != null) {
        final String clientId = field.getClientId();
        final String labelId = javaScriptSupport.allocateClientId(clientId + "-label");
        label.attribute("id", labelId);
        inputElement.attribute("aria-labelledby", labelId);
    }
    // div.form-group
    writer.end();
}
Also used : Element(org.apache.tapestry5.dom.Element)

Example 9 with AfterRender

use of org.apache.tapestry5.annotations.AfterRender in project tapestry-5 by apache.

the class OverridenMixin method afterRender.

void afterRender(MarkupWriter writer) {
    final Element element = writer.getDocument().getElementById(clientElement.getClientId());
    element.element("span", "id", "overridenMixin").text(" [Overriden mixin]");
}
Also used : ClientElement(org.apache.tapestry5.ClientElement) Element(org.apache.tapestry5.dom.Element)

Example 10 with AfterRender

use of org.apache.tapestry5.annotations.AfterRender in project tapestry-5 by apache.

the class FormFragment method afterRender.

/**
 * Closes the <div> tag and pops off the {@link org.apache.tapestry5.services.FormSupport} environmental
 * override.
 *
 * @param writer
 */
void afterRender(MarkupWriter writer) {
    Element hidden = hiddenFieldPositioner.getElement();
    hidden.attributes("type", "hidden", "name", Form.FORM_DATA, "value", componentActions.getClientData());
    // div
    writer.end();
    environment.pop(FormSupport.class);
    resetClientId();
}
Also used : Element(org.apache.tapestry5.dom.Element)

Aggregations

Element (org.apache.tapestry5.dom.Element)4 Link (org.apache.tapestry5.Link)3 AfterRender (org.apache.tapestry5.annotations.AfterRender)3 JSONObject (org.apache.tapestry5.json.JSONObject)3 ClientElement (org.apache.tapestry5.ClientElement)2 Link (org.apache.tapestry5.http.Link)2 ExternalPageLink (com.flowlogix.web.services.ExternalPageLink)1 Import (org.apache.tapestry5.annotations.Import)1 StylesheetLink (org.apache.tapestry5.services.javascript.StylesheetLink)1 StylesheetOptions (org.apache.tapestry5.services.javascript.StylesheetOptions)1