3 Replies Latest reply on Apr 21, 2008 6:10 AM by ilya_shaikovsky

    Changing value on input text disables all a4j:support

    jenkinsa

      Hi All,

      We have a page where we need to put some text in certain fields (as specified by a css class), and we also have a bunch of a4j:support event="onchange" attached to selectOneMenus. The javascript code for changing the values is

      var newElements = $$(".new-element");
      for(var i = 0; i < newElements.length; i++){
       newElements.setAttribute('value', '...');
       }
      


      we've noticed that the setAttribute call disables all the a4j:support elements on the page. if we remove the set attribute all the a4j:support works fine

      we've also tried:

      newElements.value = "...";
       newElements.writeAttribute('value', '...')
      


      and

      var attr = newElements.getAttributeNode('value');
       attr.nodeValue = '...';
      


      all works exactly the same...it disables the a4j:support event="onchange" that are attached to the selectOneMenu items

      very strange, can anyone offer any thoughts?

        • 1. Re: Changing value on input text disables all a4j:support
          jenkinsa

          more information. Each time, the a4j:support is making the trip back to the server ok, but if we change the element value on anything on the page using javascript, then model value for the drop down isn't updated after the server call

          • 2. Re: Changing value on input text disables all a4j:support
            jenkinsa

            More Information:

            We have multiple select on the page that have a4j:support elements in them for their change events. We also have multiple text fields

            if we get a reference to the text fields through prototype.js (useing $$(".classname")) and change the value, richfaces stops submitting the values for the select elements.

            The function linked to the select onchange (from alert(select.onchange)) remains the same, however a filter placed at the top of the filter chain reports that the parameters (from request.getParameterMap()) for the selects are not getting passed back to the server. If we comment out the code that changes the text field's value, then everything works fine.

            very very odd. Is there anywhere we can purchase support for richfaces, this bug is stalling our development, if we can't figure it out we have to drop richfaces.

            • 3. Re: Changing value on input text disables all a4j:support
              ilya_shaikovsky

              please feel free to open jira issue but attach war example there.