2009-02-05 62 views
2

我應該顯示書籤hyperlink.so點擊書籤將帶我到相應的網頁。任何一個告訴我我應該如何實現我的目標?謝謝。如何使輸出文本屬性值作爲超鏈接?

<html> 
    <f:view> 
    <head> 
     <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 
     <title>Insert title here</title> 
    </head> 
    <body> 
     <h:form> 
     <h1>Welcome to bookmark page</h1> 
     <h:dataTable value="#{table.bookmark}" var="item" border="1" rows="10"> 
      <f:facet name="header"> 
      <h:outputLabel value="Bookmark table"></h:outputLabel> 
      </f:facet> 
      <h:column> 
      <f:facet name="header"> 
       <h:outputLabel value="Edit"></h:outputLabel> 
      </f:facet> 
      <h:selectBooleanCheckbox value="#{item.editBookmark}" onclick="submit"> 
      </h:selectBooleanCheckbox> 
      </h:column> 
      <h:column> 
      <f:facet name="header"> 
       <h:outputLabel value="Sno"></h:outputLabel> 
      </f:facet> 
      <h:inputText value="#{item.sno}" rendered="#{item.editBookmark}" size="10">  
      </h:inputText> 
      <h:outputText value="#{item.sno}" rendered="#{not item.editBookmark}"> 
      </h:outputText> 
      </h:column> 
      <h:column> 
      <f:facet name="header"> 
       <h:outputLabel value="Bookmarks"></h:outputLabel> 
      </f:facet> 
      <h:inputText value="#{item.bookmark}" rendered="#{item.editBookmark}" size="10"> 
      </h:inputText> 
      <h:outputText value="#{item.bookmark}" rendered="#{not item.editBookmark}"> 
      </h:outputText> 
      </h:column> 
     </h:dataTable> 
     <h:commandButton value="submit"> 
     </h:commandButton> 
     </h:form> 
    </body> 
    </f:view> 
</html> 

回答

2
<h:outputLink value="#{item.bookmark}" rendered="#{not item.editBookmark}" <h:outputText value = "#{item.bookmark}" ></h:outputText> </h:outputLink> 
+0

修正了小錯誤,這應該現在的工作的 2009-02-05 09:38:03

3

h:outputLink看看:

<h:outputLink value="#{item.sno}" rendered="#{not item.editBookmark}"><f:verbatim>#{item.sno}</f:verbatim></h:outputLink>