2 Replies Latest reply on Jan 19, 2009 8:20 PM by Franco Fernandes

    rich:editor inside a rich:modalPanel

    Franco Fernandes Novice

      Hi

      I need some guidance here, this is the first time I am attempting something like this.

      If I put my rich:editor column outside of a modal panel, it works just fine. I see the current data for the column, can edit and save.

      But I am trying to design a UI where the rich:editor is placed inside a modal panel. If I do that, when the modal panel displays, the contents of the rich:editor column are empty - it is set for a lazy load.

      Some of the relevant code -

       <rich:modalPanel id="editSpecificationsPanel"
       width="450" autosized="true"
       keepVisualState="true"
       style="overflow:auto;" >
       <f:facet name="header">
       <h:outputText value="Edit Specifications" />
       </f:facet>
       <f:facet name="controls">
       <h:panelGroup>
       <h:graphicImage value="/img/close.png"
       id="specHidelink" styleClass="hidelink"/>
       <rich:componentControl for="editSpecificationsPanel" attachTo="specHidelink"
       operation="hide" event="onclick" />
       </h:panelGroup>
       </f:facet>
       <rich:messages style="color:red;"></rich:messages>
       <rich:editor value="#{itemHome.instance.specifications}" width="600" height="400" />
       </rich:modalPanel>
      
      
      



      @Column(name = "SPECIFICATIONS",length = 2147483647)
      @Type(type="text")
      @Basic(fetch=FetchType.LAZY)
      public String getSpecifications() {
       return this.specifications;
      }
      



      Do I need to eager load this single field when the entity is loaded - not sure how to do it.

      I already have this eager fetch query for this entity.
       @Override
       protected Item loadInstance() {
       return (Item) entityManager.createQuery
       ("select item from Item item " +
       "join fetch item.itemType itemType " +
       "join fetch item.location location " +
       "left join fetch item.tax tax " +
       "left join fetch item.division " +
       "where item.itemId = :id)").
       setParameter("id", getItemId()).getSingleResult();
       }
      



      Thanks
      Franco