
Techinical Reference Grouping data entries in XMLNuke
How to use XMLInputGroup to improve data entries in your forms.
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 Grouping data entries - XmlInputGroup Examples
Grouping data entries - XmlInputGroup
XMLNuke allows data entry fields to be grouped together. This way it is possible to modify the behavior of the presentation of these fields, with a field to the side of another instead of below another, in addition to hiding fields.
Example of grouping in PHP
$editform = new XmlFormCollection($this->_context, "module:sample", "Formulário");
$inputGroup = new XmlInputGroup($this->_context, "group", false);
$list = new XmlEasyList(EasyListType::SELECTLIST, "name1", "Caption1", $varArray);
$list->setRequired(true);
$inputGroup->addXmlnukeObject($list);
$txt = new XmlInputTextBox("Caption2", "name2", "", 15);
$txt->setMaxLength(15);
$txt->setRequired(true);
$inputGroup->addXmlnukeObject($txt);
$editform->addXmlnukeObject($inputGroup);
Example of grouping in CSharp
XmlFormCollection form = new XmlFormCollection(this._context, "module:sample", "Formulário");
XmlInputGroup inputGroup = new XmlInputGroup(this._context, "group", false);
XmlEasyList list = new XmlEasyList(EasyListType.SELECTLIST, "name1", "Caption1", arrValues);
list.setRequired(true);
inputGroup.addXmlnukeObject(list);
XmlInputTextBox txt = new XmlInputTextBox("Caption2", "name2", "", 15);
txt.setMaxLength(15);
txt.setRequired(true);
inputGroup.addXmlnukeObject(txt);
form.addXmlnukeObject(inputGroup);
Note that instead of adding objects for data entry to the XMLFormCollection, these were added to a group, and this group was added to the object of the form.
XmlInputGroup has the following arguments:
- Context ? the context of XMLNuke
- Name ? contains the name of that group. In the default transformation, XMLNuke will create a JavaScript with the name showHide_[NAME](true/false) which will allow the group inside to be hidden or displayed based on a JavaScript command.
- Line Break ? If TRUE, the field will be below the other. If FALSE, the field will be to the side of the other.
- CanHide ? If TRUE, allows the user to hide or show the defined group.
- Caption: Defines a label for this group. it is only displayed with CanHide = true.
Examples
|