Ticket #518 (closed new feature: fixed)

Opened 5 months ago

Last modified 4 months ago

add the possibility to set the visibility of a form's field in a controller

Reported by: bastnic Assigned to: laurentj
Priority: normal Milestone: Jelix 1.1 beta 1
Component: jelix:forms Version: 1.0.2
Severity: normal Keywords:
Cc: Php version:
Review: Hosting Provider:
Documentation needed: 1 Blocking:

Description

Sometimes, I need to hide a field in a form for someone who have not enough rights to change the value. So I have to create another form.

It could be great if we can do $form->getControl('mycontrol')->visibility = false, or something like that.

That's just an idea. What do you think about that ?

Change History

03/21/08 11:13:44 changed by laurentj

Why not. But I think we should have a method instead of a simple property.

With a simple property, on actions which retrieves submitted datas, you have to check again rights to set the visibility property on field in your controller, so the initFromRequest method could modify only datas from visible controllers, to avoid security issues. (properties on control objects are not persistent between two actions).

This is not terrible, to repeat at each action this "visibility" setting.

So I think it is better to have a setVisibility() method (on jFormsBase ?). This method won't set a property on the control object itself, but will set this property in the data container (the object which is stored in sessions). So in other actions, we don't have to setup the visibility status again and again.

03/27/08 01:01:48 changed by laurentj

  • owner set to laurentj.
  • status changed from new to assigned.

04/13/08 22:55:51 changed by laurentj

  • status changed from assigned to closed.
  • resolution set to fixed.

New feature landed in the trunk: there are some new method jFormsBase::deactivate() an jFormsBase::isActivated().

04/14/08 02:06:19 changed by bastnic

Thanks you.

04/27/08 00:32:33 changed by laurentj

  • docneeded set to 1.
Download in other formats: Comma-delimited Text Tab-delimited Text RSS Feed