【问题标题】:how to putting bean to css style button如何将bean放入css样式按钮
【发布时间】:2013-11-08 01:02:33
【问题描述】:

我在 jsf 2 中使用 primefaces 3.5,我的页面有自定义菜单,它是 css 样式表。

我只创建了 LogOut 按钮,但我不知道如何正确放置 logout bean 而不会导致按钮样式崩溃。

按 bean 是:

#{loginBean.doLogout} 

HTML 页面代码:

    <body >

    <ui:composition template="/Templates/MasterTemplate.xhtml">
        <ui:define name="content">
<div class="inside">
    <div class="trans">
        <div class="fix">
        <a class="logo" href=""></a>
        <div class="show">
        <ul class="menu">
        <li > <a href="">اتصل بنا</a></li>
        <li > <a href="">LogOut button</a></li>  <<<***** here i want to put the tage ******* 
        <li > <a href="">التقارير</a>
        <ul >
        <li><a href="#{request.contextPath}/secured/Report/Student/SpecificStudent.xhtml">تقرير عن طالب محدد</a></li>
        <li><a href="#{request.contextPath}/secured/Report/Student/SpecificClass.xhtml">تقرير عن فصل محدد</a></li>
        </ul>
        </li>
        <li > <a href="http://sams-app.com/almnzm2-0/">الرئيسية</a></li>
        </ul>
        </div>
        <div class="both">
        </div>
    </div>
    </div>
</div>
<br />
<br />


<p:meterGaugeChart id="sample" value="#{chartBean.meterGaugeModel}" style="width:400px;height:250px" title="مستوى الحضور أمس لجميع الطلاب" label="نسبة الحضور/الطلاب"/>  



<p:meterGaugeChart id="custom" value="#{chartBean.meterGaugeModel}" showTickLabels="true" labelHeightAdjust="110" intervalOuterRadius="130"   
                               seriesColors="66cc66, 93b75f, E7E658, cc6666" style="width:400px;height:250px" title="Custom Options" label="km/h"/>  


        </ui:define>
    </ui:composition>
</body>
</html>

注意:我的 bean 工作正常:

            <h:commandLink action="#{loginBean.doLogout}" value="Logout"/> 

但我想用与 css 相同的上述按钮样式创建它。

【问题讨论】:

    标签: java css jsf jsf-2 primefaces


    【解决方案1】:

    您可以使用&lt;h:commandButton/&gt; 或将css 样式添加到您的&lt;h:commandLink/&gt; 以使其看起来像一个按钮。

    【讨论】:

      【解决方案2】:

      试试这个

      <h:commandButton 
          onclick="window.location.assign('#{request.contextPath}#{loginBean.doLogout}');return false;" />
      

      【讨论】:

        猜你喜欢
        • 2012-08-24
        • 2014-05-08
        • 1970-01-01
        • 1970-01-01
        • 2011-02-03
        • 1970-01-01
        • 2021-02-14
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多