Hi Hari,

There are two things here,

First, the included="XXX" in TelluriumConfig.groovy should include
your bootstrap class name,
not the widget name

Second, for widgets, you better to define a module to include all
widgets you want
to define. That is to say, you should define a base class like,

abstract class ExtJSWidget extends Widget {
    public static final String NAMESPACE = "ExtJS"

}

The namespace is used to avoid widget name collision. Then your
widgets should extend
this base class so that they come with the same namespace.

Actually, the extjs-widget project is an empty template project,
please check it out
and play around and you will see how widget works.

Please let me know if you have any further questions.

Thanks,

Jian

On Feb 25, 8:40 am, Harihara Vinayakaram <[email protected]> wrote:
> Hi
>    When I try to define my own widget I am getting the following problem
> when I try to run my test case .  Can somebody point out what am I missing
>
> Caused by: org.codehaus.groovy.runtime.typehandling.GroovyCastException:
> Cannot cast object 'com.yostech.yoscare.widget.richcalen...@856c134' with
> class 'com.yostech.yoscare.widget.RichCalendar' to class
> 'org.tellurium.widget.WidgetBootstrap'
>
> I have the following definitions  all the 3 are defined in the same package
> com.yostech.yoscare.widget;
>
> ########
> class RichCalendar extends Widget {
>      public void defineWidget() { ..... }}
>
> ################
> class RichCalendarBuilder extends UiObjectBuilder {
>
>  public build(Map map, Closure c) {
>        //add default parameters so that the builder can use them if not
> specified
>         def df = [:]
>         RichCalendar richcalendar = this.internBuild(new RichCalendar(),
> map, df)
>         richcalendar.defineWidget()
>
>         return richcalendar
>     }
>
> }
>
> ##############
> class Init implements WidgetBootstrap{
>
>     public void loadWidget(UiObjectBuilderRegistry uiObjectBuilderRegistry)
> {
>         if(uiObjectBuilderRegistry != null){
>
> uiObjectBuilderRegistry.registerBuilder("com.yostech.yoscare.widget.RichCalendar",
> new RichCalendarBuilder())
>
>         }
>     }
>
> and the TelluriumConfig has
> widget{
>         module{
>             //define your widget modules here, for example Dojo or ExtJs
> //            included="dojo, extjs"
>             included="com.yostech.yoscare.widget.RichCalendar"
>         }
>     }
>
> Regards
> Hari
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tellurium-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/tellurium-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to