1

I have this following piece of code:

<h:form id = "fm-rewDet">
    <ui:repeat var="review" value="#{controller.reviewStatusList}">
        <h:commandLink value = "TestLink" action = "#{controller.rewDetail}" />
    </ui:repeat>
</h:form>

The controller contains the following:

public void rewDetail(){
    System.out.println("I'M HERE");
}

The following HTML code is rendered:

<form id="fm-rewDet" enctype="application/x-www-form-urlencoded" action="/project/overview.xhtml" method="post" name="fm-rewDet">
<a onclick="mojarra.jsfcljs(document.getElementById('fm-rewDet'),{'fm-rewDet:j_idt224:0:j_idt255':'fm-rewDet:j_idt224:0:j_idt255'},'');return false" href="#">TestLink</a>
//...
</form>

This simple example does not work at all. When the link is pressed some action takes place but weirdly the I'M HERE message fails to appear.

What is the cause of this?

Ionut
  • 2,788
  • 6
  • 29
  • 46
  • Your action attribute and the method signature don't match. – Matt Handy Mar 28 '12 at 19:20
  • @MattHandy Thanks! That was a copying problem. Usually there will be a warn if the action names does not match. – Ionut Mar 28 '12 at 19:24
  • It's in a ``, right? The `getReviewStatusList()` don't change on a request based condition, right? See also http://stackoverflow.com/questions/2118656/hcommandlink-hcommandbutton-is-not-being-invoked – BalusC Mar 28 '12 at 19:25
  • @BalusC Yes it is nested in a ``. The List iterated with the `ui:repeat` has always 8 elements taken from the database. I already red your answer from the question you suggested and I couldn't find any problem. Furthermore, I tried to call that action with a `` tag but that failed as well. – Ionut Mar 28 '12 at 19:35
  • Well, without an SSCCE I don't think that we can help you with nailing down the problem. All code looks fine so far. – BalusC Mar 28 '12 at 19:36
  • @BalusC I edited the question. That's all the code there is. – Ionut Mar 28 '12 at 19:49
  • 1
    This is not the complete code. I can't copy'n'paste'n'run it without making the necessary changes to get it to run. I have still to write some `` etc around the Facelets code and some `@ManagedBean public class Controller {}` etc around the Java code. After doing that, it still works fine. So your problem must be in there, in the code which you didn't show at all. In other words, your code is stil not an [SSCCE](http://sscce.org). – BalusC Mar 28 '12 at 19:52

0 Answers0