
Techinical Reference Processing Events with the Click of a Button.
Processing Events with the Click of a Button.
Table of contents 1. The IModule Interface 2. Data Repository - AnyDataSet 3. Uploading Documents 4. Grouping data entries in XMLNuke 5. Personalized validation in JavaScript 6. Adding Pieces of JavaScript Code 7. Creating your own XML objects 8. Internationalization with XMLNuke. 9. Processing Events with the Click of a Button. 10. Automatically defining the values of Properties
On this page Processing Events with the Click of a Button.
Processing Events with the Click of a Button.
With XMLNuke,buttons capable of setting off events when the buttons are pressed can be created. These will be processed directly to the server and automatically.
The following steps must be followed to do this:
- 1.Indicate in the beginning of CreatePage() or within Setup() that you want to process events in the module through the processEvent() method
- 1.Add a button to the form which will set off an event.
- 1.Create the method that will process the event.
Example in CSharp
public override IXmlnukeDocument CreatePage()
{
// Call this method within SETUP() or in the beginning of CREATEPAGE()
// If this method is not executed the events will not be set off.
this.processEvent();
.
.
.
XmlFormCollection form = new XmlFormCollection(this._context, "module:sample", "Exemplo");
XmlInputButtons button = new XmlInputButtons();
// In this example, a button will be added which will set off the Method_Event()
button.addClickEvent("Teste Evento", "Metodo");
}
.
.
.
/// <summary>
/// Method which will execute the event defined above.
/// </summary>
public void Metodo_Event()
{
Debug.Print("Event fired");
}
Example in PHP
public function CreatePage()
{
// Call this method within SETUP() or in the beginning of CREATEPAGE()
// If this method is not executed the events will not be set off.
$this->processEvent();
.
.
.
$form = new XmlFormCollection($this->_context, "module:sample", "Exemplo");
$button = new XmlInputButtons();
// In this example, a button will be added which will set off the Method_Event()
$button->addClickEvent("Teste Evento", "Metodo");
}
.
.
.
/**
@desc Method which will execute the event defined above.
*/
public function Metodo_Event()
{
Debug::PrintValue("Event fired");
}
|