programing

상위 구성 요소의 Ajax 업데이트에서 하위 구성 요소를 제외하는 방법은 무엇입니까?

stoneblock 2023. 7. 28. 21:44

상위 구성 요소의 Ajax 업데이트에서 하위 구성 요소를 제외하는 방법은 무엇입니까?

프라임페이스를 사용하고 있습니다.<p:ajax>내 코드의 태그.상위 구성 요소를 업데이트하는 Ajax 호출에서 하위 구성 요소를 업데이트에서 제외하려면 어떻게 해야 합니까?

PrimeFaces 3.3 이상을 사용하는 경우 PrimeFaces Selector를 사용할 수 있습니다.이를 통해 에서 jQuery CSS 선택기 구문을 사용할 수 있습니다.process그리고.updatePrimeFaces Ajax 구성 요소의 특성입니다.

예:

<h:form>
    <h:inputText ... />
    <h:inputText ... />
    <h:inputText ... styleClass="noupdate" />
    <h:inputText ... />
    <h:inputText ... />
    <p:commandButton ... update="@(form :not(.noupdate))"/>
</h:form>

이 예제는 다음을 포함하는 입력을 제외한 전체 양식을 업데이트합니다.class="noupdate"고객 측에서.

특정 구성 요소의 모든 자식을 업데이트하려면 'form'을 주변 구성 요소(또는 클래스 또는...)의 ID로 바꿉니다.

<h:form id="form">
    <h:panel id="myPanel">
        <h:inputText ... />
        <h:inputText ... />
        <h:inputText ... styleClass="noupdate" />
    </h:panel>
    <h:inputText ... />
    <h:inputText ... />
    <p:commandButton ... update="@(form :not(.noupdate))"/>
</h:form>

<p:commandButton ... update="@(#form\:myPanel :not(.noupdate))"/>

전체 클라이언트 측 ID를 사용하는지 확인하십시오.

참고 항목:

언급URL : https://stackoverflow.com/questions/12614882/how-to-exclude-child-component-in-ajax-update-of-a-parent-component