1 Reply Latest reply on Sep 21, 2010 8:40 AM by Glauco Correa

    Rich:editor changing toolbar theme and set fullscreen mode

    Glauco Correa Newbie

      Hello everyone, I am new here and just started learning about richfaces...

       

      I am using rich:editor in my web page and I need to set its theme from simple to advance, but at the same time I want to change it to fullscreen mode.

       


      Ok, I am doing this:

       


      I have a button with a javascript function (.click) that gets the toggle fullscreen mode button id from the advanced rich:editors toolbar. Ok, it works fine, the problem is... when the page is loaded for the first time, the toolbar is in the simple theme, so the fullscreen button does not exist yet, and  i cant get its id.

       

      I would like to know if it is possible to insert the fullscreen button in the simple theme toolbar. So I could keep this javascript funtion that Im using.

       

      Or if is there any other function that I can use to set the rich:editor to fullscreen mode also changing the toolbars theme.

       


      Grateful,

       


      Glauco.

        • 1. Re: Rich:editor changing toolbar theme and set fullscreen mode
          Glauco Correa Newbie

          This is my code:

           

          myPage.xhtml

           

          function fullScreen(){
                  if(document.getElementById('formReq:btnEditor1')){
                      document.getElementById('formReq:detailTextArea_fullscreen').click();
                  }
              }

          <a4j:form id="formReq">

             <a4j:region>

                <h:panelGroup>
                     <rich:editor value="#{requisito.requisito.detail}"
                           id="detail" required="true"
                           requiredMessage="Message" width="460"
                           height="150">
                           <c:if test="${requisito.changeEditor}">
                                 <ui:include src="editor_config_plus.jsf" />
                           </c:if>
                     </rich:editor>

                </h:panelGroup>

             </a4j:region>

           

             <a4j:commandButton styleClass="botao icon_novo"
                    id="btnEditor1" value="#{requisito.btnName}"
                    action="#{requisito.changeEditor()}"
                    oncomplete="fullScreen();" reRender="btnEditor1,detail" />

           

          </a4j:form>

           

           

          MyBackingBean.java

           

          boolean changeEditor;

          String btnEditor;

           

          public void changeEditor(){
                  clicou = true;
                 
                  if(clicou){
                      if(changeEditor && btnEditor.equals("Editor Simple")){
                          changeEditor=false;
                          BtnEditor = "Editor Advanced";
                      }else{
                          changeEditor = true;
                          if(changeEditor) btnEditor = "Editor Simple";
                          else btnEditor = "Editor Advanced";
                      }
                  }
                 
                  clicou = false;
              }

           

          ----

          Att.

          Glauco Correa