In the process of developing the ADF, Tab pages are commonly used to components. When using tab pages, you often need to process some special logic when clicking tab pages, therefore, you need to obtain the event when you switch the tab page.
The following example shows how to click the "test1" tab and output "Exit from the" Test2 "tab and click the" test1 "tab to enter the" test1 "tab". Then, click "Test2" to the "tab, output "Exit test1 tab, click Test2 tab to go to Test2 tab ".
Package hand. test. view. backing; <br/> Import Org. apache. myFaces. trinidad. event. disclosureevent; <br/> public class paneltabbedtest {<br/> Public paneltabbedtest () {<br/>}< br/> Public void test1disclosurelistener (disclosureevent) {<br/> If (disclosureevent. isexpanded () {<br/> system. out. println ("click the test1 tab"); <br/> system. out. println ("go to the test1 tab page"); <br/>} else {<br/> system. out. println ("Exit test1 tab"); <br/>}< br/> Public void test2disclosurelistener (disclosureevent) {<br/> If (disclosureevent. isexpanded () {<br/> system. out. println ("click the Test2 tab page"); <br/> system. out. println ("go to the Test2 tab page"); <br/>} else {<br/> system. out. println ("leaving the Test2 tab page"); <br/>}< br/>
Implementation result: