Announcement Announcement Module
Collapse

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions (http://www.springsource.org/extensions) project, this forum has been decommissioned in favour of Spring Extensions one at:
http://forum.springsource.org/forumdisplay.php?f=44

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Cheers,
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
See more
See less
XT Ajax ReplaceElementAction problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • XT Ajax ReplaceElementAction problem

    Hi,

    I have written an AjaxActionEvent Handler which I want to use to replace the content of form text input field:

    here is the jsp snippet

    <spring:bind path="strikeOptimizeCommand.forecastRate">
    <td width="10%">
    <input type="text" id="forecastRateId" name="forecastRate" value="<c:out value="${status.value}"/>">
    </td>
    <td width="10%">
    <font color="red"><c:out value="${status.errorMessage}"/></font>
    </td>
    </spring:bind>

    and in my handler I have the following

    InputField forecastField = new InputField("Forecast Rate", result[1], InputField.InputType.TEXT);
    ReplaceElementAction forecastRateAction = new ReplaceElementAction("forecastRateId", forecastField);

    // Create a concrete ajax response:
    AjaxResponse response = new AjaxResponseImpl();
    // Add the action:
    response.addAction(forecastRateAction);

    The first time the handler get called the field is updated successfully, however if it is called a second time the field fails to update.

    I'm probably doing something stupid, but I can't see it.

    Any help much appreciated.

  • #2
    Hi,

    Where is your doAjaxAction call ?

    Comment


    • #3
      The XT.doAjaxAction is attached to an onchange event on another element.

      Comment


      • #4
        Originally posted by doyles View Post
        Code:
        InputField forecastField = new InputField("Forecast Rate", result[1], InputField.InputType.TEXT);
        
        ReplaceElementAction forecastRateAction = new ReplaceElementAction("forecastRateId", forecastField);
        When you replace the already existent input field with the new one, you don't assign it the "forecastRateId" id attribute.
        Just do the following:
        Code:
        forecastField.addAttribute("id", "forecastRateId");
        Let me know.
        Cheers,

        Sergio B.

        Comment


        • #5
          Doh!

          The stupid ones are always the hardest to find

          Thanks alot !

          Comment


          • #6
            Radio button

            i have the problem with radio button.

            InputField option = new InputField("orderType", vo.getCode(), InputType.RADIO);
            option.addAttribute("id", "orderType");

            Since id for radio button is same if we have three radio buttons only one radio button is changed and all the others are retained

            Comment

            Working...
            X