2016-07-11 2 views
1

부트 스트랩과 동일한 파일 업로드 페이지를 시도했습니다. 나는이 오류를 얻는다. 나는 시험해 본다. 모든 구성 요소, Css, 이미지 및 모든 js 파일을 내 데이터베이스에 복사했습니다. 이 데모 데이터베이스에서 작동하지만 내 응용 프로그램의 DB :(XPage를로드하는 중 jquery 오류가 발생했습니다.

에 나는 JQuery와 파일 또는 JS 파일을 호출 할 수 없습니다 코드는 communicatate하지 않을 수 있습니다 생각 earch 다른 :( 난 내가 그리워 무엇 모른다. :(

여기 Error Screen

내 코드는 아래 .. UPDATE

<?xml version="1.0" encoding="UTF-8"?> 
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" 
    xmlns:xc="http://www.ibm.com/xsp/custom"> 
    <xp:this.data> 
     <xp:dominoDocument var="document1" formName="Contact"></xp:dominoDocument> 
    </xp:this.data> 
    <xp:this.resources> 
     <xp:script src="/JQueryXSnippet.js" clientSide="true"></xp:script> 
    </xp:this.resources> 
    <script type="text/javascript" src="bootstrapfileinput4/js/fileinput.js"></script> 

    <link rel="stylesheet" href="bootstrapfileinput4/css/fileinput.css" media="all" type="text/css" /> 
    <xp:scriptBlock id="scriptBlockInitFile"> 
     <xp:this.value> 
      <![CDATA[ 
      $(document).ready( 
       function() { 
        $('input[type=file]').fileinput({ 
         previewFileType: "image", 
         browseClass: "btn btn-primary", 
         browseLabel: "Browse", 
         browseIcon: '<i class="glyphicon glyphicon-plus"></i>', 
         removeClass: "btn btn-danger", 
         removeLabel: "Delete", 
         removeIcon: '<i class="glyphicon glyphicon-trash"></i>', 
         uploadClass: "btn btn-info", 
         uploadLabel: "Upload", 
         uploadIcon: '<i class="glyphicon glyphicon-upload"></i>', 
       }); 
       } 
      ); 
     ]]> 
     </xp:this.value> 
    </xp:scriptBlock> 

      <xp:panel xp:key="facetLeft"> 
       <xp:image url="/bootstrapxplogodb.jpg" id="image1"></xp:image></xp:panel> 
      <xp:panel xp:key="facetMiddle"> 
       <xp:br></xp:br> 
       <div class="page-header"> 
        <h2>Bootstrap FileInput</h2> 
        <h4>An enhanced HTML 5 file input for Bootstrap with file preview for 
        various files, offers multiple selection, and more. 
        The plugin allows you a simple way to setup an advanced file picker/upload 
        control built to work specially with Bootstrap CSS3 styles. 
        It enhances the file input functionality further, by offering support to 
        preview a wide variety of files i.e. images, text, html, video, audio, flash, and 
        objects.</h4> 
        <xp:link escape="true" id="link1" 
         text="Bootstrap in XPages: Using the new Bootstrap Fileinput Plugin in XPages Part I" 
         value="https://xpagesandmore.blogspot.nl/2015/06/bootstrap-in-xpages-using-new-bootstrap.html" 
         target="_blank"> 
        </xp:link> 
        <br/> 
       </div>    
       <xp:fileUpload id="fileUpload1" 
        value="#{document1.fileAttachment}"> 
        <xp:this.attrs> 
         <xp:attr name="accept" value="image/*" /> 
        </xp:this.attrs> 
       </xp:fileUpload> 
       <xp:br></xp:br> 
       <xp:br></xp:br> 
       <xp:fileDownload rows="30" id="fileDownload1" 
        displayLastModified="true" value="#{document1.fileAttachment}" 
        hideWhen="true" allowDelete="true"> 
       </xp:fileDownload>    
       <xp:br></xp:br> 
       <xp:button value="Save Document" id="button1" 
        styleClass="btn btn-primary" rendered="false"> 
        <xp:eventHandler event="onclick" submit="true" 
         refreshMode="complete"> 
         <xp:this.action> 
          <xp:actionGroup> 
           <xp:saveDocument></xp:saveDocument> 
           <xp:openPage name="/BootstrapFileInput4.xsp"></xp:openPage> 
          </xp:actionGroup> 
         </xp:this.action> 
        </xp:eventHandler> 
       </xp:button> 
       <xp:br></xp:br> 
       <xp:br></xp:br> 
      </xp:panel> 


</xp:view> 

(나는 그들이해야 곳의 모든 resoursces을 넣어)입니다 :

<?xml version="1.0" encoding="UTF-8"?> <xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xc="http://www.ibm.com/xsp/custom"> <xp:this.data> <xp:dominoDocument var="document1" formName="Contact"></xp:dominoDocument> </xp:this.data> <xp:this.resources> <xp:script src="/JQueryXSnippet.js" clientSide="true"></xp:script> </xp:this.resources> <script type="text/javascript" src="bootstrapfileinput4/js/fileinput.js"></script> <link rel="stylesheet" href="bootstrapfileinput4/css/fileinput.css" media="all" type="text/css" /> 

HERE IS THE NETWORK TAB

+0

가능한 [Xpages 부트 스트랩 업로드 제어] (http://stackoverflow.com/questions/36923078/xpages-bootstrap-upload-control) –

답변

1

:

는 파일 입력 플러그인과 동일한 문제에 대한이 중복 된 질문을 참조하십시오. Boostrap을 헤더에서 이동하기 전에 jQuery를 이동해야한다.

+0

(스크린 샷을 보면서)'form' 태그 안에 ExtLib (부트 스트랩'.min.js' 이전) 및 jQuery 1.11.0에서 jQuery 2.1.1을 조합 한 것처럼 보입니다. –

+1

은 무엇입니까? JQuery 2.1.1을 생각합니다. 부트 스트랩 플러그인이 함께 제공됩니다. 하지만 Jquery 1.11.0을 데이터베이스에 수동으로 넣었습니다. 2.1.1을 제거해야합니까? 아니면 1.11.0을 제거해야합니까? –

+0

확실히 jQuery를 두 번로드하면 문제가 발생합니다. 제거해야하는 항목은 브라우저 지원 및 플러그인 요구 사항에 따라 다릅니다. 어느 쪽이든 하나는 부트 스트랩 전에로드되어야합니다 :) – MarkyRoden

0

fileinput 함수 플러그인 16,는 탭 네트워크

+0

내 페이지는 다음과 같이 시작합니다. 이미 페이지 상단에있는 것 같습니다. –

3

이는 AMD 로더 문제입니다을 확인,로드되지 않습니다. - 부트 스트랩은 jQuery를에 종속 당신이 jQuery를하기 전에 bootstrap.min.js를로드하는 것 또한 보이는 https://stackoverflow.com/a/36924237/785061

관련 문제