Results 1 to 4 of 4

Thread: XT AJAX - Problem with dynamically hiding/displaying a text box

  1. #1

    Default XT AJAX - Problem with dynamically hiding/displaying a text box

    I have a requirement of displaying/hiding an additional field in my JSP based upon the user selection of an option of combo box. I am using Spring XT to handle it, but then failing with the problem of multi browser compatibility. The code works fine in IE, but fails in FireFox 2.0.
    Firefox displays the field always.

    The following is the JSP code, by default the field is made as hidden
    Code:
    								<spring:bind path="searchForm.inputFields[${searchRow}].maxValue">
    									<input type="text" name="<core:out value="${status.expression}"/>" value="<core:out value="${status.value}"/>" style=".visibility=hidden"" size="10">
    								</spring:bind>
    and on the event of the combo box, I set the visibility true.
    Code:
    			SetAttributeAction setMaxValueAction = new SetAttributeAction("inputFields["+strRowId+"].maxValue", "style", ".visibility=visible");
    			response.addAction(setMaxValueAction);
    I am sure the problem is with the style attribute.

    Is there any other way to handle it?

    Regards,
    Anshumn

  2. #2
    Join Date
    Mar 2007
    Posts
    7

    Default

    Not sure if this will help, but I generally use the css attribute 'display' if I'm showing/hiding something - 'none' for hidden, '' for shown.

    Also in your style attribute you have ".visibility", is that . at the front meant to be there?

  3. #3

    Default

    Quote Originally Posted by Murf View Post
    Also in your style attribute you have ".visibility", is that . at the front meant to be there?
    Thanks, I would check that.

    The actual attribute value which works is style.visibility="hidden" or style.visibility="visible". I had tried giving like this in the jsp and the handler, but this did not work in IE also. But I had earlier tried like this with Javascript (without XT AJAX)and it had worked nicely. So, then I tried all the combinations using XT AJAX and then got style=".visibility=hidden" working, but I was not sure of it. It works like this in IE, but fails in Firefox.

    Thanks!

  4. #4
    Join Date
    Jul 2006
    Location
    Rome, Italy
    Posts
    347

    Default

    Quote Originally Posted by anshumn View Post
    So, then I tried all the combinations using XT AJAX and then got style=".visibility=hidden" working, but I was not sure of it. It works like this in IE, but fails in Firefox.
    I suggest you to use style="display: none;", and then the following XT Ajax actions:
    https://springmodules.dev.java.net/s...entAction.html
    https://springmodules.dev.java.net/s...entAction.html

    Cheers,

    Sergio B.
    Sergio Bossa
    Spring Modules Team

Posting Permissions

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