
Techinical Reference Automatically defining the values of Properties.
Automatically defining the values of Properties.
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 Automatically defining the values of Properties
Automatically defining the values of Properties
With XMLNuke, one or more properties of a module may be automatically attributed to values that were sent using GET or POST. This means that any box of text or parameter sent through a URL may be attributed directly to a property of the module.
The following steps must be following to do this:
- 1Indicate in the beginning of CreatePage() or within Setup() that you want to automatically attribute the parameters with bindParameters().
- 1Create a property within the form.
In the example below, the system will automatically define the value of the "Test" property if it is sent through a form or a parameter in the URL.
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.bindParameters();
.
.
.
}
.
.
.
/// <summary>
/// Define a property
/// </summary>
protected string _test;
public string Test
{
get { return this._test; }
set { this._test = value; }
}
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->bindParameters();
.
.
.
}
.
.
.
// Define a test property.
// The getter and setter methods must be defined.
/**
@var string $_test
*/
protected $_test;
public function setTest($value)
{
$this->_test = $value;
}
public function getTest()
{
return $this->_test;
}
|