Location: PHPKode > projects > XMLNuke Web Development Framework XML > xmlnuke-php5-v3.5r356/xmlnuke-php5/data/sites/docs/xml/en-us/ref_inputgroup.en-us.xml
<?xml version="1.0" encoding="utf-8"?>
    <title>Grouping data entries in XMLNuke</title>
    <abstract>How to use XMLInputGroup to improve data entries in your forms.</abstract>
    <created>Mon Nov 5 2007 20:41:38</created>
    <modified>Wed Nov 19 2008 15:08:07</modified>
    <title>Grouping data entries - XmlInputGroup</title>
      <p>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.
      <p><code information="Example of grouping in PHP"><![CDATA[
$editform = new XmlFormCollection($this->_context, "module:sample", "Formulário");

$inputGroup = new XmlInputGroup($this->_context, "group", false);
$list = new XmlEasyList(EasyListType::SELECTLIST, "name1", "Caption1", $varArray);
$txt = new XmlInputTextBox("Caption2", "name2", "", 15);
      <p><code information="Example of grouping in CSharp"><![CDATA[
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);

XmlInputTextBox txt = new XmlInputTextBox("Caption2", "name2", "", 15);

      <p>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.</p>
<p><b>XmlInputGroup has the following arguments:</b>
<li>Context ? the context of XMLNuke</li>
<li>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.</li>
<li>Line Break ? If TRUE, the field will be below the other. If FALSE, the field will be to the side of the other.</li>
<li>CanHide ? If TRUE, allows the user to hide or show the defined group.
<li>Caption: Defines a label for this group. it is only displayed with CanHide = true.</li>
         <editform action="#" name="nomedoform" jsvalidate="true" decimalseparator="," dateformat="0" caption="Example Form">
             <inputgroup name="grp1" canhide="true" caption="Grupo 1 - CanHide enabled">
                 <textbox name="a" caption="Field 1" size="8"/>
                 <textbox name="b" caption="Field 2" size="8"/>
                 <textbox name="c" caption="Field 3" size="8"/>
             <inputgroup name="grp2" canhide="true" breakline="true" caption="Grupo 2 - CanHide enabled">
                 <textbox name="d" caption="Field 1" size="10"/>
                 <textbox name="e" caption="Field 2" size="10"/>
                 <textbox name="f" caption="Field 3" size="10"/>
             <caption value="Javascript to show/hide fields"/>
			<button caption="Hide Grp1" onclick="showHide_grp1(false);"/>
					<button caption="Show Grp1" onclick="showHide_grp1(true);"/>
					<button caption="Hide Grp2" onclick="showHide_grp2(false);"/>
					<button caption="Show Grp2" onclick="showHide_grp2(true);"/>

Return current item: XMLNuke Web Development Framework XML