Results 1 to 2 of 2

Thread: Spring ElementDecoration and AjaxEventDecoration incompatible with Dijit?

  1. #1
    Join Date
    Sep 2011
    Posts
    4

    Exclamation Spring ElementDecoration and AjaxEventDecoration incompatible with Dijit?

    I am using Spring 3.0.5, Webflow 2.3.0 and Spring JS for decorating.

    One of my forms has the following code:
    Code:
    <form:select path="selection">
        <form:option value="" label="Please select"></form:option>
        <form:options></form:options>
    </form:select>
    
    <noscript>
     <button id="btnSelect" type="submit" name="_eventId_dropDownSelectionChange">Select</button>
    </noscript>
    
    <script type="text/javascript">
    Spring.addDecoration(new Spring.ElementDecoration({
        widgetType : "dijit.form.Select",
        widgetAttrs : {
            forceWidth : true,
            missingMessage : "<s:message code="NotEmpty" />",
        }
    }));
    
    Spring.addDecoration(new Spring.AjaxEventDecoration({
        elementId : "selection",
        formId : "templateModel",
        event : "onChange",
        params : {  _eventId: "dropDownSelectionChange" }
    })); 
    </script>
    The intention is to render a second part of the form depending on what is selected in the dropdown. This is to be achieved either via an AJAX call on the onChange of the dropdown, or in the case of noscript - the pressing of the 'Select' button.

    The noscript side of things works. I select something in the dropdown, press 'Select' and the rest of the form is rendered on a refresh.

    However, the AJAX call does not have the just-selected value in its request. It's as if the AJAX call happens before the Dijit component has updated its representation. Are these components compatible in the fashion I am using them?

    I can get it to work if:

    • I don't decorate the component as a Dijit component and instead just normal dropdown with an onclick AJAX decoration.
    • Or, I put the AJAX call on a button instead of on the Dijit onChange


    Your help is most appreciated.

    Cheers

  2. #2
    Join Date
    Mar 2011
    Posts
    166

    Default

    Did you every get this working.. I am having the same error.. please email me johnathansmith1969@gmail.com

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •