Hello Taha,

what you can do is to contribute a new DataTypeAnalyzer and then
contribute its bean block source. The DataTypeAnalyzer is a
orderedlist so you can control their order.

For example if you would like to override the date selector used by
tapestry u should have something like this in your module:

public static void
contributeDataTypeAnalyzer(OrderedConfiguration<DataTypeAnalyzer>
configuration) {
   configuration.add(DateTypeAnalyzer.DATE_TYPE, new
DateTypeAnalyzer(), "before:*");
}

public void contributeBeanBlockSource(Configuration<BeanBlockContribution>
configuration) {
    configuration.add(new
BeanBlockContribution(DateTypeAnalyzer.DATE_TYPE, "BrandingBlocks",
"dateBlock", true));
}


The DateTypeAnalyzer is something like:
public class DateTypeAnalyzer implements DataTypeAnalyzer {

        public static final String DATE_TYPE = "nebulaDate";

        @Override
        public String identifyDataType(PropertyAdapter adapter) {
                Class<?> propertyType = adapter.getType();
                if (Date.class.equals(propertyType)){
                        return DATE_TYPE;
                }
                
                return null;
        }
}

finally you define the block. for example:
<t:block t:id="dateBlock">
                <t:label for="dateSelector"/>
                <select t:id="dateSelector" t:firstYear="firstYear"
t:lastYear="lastYear" t:value="prop:context.propertyValue"
t:label="prop:context.label" t:validate="prop:dateValidator"
t:translator="prop:dateTranslator" >
                </select>
  </t:block>


I hope it helps :)




On Mon, Nov 1, 2010 at 4:33 AM, Taha Hafeez <tawus.tapes...@gmail.com> wrote:
> I am trying to override default editing components as I want to remove the
> labels.. but contributeBeanBlockSource() is called in a random order (at
> times before and at times after the TapestryModules's
> contributeBeanBlockSource()). . I used @Order("after:*") but it is still
> random.
>
> Someone already had the same issue(
> http://www.mail-archive.com/users@tapestry.apache.org/msg29783.html). Has
> this been resolved or I am doing something wrong...
>
> Taha
>

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

Reply via email to