Autor Thema: Xpages extended richt text Feld  (Gelesen 2271 mal)

Offline HeLotes

  • Junior Mitglied
  • **
  • Beiträge: 56
Xpages extended richt text Feld
« am: 17.10.18 - 15:16:32 »
Hallo,

ich habe versucht mit Hilfe von diesem Video eine erweitertes Richtextfeld in eine Xpage einzubauen.

https://www.youtube.com/watch?v=uyae_Pu28zI

Aber leider bekomme ich in diesem Teil des Codes an Zeile 3 unten den unten angehängten Fehler.

Diese Evolution.nsf von openntf.org habe ich auch auf meinen Rechner herunter geladen. Wenn ich diese Datenbank im Designer öffne, dann bekomme ich keinen Fehler.

<xp:div themeId="container" style="width:900px">
      <xp:div id="container1">
         <evo:inputRichText id="inputRichText1"
            value="#{rteBean['document1.Body1']}">
            <xp:this.converter>
               <xp:converter
                  converterId="InputRichTextConverter">



Description   Resource   Path   Location   Type
The unknown namespace tag evo:inputRichText cannot be used as a control, as the namespace http://www.ibm.com/xsp/evolution is not known.   extendedRTE.xsp   evaldbTEST.nsf/XPages   line 121   XPages Problem

Wiese ist dieser Namespace  http://www.ibm.com/xsp/evolution nicht bekannt?

Gruß,
Helmut

Offline umi

  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 2.062
  • Geschlecht: Männlich
  • one notes to rule'em all, one notes to find'em....
    • Belsoft AG
Gruss

Urs

<:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jegliche Schreibfehler sind unpeabischigt
http://www.belsoft.ch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~:>

Offline HeLotes

  • Junior Mitglied
  • **
  • Beiträge: 56
Re: Xpages extended richt text Feld
« Antwort #2 am: 17.10.18 - 16:52:57 »
Danke, das war es.
Nur jetzt bekomme ich diesen Fehler.

The runtime has encountered an unexpected error.
Error source
Page Name:/xpProject.xsp
Control Id: _id3

Exception
Error while executing JavaScript computed expression
Script interpreter error, line=1, col=9: [ReferenceError] 'rteBean' not found

