[dev] Question to Horde Form Actions

Karim Geiger geiger at b1-systems.de
Mon Jul 9 09:27:00 UTC 2012


Hi *,

we're currently trying to get a Horde Form Action working.. here is the
current code we wrote so far:

class B1training_Form_Add extends Horde_Form {

    /**
     * Basic constructor for the SearchForm.
     *
     * @param  Horde_Variables $vars  The default variables to use.
     */
    function __construct($vars)
    {
        parent::__construct($vars, _("Add a training"));

        $this->appendButtons(_("Add"));

[...]

        $this->addVariable(_("Mobile classroom"),
                           'training_needclassroom', 'enum', true,
                           false, _("Do we need a mobile classroom?"),
                           array(array(1 => _('yes'), 0 => _('no')),
                           true));


        // This one is not working. Expected behavior:
        // If training_needclassroom = 1 then show training_sub
        //
        // Current behavior:
        // training_sub is always visible, no matter what value is set
        // on training_needclassroom

        $o = $this->addVariable(_("Sub-Item"), 'training_sub', 'text',
false);
        $params = array('target' => 'training_needclassroom',
                        'enabled' => true,
                        'values' => array(1));
        $o->setAction(new Horde_Form_Action_ConditionalEnable($params));

    }

}

I'd appreciate your help ;)

Regards,

Karim Geiger



-- 
Karim Geiger
Development TimeTool
Tel.: +49 (0) 172 2047997
Mail: geiger at b1-systems.de

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 559 bytes
Desc: OpenPGP digital signature
URL: <http://lists.horde.org/archives/dev/attachments/20120709/9f4327af/attachment.bin>


More information about the dev mailing list