You can set the property using an <h:inputText /> inside your datatable.  As your datatable interates over the rows in the contactList, you can edit each contact bean independently.
 
<f:view>
       <h:dataTable var="contact" value="#{allContacts.contactList}">
          <h:column>
            <h:outputText value="#{contact.firstname}" />
          </h:column>
          <h:column>
            <h:inputText value="#{contact.myConnection}"/>
          </h:column>
       </h:dataTable>
</f:view>
 
Don't forget to define your datatable columns.

 
On 4/13/05, Jan Bols <[EMAIL PROTECTED]> wrote:
I have a jsf-page containing the following:
<f:view>
       <h:dataTable var="contact" value="#{ allContacts.contactList}">
           <h:outputText value="#{contact.firstname}" />
       </h:dataTable>
</f:view>
 
 

The allContacts bean is a managed bean and is specified in the web.xml
file:
<faces-config>
       <managed-bean>
               <managed-bean-name>allContacts</managed-bean-name>
               <managed-bean-class>MyContacts</managed-bean-class>
               <managed-bean-scope>session</managed-bean-scope>
       </managed-bean>
</faces-config>

The allContacts bean contains a list contactList containing contact-beans.
The contact bean contains a property called myConnection that holds the
connection to the database.

I want to set that connection property from within the jsf-page or the
web.xml file but how do I do that? In jstl this can be done with <c:set>
or in jsp with <jsp:setProperty> but how do I do this in jsf?

Thanks
Jan



--
-Heath Borders-Wing
[EMAIL PROTECTED]

Reply via email to