I've made some progress related to previuos post, this was done by upgrading(I 
think) to facelets-1.0.6 that cleared the duplicate id in faces tree bug.

I've also changed the myfaces jars to version 1.1.1 in the 
jboss4.0.3sp1/.../jsf-libs but that didn't change anything.

So I still don't have the required result, so some help is welcome.

My jsp page has a form used for add/edit/find and create a customer plus a
datatable for returning the result of a search, when I select a customer from 
my datatable for editing the form doesn't get filled and the datatable is 
rendered empty.

So here is the relevant code.


  | <h:form>
  | <fieldset>
  |     <div>
  |             Name:
  |             <h:inputText value="#{customer.name}" />
  |     </div>
  |     <div>
  |             Adress:
  |             <h:inputText value="#{customer.adress.street}" />
  |     </div>
  |     <div>
  |             Zip:
  |             <h:inputText value="#{customer.adress.zip}" />
  |             City:
  |             <h:inputText value="#{customer.adress.city}" />
  |     </div>
  |     <h:commandButton value="Load all" action="#{customerManager.findAll}" />
  |     <h:commandButton value="Search" action="#{customerManager.find}" />
  |     <h:commandButton value="Save" action="#{customerManager.save}" />
  |     <h:commandButton value="Cancel" action="#{customerManager.cancel}" />
  | </fieldset>
  | </h:form>
  | 
  | <h:outputText value="No Customer Found" rendered="#{customers != null and 
empty customers}"/>
  | <h:dataTable id="customerstable" 
  |                     value="#{customers}" 
  |                     var="c">
  |     <f:facet name="header" style="text-align: center;">
  |         <h:outputText value="Customers"  />
  |     </f:facet>
  |     <f:facet name="footer" rendered="#{customers.rowCount >= 1}">
  |         <h:outputText value="Customers: #{customers.rowCount}" />
  |     </f:facet>
  |     <h:column>
  |             <f:facet name="header">Name</f:facet>
  |             <h:outputText value="#{c.name}" />
  |     </h:column>
  |     <h:column>
  |             <f:facet name="header">Adress</f:facet>
  |             <h:outputText value="#{c.adress.street}" />
  |     </h:column>
  |     <h:column>
  |             <f:facet name="header">Zip</f:facet>
  |             <h:outputText value="#{c.adress.zip}" />
  |     </h:column>
  |     <h:column>
  |             <f:facet name="header">City</f:facet>
  |             <h:outputText value="#{c.adress.city}"  />
  |     </h:column>
  |     <h:column>
  |             <h:commandLink value="edit" action="#{customerManager.edit}" />
  |     </h:column>
  | </h:dataTable>


  | @Name("customerManager")
  | @Conversational(ifNotBegunOutcome="main")
  | @Interceptor(SeamInterceptor.class)
  | @Intercept(InterceptionType.ALWAYS)
  | @LoggedIn
  | public class CustomerManagerBean implements Serializable {
  | 
  |     private static final Logger logger = 
Logger.getLogger(CustomerManagerBean.class);
  |     
  |     @In(create=true)
  |     private CustomerDAO customerDAO;
  |     
  |     @DataModel
  |     private List<Customer> customers;
  |     @DataModelSelectionIndex
  |     private int customerIndex;
  |     
  |     @Out(required=false)
  |     @In(required=false)
  |     private Customer customer;
  |     
  |     private String searchString;
  |     
  |     @Create
  |     public void create() {
  |             logger.info("created");
  |     }
  |     
  |     @Begin
  |     public String find() {
  |             logger.info("long running conversation begun");
  |             return "customers"; 
  |     }
  |     
  |     public String findAll() {
  |             logger.info("loading all customers");
  |             customers = customerDAO.findAll();
  |             return "success";
  |     }
  |     
  |     public String search() {
  |             logger.info("find by example");
  |             customers = customerDAO.findByExample(customer);
  |             return null;
  |     }
  |     
  |     public String edit() {
  |             logger.info("edit customer: " + customerIndex);
  |             if(customers == null) return "main";
  |             setCustomer();
  |             return "success";
  |     }
  |     
  |     public String save() {
  |             customerDAO.makePersistent(customer);
  |             customers.add(customer);
  |             logger.info("Conversation ended");
  |             return "success";
  |     }
  |     
  |     @End
  |     public String cancel() {
  |             logger.info("Conversation canceled");
  |             return "main";
  |     }
  |     
  |     private void setCustomer() {
  |             customer = (Customer) customers.get(customerIndex);
  |             logger.info(customerIndex + " -> " + 
  |                             customer.getName());
  |     }
  |     
  |     @Destroy
  |     public void destroy() {
  |             logger.info("destroyed");
  |     }

When the edit link is pressesd I don't get the logging in the console from the 
customermanager like it can't be found.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3914452#3914452

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3914452


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to