On Thursday, July 12, 2001, at 03:48 PM, David Ethell wrote:

>> Html html = new Html()
>>          .addElement(new Head()
>>          .addElement(new org.apache.ecs.html.Title("Entry Form")))
>>          .addElement(new Body()
>>             .setBgColor(HtmlColor.SILVER)
>>             .addElement(today)
>>             .addElement(scrolling)
>>             .setOnLoad("scrollMsg()")
>
>> "Can't invoke a method on a Void"
>
> The setOnLoad method returns a void and the addElement method can only
> accept an object, not a void which is what gets returned if the final
> method for your Body object is setOnLoad. There are two ways around
> this.
>
> One is to use the addAttribute method to set your onLoad function
> instead of using the setOnLoad. I know it's not as intuitive, but as
> addAttribute returns Element instead of void you can use it.

<snip>
i'd say that probably setOnLoad (and all the other javascript methods) 
should return the appropriate element type (in this case, body).

(maybe somebody would like to jump in here and tell me if there's a good 
reason why they were written that way.)

still, it'd be a lot of work to change unless we can think of some way to 
automate the process...

- robert

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to