JavaScript code

   1: rteBean.getDatabasePath()

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:evo="http://www.ibm.com/xsp/evolution"
   xmlns:xe="http://www.ibm.com/xsp/coreex" pageTitle="Evolution">
   <xp:this.resources>
      <xp:styleSheet>
         <xp:this.contents>
              <![CDATA[
               .xsp-inline-attachment{padding:2px 2px 2px 18px;}
               
               .image-jpeg, .image-pjeg, .image-jpg, .image-x-png, .image-gif, .image-bmp {
                  background:url("./iconImage.gif") no-repeat scroll left center transparent;
               }
               .application-pdf {
                  background:url("./iconPDF.gif") no-repeat scroll left center transparent;
               }
               .application-octet-stream, .text-plain {
                  background:url("./iconFile.gif") no-repeat scroll left center transparent;
               }
               .application-msword {
                  background:url("./iconWord.gif") no-repeat scroll left center transparent;
               }
               .application-vnd-ms-excel, .application-vnd-openxmlformats-officedocument-spreadsheetml-sheet {
                  background:url("./iconFile.gif") no-repeat scroll left center transparent;
               }
               .application-vnd-ms-powerpoint {
                  background:url("./iconPPT.gif") no-repeat scroll left center transparent;
               }
              ]]>
         </xp:this.contents>
      </xp:styleSheet>
   </xp:this.resources>
   <xp:this.data>
      <xp:dominoDocument var="document1" formName="myForm"
         concurrencyMode="exception">
      </xp:dominoDocument>
   </xp:this.data>
   <xp:this.resources>
      <xp:script clientSide="true" type="text/javascript">
         <xp:this.contents>
            <![CDATA[
               // intercept nsf resource requests to stop ?t=timestamp being appended by ckeditor
               // see: http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Editor_Core_URLs_Manipulation
               window.CKEDITOR_GETURL = function(resourceRequest){
                  if(null != resourceRequest && resourceRequest.indexOf(".nsf") > -1){
                     return resourceRequest;
                  }
               }
               AttachmentHandler = function(editor){
                  return new CKEDITOR.dialogCommand("AttachmentDialog");
               };
               ImageHandler = function(editor){
                  return new CKEDITOR.dialogCommand("ImageDialog");
               };
               XSP.addOnLoad(function(){
                  try{
                     CKEDITOR.plugins.add("AttachmentExtension", {
                        init: function(editor){
                           editor.on("pluginsLoaded", function(ev){
                              if(!CKEDITOR.dialog.exists("AttachmentDialog")){
                                 CKEDITOR.dialog.add("AttachmentDialog", " ${javascript:rteBean.getDatabasePath()} ".trim() + "AttachmentDialog.js");
                              }
                              editor.ui.addButton("Attachment", {
                                 label: "Attach a file...",
                                 command: "AttachmentHandler",
                                 icon: " ${javascript:rteBean.getDatabasePath()} ".trim() + "iconAttachment.png"
                              });
                              editor.addCommand("AttachmentHandler", AttachmentHandler(editor));
                           });
                        }
                     });
                     CKEDITOR.plugins.add("ImageExtension", {
                        init: function(editor){
                           editor.on("pluginsLoaded", function(ev){
                              if(!CKEDITOR.dialog.exists("ImageDialog")){
                                 CKEDITOR.dialog.add("ImageDialog", " ${javascript:rteBean.getDatabasePath()} ".trim() + "ImageDialog.js");
                              }
                              editor.ui.addButton("ImageEx", {
                                 label: "Embed an image...",
                                 command: "ImageHandler",
                                 icon: " ${javascript:rteBean.getDatabasePath()} ".trim() + "iconImage.gif"
                              });
                              editor.addCommand("ImageHandler", ImageHandler(editor));
                           });
                        }
                     });
                  }catch(e){
                     console.log(e);
                  }
               });
            ]]>
         </xp:this.contents>
      </xp:script>
   </xp:this.resources>
   <xp:scriptBlock id="scriptBlock3" defer="false">
      <xp:this.value>
         <![CDATA[
            XSP.addOnLoad(function(){
               try{
                  // set the component instance's upload url...
                  // add RTE id's to this list as required so each instance has it's
                  // own unique upload url targetted at it's inputRichText component...
                  var instanceIds = [ "#{id:inputRichText1}", "#{id:inputRichText2}" ];
                  for(var x = 0; x < instanceIds.length; x++){
                     var url = document.location.href.substring(0, document.location.href.indexOf('?'));
                     if(null != url){
                        url += "?$$axtarget=" + instanceIds
  • +

                           "&$$viewid=" + XSP.findForm(instanceIds
  • )["$$viewid"].value;

                     }
                     CKEDITOR.instances[instanceIds
  • ].config.axtargetUrl = url;

                  }
               }catch(e){
                  console.log(e);
               }
            });
         ]]>
      </xp:this.value>
   </xp:scriptBlock>
   <xp:div themeId="container" style="width:900px">
      <xp:div id="container1">
         <evo:inputRichText id="inputRichText1"
            value="#{rteBean['document1.Body1']}">
            <xp:this.converter>
               <xp:converter
                  converterId="InputRichTextConverter">
               </xp:converter>
            </xp:this.converter>
            <xp:this.dojoAttributes>
               <xp:dojoAttribute name="extraPlugins"
                  value="AttachmentExtension,ImageExtension">
               </xp:dojoAttribute>
               <xp:dojoAttribute name="toolbar">
                  <xp:this.value>
                     <![CDATA[#{javascript:
                         var customToolbar = "[\n" +
                            "['Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'Strike', 'TextColor', 'BGColor'],\n" +
                           "['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'NumberedList', 'BulletedList', 'Outdent', 'Indent'],\n" +
                           "['Attachment', 'ImageEx', 'Table', 'Link', 'Smiley'],\n" +
                           "['MenuPaste', 'Find', 'Maximize', 'Source']\n" +
                         "]";
                         return customToolbar;
                       }]]>
                  </xp:this.value>
               </xp:dojoAttribute>
            </xp:this.dojoAttributes>
         </evo:inputRichText>
         <xp:br></xp:br>
         <xp:br></xp:br>
         <xp:fileDownload rows="30" id="fileDownload1"
            displayLastModified="false" value="#{document1.Body1}" allowDelete="true">
         </xp:fileDownload>
      </xp:div>
      </xp:div>
   
   </xp:view>



Gruß,
Helmut



Offline HeLotes

  • Junior Mitglied
  • **
  • Beiträge: 56
Re: Xpages extended richt text Feld
« Antwort #3 am: 18.10.18 - 09:26:39 »
habe den Fehler gefunden

im Package Explorer in WEB-INF war faces-config.xml noch nicht vollständig

 

Impressum Atnotes.de  -  Powered by Syslords Solutions  -  Datenschutz