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: __ActionBoxComponent


      Class Overview

      ActionBox is a component containing the result of executing a controller action.

      It accepts 3 main parameters: a controller, an action (optional, if not given, it executes the default controller's action) and a list of parameters (optional). The actionbox renders the result of executing the given action with the given parameters.

      The ActionBox tag is "actionbox"

      i.e.

      1.    <comp:actionbox controller "invoiceList"
      2.                    parameters "list_type=simple&page_number=1" />

      To improve the performance, by default an actionbox does not render the same action with the same parameters twice.
      It caches the latest response and serves it. However, we can force that execution by setting the autorefresh property to true.

      Autorefresh = true will force the action execution for each new request (ajax requests not included).

      Last, parameters set to the actionbox will be sent to the controller within the local request, not the global request.
      To recover the local request, we must ask the __ActionDispatcher

      i.e.
      1.    //get the local request
      2.    $request __ActionDispatcher::getInstance()->getRequest();


      __UIComponent
         |
         --__ActionBoxComponent

      Properties

      Methods

      [ Top ]

      Inherited Properties, Constants, and Methods

      Inherited Properties Inherited Methods Inherited Constants

      Inherited From __UIComponent

      Inherited From __UIComponent


      [ Top ]

      Properties Summary

      mixed   $_action  
      mixed   $_autorefresh  
      mixed   $_controller  
      mixed   $_dirty  
      mixed   $_latest_response  
      mixed   $_parameters  
      mixed   $_refresh_actionbox  
      mixed   $_synchronize_client  

      [ Top ]

      Method Summary

      void   addParameter()   Add a parameter to be sent to the controller as part of the request
      void   clear()   Clear the actionbox content
      void   clearParameters()   Reset the parameters associated to the action execution
      void   execute()   Alias of executeAction
      void   executeAction()   Executes the action associated to the current actionbox, setting the result to the actionbox response.
      string   getAction()   Get the action code to be executed to.
      bool   getAutorefresh()   Get the autorefresh property
      string   getContent()   Alias of getResponse()
      string   getController()   Get the controller code corresponding to the controller to be executed to
      array   getParameters()   Get an array of parameters set to be sent within the local request to the action
      string   getResponse()   Get the response that the current actionbox will be render to the client
      bool   isUnsynchronized()   For interal usage only, this method checks if the current response can be rendered to the client
      void   refresh()   Forces the execution of the current action, refreshing the results in the action box
      void   setAction()   Set the action code corresponding to the action to be executed to.
      void   setAutorefresh()   Set the autorefresh property
      void   setContent()   Alias of setResponse()
      void   setController()   Set the controller code corresponding to the controller to be executed to
      void   setParameters()   Set all the parameters in one-time call. Parameters can be either an array of pair key,value, or a comma-separated list of pairs
      void   setResponse()   Set the response that the current actionbox must render to the client.
      void   _canRefresh()  
      void   __wakeup()  

      [ Top ]

      Properties

      mixed   $_action = null
      Access:  protected


      mixed   $_autorefresh = true
      Access:  protected


      mixed   $_controller = null
      Access:  protected


      mixed   $_dirty = false
      Access:  protected


      mixed   $_latest_response = ""
      Access:  protected


      mixed   $_parameters = array()
      Access:  protected


      mixed   $_refresh_actionbox = false
      Access:  protected


      mixed   $_synchronize_client = false
      Access:  protected


      Methods

      addParameter


        void addParameter( string $parameter_name, mixed $parameter_value  )

      Add a parameter to be sent to the controller as part of the request


      Parameters:
      TypeNameDescription
      string $parameter_name
      mixed $parameter_value

      Access:  public



      clear


        void clear( )

      Clear the actionbox content

      Access:  public



      clearParameters


        void clearParameters( )

      Reset the parameters associated to the action execution

      Access:  public



      execute


        void execute( [ $force_execution = false]  )

      Alias of executeAction


      Parameters:
      TypeNameDescription
      $force_execution

      Access:  public



      executeAction


        void executeAction( [ $force_execution = false]  )

      Executes the action associated to the current actionbox, setting the result to the actionbox response.

      If autorefresh property is set to true (default value), the actionbox will be executed in each non-ajax request even if no new control values has been set (same action, same controller and same parameters)



      Parameters:
      TypeNameDescription
      $force_execution

      See:  __ActionBoxComponent::getResponse
      Access:  public



      getAction


        string getAction( )

      Get the action code to be executed to.

      Access:  public



      getAutorefresh


        bool getAutorefresh( )

      Get the autorefresh property

      Access:  public



      getContent


        string getContent( )

      Alias of getResponse()

      Access:  public



      getController


        string getController( )

      Get the controller code corresponding to the controller to be executed to

      Access:  public



      getParameters


        array getParameters( )

      Get an array of parameters set to be sent within the local request to the action

      Access:  public



      getResponse


        string getResponse( )

      Get the response that the current actionbox will be render to the client

      Access:  public



      isUnsynchronized


        bool isUnsynchronized( )

      For interal usage only, this method checks if the current response can be rendered to the client

      Access:  public



      refresh


        void refresh( )

      Forces the execution of the current action, refreshing the results in the action box

      Access:  public



      setAction


        void setAction( string $action  )

      Set the action code corresponding to the action to be executed to.


      Parameters:
      TypeNameDescription
      string $action

      Access:  public



      setAutorefresh


        void setAutorefresh( bool $autorefresh  )

      Set the autorefresh property


      Parameters:
      TypeNameDescription
      bool $autorefresh

      Access:  public



      setContent


        void setContent( string $text  )

      Alias of setResponse()


      Parameters:
      TypeNameDescription
      string $text

      Access:  public



      setController


        void setController( string $controller  )

      Set the controller code corresponding to the controller to be executed to


      Parameters:
      TypeNameDescription
      string $controller

      Access:  public



      setParameters


        void setParameters( mixed $parameters  )

      Set all the parameters in one-time call. Parameters can be either an array of pair key,value, or a comma-separated list of pairs


      Parameters:
      TypeNameDescription
      mixed $parameters

      Access:  public



      setResponse


        void setResponse( string $text  )

      Set the response that the current actionbox must render to the client.

      This response is set as a result of the action execution, but can be set manually by calling this method



      Parameters:
      TypeNameDescription
      string $text

      Access:  public



      _canRefresh


        void _canRefresh( )

      Access:  protected



      __wakeup


        void __wakeup( )

      Access:  public