Search code examples
hibernatejsfjsf-2icefaces

how to generate an outputlink from database?


Im starting with jsf with icefaces and i need to do this this is my mysql table

links table

I want to generate an outputlink for each row, thats what i did

fail!


Solution

  • Based on Mr @BalusC's answer, you can achieve that by :

    <h:dataTable value="#{bean.someList}" var="v" binding="#{someList}" rules="all">
         <h:column>
              <f:facet name="header">titulos</f:facet> #{v.field1}
         </h:column>
         <h:column>
              <f:facet name="header">link</f:facet> #{v.field2}
         </h:column>
         <h:column>
              <h:outputLink>www.newentity#{someList.rowIndex + 1}.com</h:outputLink>
         </h:column>
     </h:dataTable>
    

    In case the generated current website number does not depend to the row table, but rather to some current entity value, then replace the last column content by:

             <h:outputLink>www.newentity#{v.someIdentifiantField}.com</h:outputLink>