Documentation


SEARCH

TABLE OF CONTENT

    1. Getting started 2. Basic concepts 3. Request dispatching 4. Context container 5. Dual MVC 6. Component model: 7. Security 8. Configuration 9. Session handling 10. I18n 11. Cache 12. Logging 13. Error handling 14. Advanced Topics 15. API reference

      Tutorials: Frequently Asqued Questions

      See also:


      Class: __CommandButtonComponent


      Class Overview

      A command button represents a button.


      The main purpose of a command button is:

      • To submit a form (in case type="submit" and the command button is contained within a form component) or
      • To redirect the navigation to another page or
      • To execute a portion of code when the user click on it

      A command button tag is "commandbutton"

      i.e.

      1.    <comp:commandbutton name="submit_info" type="submit" caption="Submit your info"/>

      A command button has a caption, which is the text shown within the button.
      A command button also has a type (which is the same type as set in a html button)
      A command button has a src property to set the location of the image to show instead of the button itself.

      i.e.

      1.    <comp:commandbutton name="submit_info" src="url_to_image.jpg" type="submit"/>

      It's important to note that a command button of type="submit" and embedded within a form component will raise the submit event associated to that form when clicked.
      Of course, it will also raise the click event, but the better way to associate code to a form submit is within the submit event.


      See the commandbutton component in action here: http://www.lionframework.org/components/commandbutton.html


      See:  __FormComponent, __CommandLinkComponent
      __UIComponent
         |
         --__CommandButtonComponent

      Properties

      Methods

      [ Top ]

      Inherited Properties, Constants, and Methods

      Inherited Properties Inherited Methods Inherited Constants

      Inherited From __UIComponent

      Inherited From __UIComponent


      [ Top ]

      Properties Summary

      mixed   $_caption  
      mixed   $_on_click_submit  
      mixed   $_src  
      mixed   $_type  

      [ Top ]

      Method Summary

      string   getCaption()   Get the caption assocaited to the current button
      bool   getOnClickSubmit()   Check if the submit event must be raised or not when the button is clicked
      string   getSrc()   Get the image location associated to the current button
      string   getType()   Get the type attribute associated to the current button
      void   setCaption()   Set the caption shown within the button
      void   setSrc()   Set the image location associated to the current button (in case the button is type="image"
      void   setType()   Set the type attribute associated to the button (same as the HTML button type attribute)

      [ Top ]

      Properties

      mixed   $_caption = null
      Access:  protected


      mixed   $_on_click_submit = false
      Access:  protected


      mixed   $_src = null
      Access:  protected


      mixed   $_type = null
      Access:  protected


      Methods

      getCaption


        string getCaption( )

      Get the caption assocaited to the current button

      Access:  public



      getOnClickSubmit


        bool getOnClickSubmit( )

      Check if the submit event must be raised or not when the button is clicked

      Access:  public



      getSrc


        string getSrc( )

      Get the image location associated to the current button

      Access:  public



      getType


        string getType( )

      Get the type attribute associated to the current button

      Access:  public



      setCaption


        void setCaption( string $caption  )

      Set the caption shown within the button


      Parameters:
      TypeNameDescription
      string $caption

      Access:  public



      setSrc


        void setSrc( string $src  )

      Set the image location associated to the current button (in case the button is type="image"


      Parameters:
      TypeNameDescription
      string $src

      Access:  public



      setType


        void setType( string $type  )

      Set the type attribute associated to the button (same as the HTML button type attribute)


      Parameters:
      TypeNameDescription
      string $type

      Access:  public