0 Replies Latest reply on Jan 10, 2012 12:36 PM by Ronaldo Caldas

    Custom rich:editor with facet element on a custom component

    Ronaldo Caldas Newbie

      hi,

      i using richfaces 4.1 and i have a custom 'rich:editor' component and a attribute named 'mode' , i would  like to use this parameter to choose the behavior of my component, like 'custom' or 'full':

       

      {code:xml}

      <cc:interface>

          <cc:atribute name="mode" />

      </cc:interface>

       

       

      <cc:implementation>

       

          <rich:editor id="#{id}" value="#{value}" lang="pt-br">

                      <f:facet name="config">

                          toolbar: '#{cc.attrs.mode}',

                          startupFocus: true,

                          toolbar_custom:

                              [                   

                                  { name: 'document', items : [ 'Source','-','DocProps','Preview','Print','-','Templates' ] },                                                                                                             

                                  { name: 'insert', items : [ 'Table','HorizontalRule','SpecialChar'] },

                                  { name: 'styles', items : [ 'Format' ] },

                                  { name: 'basicstyles', items : [ 'Bold','Italic','-','RemoveFormat' ] },

                                  { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-' ] },                           

                                  { name: 'tools', items : [ 'Maximize' ] }

                              ],

                          toolbar_full:

                              [                                                                                   

                                  { name: 'insert', items : [ 'Image','Table','HorizontalRule','SpecialChar','PageBreak'] },

                                  { name: 'styles', items : [ 'Styles','Format' ] },

                                  { name: 'basicstyles', items : [ 'Bold','Italic','Strike','-','RemoveFormat' ] },

                                  { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock' ] },

                                  { name: 'links', items : [ 'Link','Unlink','Anchor' ] },

                                  { name: 'tools', items : [ 'Maximize' ] }

                              ]                       

                             </f:facet>

                  </rich:editor>

      </cc:implementation>

      {code}

       

      And on the page:

       

      {code:xml}

          <satangoss:editor id="id111" label="pae:editor2" value="#{var['editor2']}" required="true" mode="custom"/> 

       

      {code}

       

      The problem is doesn't works, the attribute 'mode' it's not recognized, anyone have another solution?