Hi all,

 I´ve build a TimeSelector component based on the timespinner component
http://j.a.l.free.fr/mootools/timespinner/. This is a component that looks
like a DateField. Everything works fine. But it works whit JavaScript to set
the default time. When I use the component in a form, everything works fine,
when used in a Table. I´ve a problem that i can´t use the getHtmlImport to
generate the initialization Script (because the table calls the
setValueObject and that is set after the getHmlImport is called).

I´ve solved it by adding a pageImport in the Render method, but now I´ve got
a dependency with the parent, which in this case was my on Table
implementation based on the FormTable. See code below.



Object parent2 = getParent();

if (parent2 instanceof SimpleTable) {

    Page page = ((SimpleTable)parent2).getPage();

    PageImports pageImports = getPage().getPageImports();

    pageImports.addImport(getControlField());

}



This only works when this page is set in the parent, in the SimpleTable the
page is always set, but it doesn't have to be set.

Is there a better way to do this ?



Regards Bert Heikamp

Reply via email to