users@woodstock.java.net

Re: setting style from Java code prevents changing from Javascript?

From: autozoom <cioni_mauro_at_yahoo.com>
Date: Wed, 30 Apr 2008 01:37:30 -0700 (PDT)

That's very right, thanks a lot


Dan Labrecque wrote:
>
> autozoom wrote:
>> Using woodstock components (4.2 b5) and dynamic faces transactions, if I
>> change a button's style from Java code like this:
>>
>> addIndirizzoButton.setImageURL("/resources/images/buttons/aggiungi.gif");
>>
>
> This is not a style property. In fact, this URL value is output as the
> src property of an HTML input element.
>
>> then I cannot change it anymore from client-side Javascript code like
>> this:
>>
>> $(addIndirizzoButtonID).setStyle({'background-image':'url(../resources/images/buttons/aggiungi.disabled.gif)'});
>>
>> What happens is that code is correctly executed, Firebug tells me that
>> style
>> property has changed, but I still see the "old" style in the browser.
>> This happens in Firefox, not tested in IE
>>
>
> This is not the correct way to set button properties. Please note that
> the public APIs are documented in the TLD docs below. In particular, see
> example #5 for the button tag.
>
> http://webdev2.sun.com/woodstock-tlddocs
>
> To encapsulate brand and functionality changes, you must use the
> Woodstock APIs. For example:||
>
> |<script type="text/javascript">|
> | var domNode = document.getElementById("form1:button1"); // Get
> button|
> | domNode.setProps({src: "myImage"});|
> |</script>|
>
> Dan
>
>

-- 
View this message in context: http://www.nabble.com/setting-style-from-Java-code-prevents-changing-from-Javascript--tp16958054p16978067.html
Sent from the Project Woodstock - Users mailing list archive at Nabble.com.