2014-05-31 1 views
0

나는 단지 오른쪽 여백에있는 패널 구성 요소의 헤더에 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에 가깝습니다.

+1

bhdrk의 대답은 멋지지만 그렇지 않으면 style = "float : right"가 도움이됩니다. –

답변

2

< p : 패널/>에는 "작업"패싯이 있습니다. 이 패싯에 작업 단추를 넣을 수 있습니다.

<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>