pnForm
[ class tree: pnForm ] [ index: pnForm ] [ all elements ]

Class: pnFormButton

Source Location: /system/pnForm/plugins/function.pnformbutton.php

Class Overview

pnFormPlugin
   |
   --pnFormStyledPlugin
      |
      --pnFormButton

Button


Variables

Methods


Child classes:

pnFormImageButton
Image button This button works like a normal pnFormButton with the exception that it displays a clickable image instead of a text button. It further more returns the X and Y coordinate of the click position in the image.

Inherited Variables

Inherited Methods

Class: pnFormStyledPlugin

pnFormStyledPlugin::renderAttributes()

Class: pnFormPlugin

pnFormPlugin::pnFormPlugin()
Constructor
pnFormPlugin::create()
Create event handler
pnFormPlugin::dataBound()
DataBound event handler
pnFormPlugin::decode()
Decode event handler
pnFormPlugin::decodePostBackEvent()
Decode event handler for actions that generate a postback event
pnFormPlugin::getIdHtml()
Utility function to generate HTML for ID attribute
pnFormPlugin::initialize()
Initialize event handler
pnFormPlugin::load()
Load event handler
pnFormPlugin::postRender()
PostRender event handler
pnFormPlugin::readParameters()
Read Smarty plugin parameters
pnFormPlugin::registerPlugin()
pnFormPlugin::render()
Render event handler
pnFormPlugin::renderAttributes()
pnFormPlugin::renderBegin()
RenderBegin event handler
pnFormPlugin::renderContent()
RenderContent event handler
pnFormPlugin::renderEnd()
RenderEnd event handler

Class Details

[line 44]
Button

Buttons can be used to fire command events in your form event handler. When the user activates a button the command name and command argument will be sent to the form event handlers handleCommand function. Example:

  1.   function handleCommand(&$render&$args)
  2.   {
  3.     if ($args['commandName'== 'update')
  4.     {
  5.       if (!$render->pnFormIsValid())
  6.         return false;
  7.  
  8.       $data $render->pnFormGetValues();
  9.  
  10.       DBUtil::updateObject($data'demo_data');
  11.     }
  12.  
  13.     return true;
  14.   }

The command arguments ($args) passed to the handler contains 'commandName' and 'commandArgument' with the values you passed to the button in the template.




[ Top ]


Class Variables

$commandArgument =

[line 75]

Command argument

This value is passed in the event arguments to the form event handler as the commandArgument value.



Type:   string


[ Top ]

$commandName =

[line 67]

Command name

This is the "commandName" parameter to pass in the event args of the command handler.



Type:   string


[ Top ]

$confirmMessage =

[line 86]

Confirmation message

If you set a confirmation message then a ok/cancel dialog box pops and asks the user to confirm the button click - very usefull for buttons that deletes items. You can use _XXX language defines directly as the message, no need to call <!--[pnml]--> for translation.



Type:   string


[ Top ]

$onCommand =  'handleCommand'

[line 59]

Name of command event handler method



Tags:

var:  Default is "handleCommand"

Type:   string


[ Top ]

$styleHtml =

[line 94]

CSS styling

Please ignore - to be changed.



Type:   mixed


[ Top ]

$text =

[line 53]

Displayed text on the button

You can use _XXX language defines directly as the text, no need to call <!--[pnml]--> for translation.



Type:   string


[ Top ]



Class Methods


method decodePostBackEvent [line 126]

void decodePostBackEvent( &$render)



Overridden in child classes as:

pnFormImageButton::decodePostBackEvent()

Overrides pnFormPlugin::decodePostBackEvent() (Decode event handler for actions that generate a postback event)

Parameters:

   &$render  

[ Top ]

method getFilename [line 97]

void getFilename( )



Overridden in child classes as:

pnFormImageButton::getFilename()

[ Top ]

method render [line 103]

void render( &$render)



Overridden in child classes as:

pnFormImageButton::render()

Overrides pnFormPlugin::render() (Render event handler)

Parameters:

   &$render  

[ Top ]


Documentation generated on Fri, 18 Jul 2008 21:45:40 +0200 by phpDocumentor 1.4.1