Package org.apache.tapestry5.services.ajax

Examples of org.apache.tapestry5.services.ajax.JavaScriptCallback


    @SuppressWarnings("unchecked")
    @Test
    public void constraint_value_from_message_catalog_per() throws Exception
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
View Full Code Here


    @SuppressWarnings("unchecked")
    @Test
    public void constraint_value_from_message_catalog_per_form() throws Exception
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void missing_field_validator_constraint() throws Exception
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void single_validator_via_specification() throws Exception
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void multiple_validators_via_specification() throws Exception
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator required = mockValidator();
        Validator minLength = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void validator_with_constraint() throws Exception
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
View Full Code Here

        wilmaMessage = "His Wife, Wilma.";

        // Do one the new way
        ajaxResponseRenderer.addRender("fred", fredBlock);

        ajaxResponseRenderer.addCallback(new JavaScriptCallback()
        {
            public void run(JavaScriptSupport javascriptSupport)
            {
                javascriptSupport.importJavaScriptLibrary(library);
                javascriptSupport.addInitializerCall("writeMessageTo", new JSONObject("id", "message", "message",
View Full Code Here

            return voteForm;
        }

        if (name.equals("CSS Injection"))
        {
            ajaxResponseRenderer.addCallback(new JavaScriptCallback()
            {
                public void run(JavaScriptSupport javascriptSupport)
                {
                    javascriptSupport.importStylesheet(viaAjaxCSS);
                }
View Full Code Here

        getAlertStorage().add(alert);
    }

    private void addCallbackForAlert(final Alert alert)
    {
        ajaxResponseRenderer.addCallback(new JavaScriptCallback()
        {
            public void run(JavaScriptSupport javascriptSupport)
            {
                javascriptSupport.addInitializerCall("addAlert", alert.toJSON());
            }
View Full Code Here

        // Add a callback that exists just to clear the non-persistent alerts.
        // Only one of these is needed.

        if (needAlertStorageCleanup.get(true))
        {
            ajaxResponseRenderer.addCallback(new JavaScriptCallback()
            {
                public void run(JavaScriptSupport javascriptSupport)
                {
                    // In an Ajax request, the Alerts are added, just so that they can be removed if not persistent.
                    // Again, this is for the rare case where there's a redirect to another page.
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.services.ajax.JavaScriptCallback

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.