2011-09-05 3 views
0

같은 탭 패널 뭔가있어방지 양식 richfaces의 탭 패널과 탭 스위치에 제출

<ui:composition 
    xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:h="http://java.sun.com/jsf/html" 
    xmlns:ui="http://java.sun.com/jsf/facelets" 
    xmlns:rich="http://richfaces.org/rich" 
    xmlns:a4j="http://richfaces.org/a4j" 
    xmlns:f="http://java.sun.com/jsf/core" 
    xmlns:advanced="http://java.sun.com/jsf/composite/advanced">  

    <h:panelGroup id="description">   
     // ... 
     <h:outputLabel value="Name"/> 
     <h:inputText id="name" 
         value="#{testTree.selected.name.text}" 
         rendered="#{description.editing}"/>  
     // ... 
     <advanced:button text="Reset" //Just a little upgraded a4j:commandButton 
         icon="images/clear.png" 
         action="#{description.resetEditing()}" 
         execute="@this"         
         render="description" 
         rendered="#{description.editing}"/>    
     <advanced:button text="Save" 
         icon="images/save2.png" 
         action="#{description.commitEditing()}" 
         execute="description" // #name and a few more fields     
         render="description" 
         rendered="#{description.editing}"/> 
    </h:panelGroup> 
</ui:composition> 

내가 가진 두 번째 탭으로 전환을 내 "설명"양식이 제출되었으며 이것은 좋지 않습니다. 대신 모든 입력란을 재설정하고 싶습니다.

어떻게 RichFaces 4에서 이것을 수행 할 수 있습니까?

답변

1

기본적으로 탭간에 전환 할 때 상위 탭 패널이 제출됩니다. tabPanel의 switchType 속성을 ajax 또는 client로 사용하여이 동작을 변경할 수 있습니다. 각 탭

에 대한 양식을 포함 클라이언트

    1. 변경 switchType 속성을 : 나는 하나 개의 탭에서 다른 변경에 제출되는 양식을 방지하기 위해 두 가지 방법을 생각할 수

      양식이 정의 된 곳을 볼 수는 없지만 풍부한 서식을 추측하고 있습니다. tabPanel은 양식 안에 있습니다. description.xhtml 페이지에 정의 된 양식이없는 것을 확인했습니다. 당신은 당신이 가지고있는 양식을 제거하려고하고 description.xhtml에 즉, 각 탭에 대한 양식을 추가 할 수 있습니다 : 나는 또한 있도록 아약스에 탭 패널의 switchType 속성을 설정합니다

      <ui:composition 
      xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:ui="http://java.sun.com/jsf/facelets" 
      xmlns:rich="http://richfaces.org/rich" 
      xmlns:a4j="http://richfaces.org/a4j" 
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:advanced="http://java.sun.com/jsf/composite/advanced">  
      
      <a4j:form> 
      <h:panelGroup id="description">   
          // ... 
          <h:outputLabel value="Name"/> 
          <h:inputText id="name" 
              value="#{testTree.selected.name.text}" 
              rendered="#{description.editing}"/>  
          // ... 
          <advanced:button text="Reset" //Just a little upgraded a4j:commandButton 
              icon="images/clear.png" 
              action="#{description.resetEditing()}" 
              execute="@this"         
              render="description" 
              rendered="#{description.editing}"/>    
          <advanced:button text="Save" 
              icon="images/save2.png" 
              action="#{description.commitEditing()}" 
              execute="description" // #name and a few more fields     
              render="description" 
              rendered="#{description.editing}"/> 
      </h:panelGroup> 
      </a4j:form> 
      </ui:composition> 
      

      탭 패널의 내용 만 새로 고침됩니다.

  • +0

    나는 tabPanel 주위에 폼이 있어야한다고 생각했지만 그렇지 않다면 ... 실제로 org.richfaces.component.UITabPanel (id = "j_id2114509110_7e08d978")은 부모 폼을 찾지 못했습니다. – mmoossen

    0

    1) 마지막으로, 나는 인터넷 검색을 6 시간 동안 한

    각 탭에 대한 양식을 포함 클라이언트
    2)에 switchType 속성을 변경 내 일이 속성 값을 변경
    , 다른 위해 저장 검색 여기에 끝났다.

    관련 문제