5 Replies Latest reply on Jul 8, 2011 4:21 AM by René Zoller

    Page parameters with seam 2.2.2

    René Zoller Newbie

      Hi,


      I'm testing a little bit around with seam and try to get page parameters working. I've got a page with




      <s:button action="/fallbearbeiten/msp.xhtml"
         value="Meilensteinplan bearbeiten (neu)"
         rendered="#{not empty task.variables.get('fallID')}"
         taskInstance="#{task}" >
            <f:param name="fallId" value="#{task.variables.get('fallID')}" />
      </s:button>




      with an entry in pages.xml




       <page login-required="true" view-id="/fallbearbeiten/msp.xhtml">
              <begin-conversation join="true" />
              <param name="fallId" value="#{fallHome.fallId}" />
              <action execute="#{fallHome.wire}"/>
       </page>
      




      The entity looks like this




      @Name("fallHome")
      public class FallHome extends EntityHome<Fall> {
      
              @In(create = true)
              SachbearbeiterHome sachbearbeiterHome;
      
              public void setFallId(Integer id) {
                      setId(id);
              }
      
              public Integer getFallId() {
                      return (Integer) getId();
              }
      
              @Override
              protected Fall createInstance() {
                      Fall fall = new Fall();
                      return fall;
              }
      
              public void load() {
                      if (isIdDefined()) {
                              wire();
                      }
              }
      
              public void wire() {
                      getInstance();
                      Sachbearbeiter sachbearbeiter = sachbearbeiterHome.getDefinedInstance();
                      if (sachbearbeiter != null) {
                              getInstance().setSachbearbeiter(sachbearbeiter);
                      }
              }
      
              public boolean isWired() {
                      if (getInstance().getSachbearbeiter() == null)
                              return false;
                      return true;
              }
      
              public Fall getDefinedInstance() {
                      return isIdDefined() ? getInstance() : null;
              }
      
              public List<Bericht> getBerichts() {
                      return getInstance() == null ? null : new ArrayList<Bericht>(
                                      getInstance().getBerichts());
              }
      
              public List<Diagnose> getDiagnoses() {
                      return getInstance() == null ? null : new ArrayList<Diagnose>(
                                      getInstance().getDiagnoses());
              }
      
              public List<Upload> getUploads() {
                      return getInstance() == null ? null : new ArrayList<Upload>(
                                      getInstance().getUploads());
              }
      
              public List<Logeintrag> getLogeintrags() {
                      return getInstance() == null ? null : new ArrayList<Logeintrag>(
                                      getInstance().getLogeintrags());
              }
      
      }





      and finally the msp.xhtml like this:



      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
              xmlns:s="http://jboss.com/products/seam/taglib"
              xmlns:ui="http://java.sun.com/jsf/facelets"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:rich="http://richfaces.org/rich"
              xmlns:a4j="http://richfaces.org/a4j"
              template="../layout/template.xhtml">
      
              <ui:define name="body">
      
                      <h1>Meilensteinplan fuer Fall "<h:outputText value="#{fallHome.id}" />"</h1>
              
              </ui:define>
      
      </ui:composition>



      but the setFallId()-method is never called an the expression in msp.xhtml is always empty. Can somebody help me to bring it working? I'm using Seam 2.2.2 with JBoss 5.1


      Thank you


      René