JSF 与 HTML 标签的联系_html/css_WEB-ITnose

WBOY
Lepaskan: 2016-06-24 11:51:44
asal
1157 orang telah melayarinya

*页面的开头

       href="/css/style_organ.css" />

       href="/css/public.css" />

       href="/css/ext.css" />

*假数据的构造

javax.faces.model.ArrayDataModel ad = new javax.faces.model.ArrayDataModel(str);

pageContext.setAttribute("ad", ad, PageContext.SESSION_SCOPE);

%>

1inputTextarea

常用属性:cols

          Rows

常用的写法:

2inputText

   常用属性:readonly

               Size       框的大小

               Maxlength  最多字符数

     常用的写法:

Maxlength=”6”

style=”color:yellow;background:Teal;” />

3outputText

常用属性:escape   如果设置为true,会转义和&字符。默认值为false   

使用举例:

 

         style="height:30;width:100%;text-align:center;" />

4outputFormat

此标签用于tag体中指定的参来格式化组合的消息,

例如:

 

 

 

 

5graphicImage

      常用例子:

          style=”border:thin solid black” />

           style=”border:0px” />

      

6commandButton

     常用属性:

         Type     

      使用举例:

     

            

            

       

       

              

       

       

       

       

       

              action="" styleClass="button" />

7commandLink

使用举例:

   

      〈h:outputText value=”#{msgs.linkTex}” />

   

8outputLink

使用举例:

   

                  

   

                         

9selectBooleanCheckbox

      复选框(单个的)

      

10selectManyCheckbox

一组复选框

    

    

    

    

    

11selectOneRadio

       单选按钮

         

         

12selectOneListbox

  

     

         

         

         

         

     

13selectManyListbox

   

         

         

         

         

     

14iframe

15inputCalendar

       currentDayCellClass="currentDayCell" renderAsPopup="true" popupTodayString="Today" popupWeekString="Week" popupDateFormat="yyyyMMdd" value=""/> 

16datatable2

                                          

                                                 

                                                        

                                                 

                                                 

                                          

                                          

                                                 

                                                        

                                                 

                                                 

                                          

                                          

                                                 

                                                        

                                                 

                                                 

                                          

                                          

                                                 

                                                        

                                                 

                                          

       

17、表头为复杂的datatable

              

                     

                            

                                   valign="middle" bgcolor="#f3f3f3">

                                   

                            

                            

                                   

                            

                            

                                   

                            

                            

                                   

                            

                            

                                   

                            

                            

                                   

                            

                     

                     

                            

                                   

                            

                            

                                   

                            

                            

                                   

                            

                            

                                   

                            

                            

                                   

                            

                            

                                   

                            

                            

                                   

                            

                     

              

              

                     columnClasses="center" align="center">

                     

                            

                     

                     

                            

                     

                     

                            

                     

                     

                            

                     

                     

                            

                     

                     

                            

                     

                     

                            

                     

                     

                            

                     

                     

                            

                     

                     

                            

                     

                     

                            

                     

              

18HRDCdatatable

       

              

                     

              

              

              

       

       

              

                     

              

              

       

       

              

                     

              

              

       

       

              

                     

              

              

       

       

              

                     

              

              

       

       

              

                     

              

              

       

       

              

                     

              

              

       

       

              

                     

              

              

       

       

              

                     

              

              

       

       

              

                     

              

              

       

       

              

                     

              

              

       

       

              

                     

              

              

       

       

              

                     

              

              

                     

              

       

19panelGrid

 

       

              columnbgcolors="#F3F3F3,#FFFFFF,#F3F3F3,#FFFFFF"

              columnwidths="20%,30%,20%,30%"

               rowheights="22,22,22,22,22"

              columnbgcolors="#F3F3F3,#ffffff,#F3F3F3,#ffffff"

              columnaligns="left,center,right"

              columnvaligns="top,top,"

        colspan=”;2,2;2;3,1;”

              >

              

              

              

              

              

              

              

              

       

20selectOneMenu

       

       

       

       

       

       

       

       

       

21、标签页面:multlink

              

                     align="left" />

22、页面弹出(按钮)

800,320,100,100)” value=”选择下一个审批人” styleClass=”button” />

23、分页的代码

              

                     

                            lastRowIndexVar="lastRowIndex" style="display:inline" actionListener="#{customerMagnifierBackingBean.scrollerAction}">

                            

                                   

                            

                            

                                   

                            

                            

                                   

                            

                            

                                   

                            

                     

                     

                            

                                   

                                   

                                   

                            

                     

              

       

24、上传下载

文档上传必须统一使用myfaces控件,不得使用其他上传方法。

界面:

Backingbean:

InputStream inputStream = new BufferedInputStream(myFile.getInputStream());

下载必须采用Basebackingbean的downLoadFile方法:

/**

   * 文件下载

   * @param object FileInputStream或ByteArrayOutputStream

   * @param FileName 文件名

   * @param contenttype 下载类型

   */

  public void downLoadFile(Object object,String fileName,String contenttype)

界面主要是一个动作对应后台一个方法

Backingbean调用如下方法:

例如:

        public String downloadExcel()

        {

                 String contentType = "application/vnd.ms-excel";

                // 获得Excel文件流(可能是输出流,也可能是输入流)

                object = IBizApplicationUCC.downloadExcel(bizId)

                // 生成默认文件名

               defaultFileName = 文档类型代码.业务申报书 + BriefBizTaskVO.bizEventNumber

                //弹出窗口给界面下载

                downLoadFile(Object object,String defaultFileName ,String contenttype)

                return null;

        }

Label berkaitan:
sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan
Tentang kita Penafian Sitemap
Laman web PHP Cina:Latihan PHP dalam talian kebajikan awam,Bantu pelajar PHP berkembang dengan cepat!