8 Replies Latest reply on Sep 4, 2009 8:23 AM by johndoe123

    a4j:support does not call action

      Hi!

      a4j:support won't call an action if it is in a datatable which in turn is in an a4j:outputPanel.

      How come? How to work around this issue?

        • 1. Re: a4j:support does not call action

          Well, the problem seems to involve the datascroller as well. As soon as I switch pages, no actions are called anymore. The a4j support is nested in a h:selectBooleanCheckbox in a rich:column.

          • 2. Re: a4j:support does not call action
            ilya_shaikovsky

            1) add rich:messages
            2) verify that no messages present
            3) post your code there ;)

            • 3. Re: a4j:support does not call action

              Well, it works unless I navigate via the datascroller. Before I navigate to page2, everything works as it should. Then, when I press an a:commandLink inside a column after having navigated via the datascroller, the response is suddenly much bigger than it should be. Seems like the whole page is rendered anew and the action won't be called. I read this could've something to do with invalid field values...but there are no invalid field values??! I wrapped everything in s:validateAll tags and there're no messages, nothing.

              What could cause that? No use posting code, it's too long, you would not read.

              • 4. Re: a4j:support does not call action
                ilya_shaikovsky

                then try to simplify it to sample case and after we get it working you could add the other functionality back again. The reasons could be different and we could not find them using just "not works" descriptions.

                • 5. Re: a4j:support does not call action

                  I have found a solution:

                  No actions would be called from within the datatable, while it worked fine outside the datatable. The control would not matter (e.g. commandLink, commandButton, a4j:support).

                  But now, I have found the mistake: Some of my entities (their IDs respectively) had an overridden toString() method. The toString() method evaluated to a String containing whitespaces, which caused the calls to fail. It worked on the second try (after a page reload) because the spaces were then escaped to %20%20 instead of only %20. Don't ask me why it would work every time after a page reload. I'm just glad it works now, as I removed the whitespaces from the toString() methods of the entities.

                  Is this a bug or is this working as intended?

                  I mean, c'mon, it worked every second time. The problem must be somewhere in the DataVisitor imho, since my datamodel feeds it the id in the walk-method.

                  • 6. Re: a4j:support does not call action

                    Which brings me to my next question: In order to write a rowKeyConverter, do I just need to write a class implementing the javax.faces.convert.Converter class?

                    • 7. Re: a4j:support does not call action
                      nbelaevski

                      Hi,

                      This is working as intended.

                      In order to write a rowKeyConverter, do I just need to write a class implementing the javax.faces.convert.Converter class?

                      Yes

                      • 8. Re: a4j:support does not call action

                        So I was just lacking a row-key converter? I'm just asking because there are numerous people on the web which have the same problem and which might have a similar cause (because at first many think it's http://typo.ars-subtilior.com/articles/2007/02/07/jsf-datatable-and-commandlink).