8 Replies Latest reply on Jan 25, 2008 7:06 AM by Pete Muir

    s:link + method parameter

    Bartosz Jamroz Newbie

      I`m having a problem, couse I have to use s:link but this component cannot pass the parameter to the method.

      The view

      <div id="#{cat.categoryName}" class="showhide">
       <h:dataTable styleClass="dataTable" columnClasses="categoryName" var="question" value="#{cat.questionList}">
       <h:outputText value="#{question.questionText}"/>
       <h:commandLink value="remove" action="#{QuestionController.removeQuestion(question)}"/>
       <s:link value="slink_remove" action="#{QuestionController.removeQuestion(question)}"/>

      The method
      public void removeQuestion(Question question) {
       if(question == null) {
       log.fatal("Question is null ! [ERROR]");
       } else {
       log.info("Question [" + question.getQuestionText() + "]");

      11:09:18,250 INFO [QuestionControllerBean] Question [null]

      Question Entity
      public class Question implements Serializable {
       @Id @GeneratedValue
       private Long id;
       @NotNull @Length(min=5, max=100)
       private String questionText;
       @NotNull @OneToOne
       private QuestionType questionType;
       private QuestionCategory category;
       private Picture picture;
       private int questionValue;
       @NotNull @Temporal(value = TemporalType.TIMESTAMP)
       private Date created;
       //@OneToMany(cascade = {CascadeType.REMOVE, CascadeType.MERGE, CascadeType.REFRESH})
       private List<Answer> answers;
       private List<Poll> pools;
       private List<Test> tests;