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

Class: pnFormLinkButton

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

Class Overview

pnFormPlugin
   |
   --pnFormStyledPlugin
      |
      --pnFormLinkButton

LinkButton


Variables

Methods


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 49]
LinkButton

Link buttons can be used instead of normal buttons to fire command events in your form event handler. A link button is simply a link (anchor tag with some JavaScript) that can be used exactly like a normal button - but with a different visualization.

When the user activates a link 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 80]

Command argument

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



Type:   string


[ Top ]

$commandName =

[line 72]

Command name

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



Type:   string


[ Top ]

$confirmMessage =

[line 91]

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 64]

Name of command event handler method



Tags:

var:  Default is "handleCommand"

Type:   string


[ Top ]

$styleHtml =

[line 99]

CSS styling

Please ignore - to be changed.



Type:   mixed


[ Top ]

$text =

[line 58]

Displayed text in the link

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



Type:   string


[ Top ]



Class Methods


method getFilename [line 102]

void getFilename( )



[ Top ]

method raisePostBackEvent [line 134]

void raisePostBackEvent( &$render, $eventArgument)



Parameters:

   &$render  
   $eventArgument  

[ Top ]

method render [line 108]

void render( &$render)



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

Parameters:

   &$render  

[ Top ]


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