14 Replies Latest reply on Jan 22, 2007 10:52 AM by Seto Kaiba

    Please help me, urgent, waiting online

    Seto Kaiba Expert

      Click the s:link and report Exception during INVOKE_APPLICATION(5): java.lang.IllegalArgumentException: attempt to create merge event with null entity. But the data of product.name is displayed normal. And it seems that the problem is the passing parameter of s:link.

       <ui:repeat value="#{productCCList}" var="productCC">
       <tr>
       <td width="91" height="100%">
       <table width="100%" height="100%" border="1" cellspacing="0"
       cellpadding="0">
       <tr>
       <td>
       <div align="center" style="font-size: 14px;">#{productCC.name}</div>
       </td>
       </tr>
       </table>
       </td>
       <td>
       <table width="100%" border="1" cellspacing="0" cellpadding="0">
       <ui:repeat value="#{productCC.c}" var="productC">
       <tr>
       <td height="50">
       <div align="center" style="font-size: 14px;">#{productC.name}</div>
       </td>
       <ui:repeat value="#{productC.product}" var="product">
       <td>
       <div align="center" style="font-size: 14px;"><s:link
       id="viewProduct" value="#{product.name}"
       action="#{hongyangManager.selectProduct(product)}" /></div>
       </td>
       </ui:repeat>
       </tr>
       </ui:repeat>
       </table>
       </td>
       </tr>
       </ui:repeat>
      



      @Stateful
      @Name("hongyangManager")
      public class HongyangManagerAction implements HongyangManager {
      
       @PersistenceContext(type = PersistenceContextType.EXTENDED)
       EntityManager em;
      
       @DataModel
       List productCCList;
      
       Product currentProduct;
      
       XD currentXD;
      
       YD currentYD;
      
       @Factory
       public void getProductCCList() {
       productCCList = em.createQuery("from ProductCC productCC")
       .getResultList();
       }
      
       public String selectProduct(Product selectedProduct) {
       currentProduct = em.merge(selectedProduct);
       return "product";
       }
      
       public String selectXD(XD selectedXD) {
       currentXD = em.merge(selectedXD);
       return "xd";
       }
      
       public String selectYD(YD selectedYD) {
       currentYD = em.merge(selectedYD);
       return "yd";
       }
      
       @Destroy
       @Remove
       public void destroy() {
       }
      }