Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  // Copyright 2004, 2005 The Apache Software Foundation
  // Licensed under the Apache License, Version 2.0 (the "License");
  // you may not use this file except in compliance with the License.
  // You may obtain a copy of the License at
  // Unless required by applicable law or agreed to in writing, software
 // distributed under the License is distributed on an "AS IS" BASIS,
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.
 package org.apache.tapestry.valid;
Used to label an IFormComponent. Because such fields know their displayName (user-presentable name), there's no reason to hard code the label in a page's HTML template (this also helps with localization). [ Component Reference ]

Howard Lewis Lewis Ship
 public abstract class FieldLabel extends AbstractComponent
     // Parameter
     public abstract boolean isPrerender();

Gets the IForm and delegate, then renders the label obtained from the field. Does nothing when rewinding.
     protected void renderComponent(IMarkupWriter writerIRequestCycle cycle)
         IForm form = TapestryUtils.getForm(cyclethis);
         IFormComponent field = getField();
         if (field != null && isPrerender())
         if (cycle.isRewinding()) 
         String displayName = getDisplayName();
         if (displayName == null)
             if (field == null)
                 throw Tapestry.createRequiredParameterException(this"field");
             displayName = field.getDisplayName();
             if (displayName == null)
                 throw new BindingException(ValidMessages.noDisplayName(this,field), thisnullgetBinding("field"), null);
         IValidationDelegate delegate = form.getDelegate();
         String id = (field == null) ? null : field.getClientId();
         if (field != null)
         if (id != null
         if (field != null)

displayName parameter.
     public abstract String getDisplayName();

field parameter.
     public abstract IFormComponent getField();

raw parameter.
    public abstract boolean getRaw();
New to GrepCode? Check out our FAQ X