public
Description: JavaScript Application Framework - JS library only
Home | Edit | New

Button_view

NOTE: In SC version 0.9.16 :outlet has been removed. So only use it for older versions of SC.

A button view creates a push button into the page.

Syntax:

 
   <%= button_view :button_id, 
            :outlet => true/false,
            :title => 'Button Title',
            :action => 'HelloWorld.appController.buttonPressed' 
    %>

Where:

  • :button_id :: The name of the button
  • :outlet :: Whether to export the view to JavaScript
  • :title :: The title (label )of the button
  • :action :: The method to be called when the button is clicked
  • :width :: The width of the button

To have the button enabled to a specific setting, bind the enabled property to a specific property:

 
   <%= button_view :button_id, 
            :outlet => true/false,
            :title => 'Button Title',
            :action => 'HelloWorld.appController.buttonPressed',
            :bind => {
                 :enabled => 'HelloWorld.appController.buttonsEnabled'
             }
    %>

Last edited by bjc, Thu Sep 11 20:33:08 -0700 2008
Home | Edit | New
Versions: