2 Replies Latest reply on Jun 25, 2011 6:56 PM by jennifer pazzini

    seam rich:editor value problem

    jennifer pazzini Newbie

      Hi,


      i use richfaces editor in my seam project, but i can't get editor's value after i push save button. i use EditorBean in my NewArticleAction. i don't know what the problem is. Thanks for interests already.
      My codes like that:





      <rich:editor
          id="editor" width="400" height="300" value="#{newArticleAction.editorBean.value}">
      </rich:editor>
      <s:button action="#{newArticleAction.save}" value="Save"/>
      
      
      @Name("newArticleAction")
      public class NewArticleAction {
      private EditorBean editorBean = new EditorBean();
              public void save() {
                      Article article = new Article();
                      article.setArticleName("sdf");
                      article.setArticleBody((String) editorBean.getValue());
                      String query="from User where username=:username";
                      User user = (User)entityManager.createQuery(query).setParameter("username", credentials.getUsername()).getSingleResult();
                      article.setUser(user);
                      entityManager.persist(article);
              }
              public EditorBean getEditorBean() {
                      return editorBean;
              }
              public void setEditorBean(EditorBean editorBean) {
                      this.editorBean = editorBean;
              }
      }
      }
      
      
      
      
      @Name("editorBean")
      public class EditorBean {
              private String value;
              public String getValue() {
                      return value;
              }
              public void setValue(String value) {
                      this.value = value;
              }
      }