Assign text to a new button in script? Passing parent as an arguement?

View: New views
2 Messages — Rating Filter:   Alert me  

Assign text to a new button in script? Passing parent as an arguement?

by xkenneth :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

All,

   Most of my application looks like it's going to be programatic  
instead of declarative. I'm trying to create a new button (var  
new_button = lz.button(parent),) but I'm unsure as to how to set the  
text of the button afterwards. (new_button.text = 'test') does not  
work, and looking through the reference, I didn't see any obvious  
setter methods, or in the lz.html base classes. Are there any  
tutorials on how to make a mostly programatic OpenLaszlo App?

Also, I have a button that calls a function on the onclick method, how  
can I pass the buttons parent as an argument to the function?

Regards,
Ken

Re: Assign text to a new button in script? Passing parent as an arguement?

by P T Withington-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You want new_button.setAttribute('text', ...)

On Jul 20, 2008, at 14:09, Kenneth Miller <xkenneth@...> wrote:

> All,
>
>  Most of my application looks like it's going to be programatic  
> instead of declarative. I'm trying to create a new button (var  
> new_button = lz.button(parent),) but I'm unsure as to how to set the  
> text of the button afterwards. (new_button.text = 'test') does not  
> work, and looking through the reference, I didn't see any obvious  
> setter methods, or in the lz.html base classes. Are there any  
> tutorials on how to make a mostly programatic OpenLaszlo App?
>
> Also, I have a button that calls a function on the onclick method,  
> how can I pass the buttons parent as an argument to the function?
>
> Regards,
> Ken