【问题标题】:Button on the right issue正确问题上的按钮
【发布时间】:2014-05-31 10:12:06
【问题描述】:

我正在尝试将commandButton 放在右侧边距的面板组件的标题中。听起来只是一个html问题,我不知道为什么不起作用。

<p:panel id="panel" style="margin-bottom:10px;">
    <f:facet name="header" >
        <h:outputLabel value="#{partyBean.currentparty.name}" />
            <p:commandButton id="asktojoin" style="margin-right:10px" action="#{joinRequestBean.askForParty(partyBean.currentparty)}" value="Ask to Join">
            </p:commandButton>
    </f:facet>
    .....

按钮出现在左侧,靠近outputLabel

【问题讨论】:

  • bhdrk 的回答看起来不错,但另外 style="float:right" 应该会有所帮助

标签: html css jsf primefaces margin


【解决方案1】:

有一个“动作”方面。您可以在此方面放置操作按钮。

<p:panel id="panel" style="margin-bottom:10px;">
    <f:facet name="header">
        <h:outputLabel value="#{partyBean.currentparty.name}"/>
    </f:facet>
    <f:facet name="actions">
        <p:commandButton id="asktojoin" styleClass="ui-panel-titlebar-icon "
                         action="#{joinRequestBean.askForParty(partyBean.currentparty)}" value="Ask to Join"/>
    </f:facet>

    ...

</p:panel>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-02-07
    • 1970-01-01
    • 2016-06-11
    • 1970-01-01
    • 2011-01-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多