You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jaypax Ginete <ki...@gmail.com> on 2013/05/30 09:24:25 UTC

Need help in Fading out a zone

Hi, I need some help on how fade out a Zone. I kinda stumped on how to 
do this.

I have a select component paired with a zone. If a certain value in the 
selected then the zone will render. What I'm having trouble with is when 
the user another value after rendering the zone. It won't remove the zone.

My tml looks like this:

<div class="control-group">
                 <label class="control-label">Root Cause</label>
                 <div class="controls">
                     <t:select t:id="rootCause" value="rootCause" 
model="rootCauseSelectModel" encoder="RootCauseEncoder" 
t:zone="rootCauseMetaZone"/>
                 </div>
             </div>
             <t:zone t:id="rootCauseMetaZone" t:visible="false" 
t:update="fade">
                 <t:if test="isOtherRootCause">
                     <div class="control-group">
                         <label class="control-label">Specify Other Root 
Cause</label>
                         <div class="controls">
                             <input type="text"/>
                         </div>
                     </div>
                 </t:if>
             </t:zone>

A onValueChangeFromRootCause() function makes is appear but not disappear.

    @InjectComponent
     private Zone rootCauseMetaZone;

     @Inject
     private Request request;

     @Property
     private boolean isOtherRootCause = false;

     public Object onValueChangedFromRootCause(GuidanceRootCauses 
rootCause){
         if(rootCause.getLabel().equals("Others")){
             isOtherRootCause = true;
             return rootCauseMetaZone.getBody();
         }
         isOtherRootCause = false;
         return rootCauseMetaZone.getBody();
     }

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org