0

Is there an "un-fulfill" attribute?

asked 2012-04-22 23:22:55 +0800

zknewbie1 gravatar image zknewbie1
370 4

Hi, I'm testing the "fulfill" attribute of the tabpanel tag and have a question. Please run the sample code below, then click Tab B and then Tab C. Notice the code behavior is that it "fulfills" the tab contents when clicking on the Tabs only once. Is there an "un-fulfill" option so that, say, when I click Tab B, the code will "un-fulfill" Tab A and Tab C, and only loads Tab B contents. Then when I click Tab A, the code will un-fulfill Tab B and Tab C contents, and only load Tab A content, etc... That way, the sample code below would have the correct behavior: when clicking on any Tab, it'll un-load all other Tab contents and only load the selected Tab content. In the sample test case, it should display the most current date/time when clicking any Tab. Any insight is greatly appreciated. Thanks..

<tabbox id="tb" height="300px">
    <tabs id="tabs">
        <tab id="A" label="Tab A" selected='true'/>
        <tab id="B" label="Tab B" />
        <tab id="C" label="Tab C" />
    </tabs>
    <tabpanels>
        <tabpanel>
		  <label id="labelA" />
          <timer id="timerA" delay="3000" 
             onTimer="labelA.setValue(new Date().toString())" />
		</tabpanel>
		
        <tabpanel fulfill='B.onSelect'>
		  <label id="labelB" />
          <timer id="timerB" delay="3000" 
             onTimer="labelB.setValue(new Date().toString())" />
		</tabpanel>
		
        <tabpanel fulfill='C.onSelect'>
		  <label id="labelC" />
          <timer id="timerC" delay="3000" 
              onTimer="labelC.setValue(new Date().toString())" />
		</tabpanel>
    </tabpanels>
</tabbox>

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2012-04-23 06:52:04 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

you can 'unload' = detach the components with xxx.getChildren().clear();

link publish delete flag offensive edit

answered 2012-04-23 12:55:36 +0800

zknewbie1 gravatar image zknewbie1
370 4

Thanks Terrytornado, do you mind modifying the sample code above so I could see how it's done? Thanks..

link publish delete flag offensive edit

answered 2012-04-23 20:28:25 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

My first quick shoot to modify the sample code fails. I'm not the zscript guy. I mean you can solve your issue in a clean java code controller by catching the onSelect events.

<tabbox id="tb" height="300px">
	<tabs id="tabs">
		<tab id="A" label="Tab A" selected='true' />
		<tab id="B" label="Tab B" onSelect='tabPanelC.getChildren().clear()' />
		<tab id="C" label="Tab C" onSelect='tabPanelB.getChildren().clear()' />
	</tabs>
	<tabpanels>
		<tabpanel>
			<label id="labelA" />
			<timer id="timerA" delay="3000" onTimer="labelA.setValue(new Date().toString())" />
		</tabpanel>

		<tabpanel id="tabPanelB" fulfill='B.onSelect'>
			<label id="labelB" />
			<timer id="timerB" delay="3000" onTimer="labelB.setValue(new Date().toString())" />
		</tabpanel>

		<tabpanel id="tabPanelC" fulfill='C.onSelect'>
			<label id="labelC" />
			<timer id="timerC" delay="3000" onTimer="labelC.setValue(new Date().toString())" />
		</tabpanel>
	</tabpanels>
</tabbox>

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2012-04-22 23:22:55 +0800

Seen: 164 times

Last updated: Apr 23 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More