Announcement

Collapse
No announcement yet.

Facelets + Tomahawk

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Facelets + Tomahawk

    Hallo zusammen

    SITATUION:
    - JSF Applikation nutzt facelets, myface, tomahawk, hibernate und spring (core und security).
    - Applikation läuft auf ein Tomcat 6 Instanz (JDK 1.5)
    - die applikation hat eine suchmaske und nachfolgenden eine kuzbeschreibung der suchresultate. Würde man ein Suchresultat auswählen wird man auf die Detail Seite weitergeleitet

    Problematik
    Im search.xhtml wird ein suchresultat in ein commandlink (tomahawk) eingebaut welche beim click auf die detail seite verweisen soll. Jedoch bewirckt ein click das die such seite refreshed wird? Wenn ich den commandlink ausserhalb des facelets repeat einfüge funktioniert der link zur detail seite. Weiss jemand was ich hier falsch mache?

    maven pom.xml auszug:
    Code:
    ...
    <!--  jsf -->
    <dependency>
    	<groupId>org.apache.myfaces.core</groupId>
    	<artifactId>myfaces-api</artifactId>
    	<version>1.2.7</version>
    </dependency>
    <dependency>
    	<groupId>org.apache.myfaces.core</groupId>
    	<artifactId>myfaces-impl</artifactId>
    	<version>1.2.7</version>
    </dependency>
    <dependency>
    	<groupId>org.apache.myfaces.tomahawk</groupId>
    	<artifactId>tomahawk12</artifactId>
    	<version>1.1.9</version>
    	</dependency>
    <dependency>
    	<groupId>com.sun.facelets</groupId>
    	<artifactId>jsf-facelets</artifactId>
    	<version>1.1.14</version>
    </dependency>
    ...
    search.xhtml
    Code:
    ...
    <ui:composition template="/pages/templates/template.xhtml">
      <ui:define name="content">
        <f:view>
           <center>
    	 <h:form id="searchForm">
    		<t:inputText id="search" forceId="true" size="50" />
    		<t:commandButton action="#{searchBean.find}" 
    				id="searchButton" 
    				forceId="true" 
    				value="search" />
    	 </h:form>
    	 <h:form id="detailForm">
    	   <ui:repeat value="#{searchBean.results}" var="result">
    	     <div>
    		<t:commandLink action="view" 
    				value="view" 
    				immediate="true" 
    				actionListener="#{detailBean.init}" >
    		    <f:param name="id" value="#{result.id}" />  
    		</t:commandLink>
    		<table><tbody><tr>
    			<td><b><h:outputText value="#{result.city}" /></b></td>
    	        </tr></tbody></table>
    	     </div>
               </ui:repeat>
    	 </h:form>
         </f:view>
       </ui:define>
    </ui:composition>
    ...
    Zuletzt editiert von fab2; 19.11.2009, 15:15.
Working...
X