2016-07-28 62 views
1

我試圖顯示FileUpload高級模式和ajax功能,但我希望使它看起來像簡單模式,其中顯示只是帶有標籤名稱的按鈕, 這是我的一個facelet使p:fileUpload高級模式顯示爲簡單模式

<p:fileUpload fileUploadListener="#{scriptManagerForm.uploadSourceFile}" auto="true" 
            skinSimple="true"> 
         <f:attribute name="name" value="#{sourcefile.name}" /> 
    </p:fileUpload> 

這個CSS

.fileupload-content{ 
       display: none; 
      } 
      .ui-fileupload .fileinput-button { 
       background-color: rgba(142, 103, 64, 0.98); 
      } 

謝謝你,

+1

後一些代碼後,我希望你所看到的是'Primefaces'之前完成問這個問題 –

+0

是的,我見過primefaces doc,我會更新帖子來添加一些代碼。 – mustafa918

回答

0

不知道你爲什麼會想這樣做,但是從CSS p erspective的代碼如下:

/*Hide the advanced buttons and progress*/ 
.ui-fileupload-upload, .ui-fileupload-cancel, .ui-fileupload-progress{ 
    display: none; 
} 

/*Move the file name and size of file onto same line*/ 
.ui-fileupload-buttonbar, .ui-fileupload-content{ 
    float: left; 
} 

/*Remove some of the margin from the file name to align correctly*/ 
.ui-fileupload-files{ 
    margin: 0; 
} 

原始

Before

CSS

After

+0

我還沒有測試過,但是這個看起來非常好,謝謝, – mustafa918