2012-11-29 2 views
2

내가 함께 일하고 있어요 :다시 쓰게 부분 : popupPanel

<h:form> 
    <h:selectOneRadio value="#{testBean.option}" > 
     <f:selectItem itemValue="0" itemLabel="Option 0"/> 
     <f:selectItem itemValue="1" itemLabel="Option 1"/> 
     <f:ajax execute="@this" render="infoPanelId"/> 
    </h:selectOneRadio> 
    <a4j:outputPanel id="infoPanelId"> 
     <h:outputText value="Option 0 selected" rendered="#{testBean.option == '0'}"/> 
     <h:outputText value="Option 1 selected" rendered="#{testBean.option == '1'}"/> 
    </a4j:outputPanel> 
</h:form> 

와 빈 코드 :

@ManagedBean(name="testBean") 
@ViewScoped 
public class TestBean implements Serializable{ 

    private String option; 

    public String getOption() { 
     return option; 
    } 

    public void setOption(String option) { 
     this.option = option; 
    } 
} 

그것은 작동

- RichFaces 4.2.2 
- Mojarra 2.1.14 

은 간단합니다 아래의 코드를 볼 수 있습니다 괜찮아요, 그리고 그것은 간단합니다. 다시 렌더링은 예상대로 작동합니다. 그러나이 간단한 코드를 rich : popupPanel 태그 안에 넣으면 해당 코드가 작동하지 않습니다.

<h:form> 
    <a4j:commandButton 
     value="show popup" 
     oncomplete="#{rich:component('testPopup')}.show()" 
     render="testPopup" 
    /> 

    <rich:popupPanel id="testPopup" modal="false" autosized="true" resizable="false"> 
     <f:facet name="header"> 
      <h:outputText value="popup"/> 
     </f:facet> 
     <h:panelGrid columns="1"> 
      <h:selectOneRadio value="#{testBean.option}" > 
       <f:selectItem itemValue="0" itemLabel="Option 0"/> 
       <f:selectItem itemValue="1" itemLabel="Option 1"/> 
       <f:ajax execute="@this" render="infoPanelId"/> 
      </h:selectOneRadio> 
     <a4j:outputPanel id="infoPanelId"> 
       <h:outputText value="Option 0 selected" rendered="#{testBean.option == '0'}"/> 
       <h:outputText value="Option 1 selected" rendered="#{testBean.option == '1'}"/> 
      </a4j:outputPanel> 
     </h:panelGrid> 
    </rich:popupPanel> 
</h:form> 

그래서 popupPanel 내부의 코드가 작동하지 않습니다 이 코드 조각입니다. popupPanel의 일부를 다시 렌더링 할 수 없습니다. 따라서 두 가지 질문이 있습니다.

  1. 왜?
  2. 어떻게 작동시킬 수 있습니까? 기본 popupPanel으로

답변

4

1) 때문에이

+0

당신에게 블라디미르 감사 도움이해야 rich:popupPaneldomElementAttachment="form"을 추가하기 <body> 요소

2) 내부에 표시됩니다! 당신 말이 맞아 domElementAttachment가 속임수를 쓰죠. – Hubert

관련 문제