Coding for hiding a controller on a form

According to page 322 of the Advanced Programming Guide for FMP users, you can show/hide the controller, as quoted below:

“You can set the Controller property for each form to:
Use the default controller - provided by Servoy.
Use a custom controller - a form that you can design
Use no controller.
You can also show (or hide) the controller you specified when a form
gets displayed in a method.”

Does anyone know how to do this?

Thanks,
Jason

Hi Jason

In Layout/Designer mode you should see a list of Properties alongside the Form. If not select Elements / Properties. This panel shows the properties of whatever element (Field/Lable/Button) you have selected. To see the Form properties click in a blank area below the Form.

About 2/3 down the list of Properties is “controller” - double click to see the choice of Controllers - sleect none or your own custom controller.

HTH

Graham Greensall
Worxinfo Ltd

This does not help me in a method. I need to set this with javascript. You are describing manually setting it in design mode.

Thanks,
Jason

OK in that case I would suggest setting the Form Controller to none and using a Tab Panel to build your own controller.

Your TabPanel controller can be set on/off in a method using Formname.elements.TabPanelName.visible = true/false - or use the sample code to alternate the current state.

Regards

Graham Greensall
Worxinfo Ltd

I thought of that, but I guess that I was just hoping that there would be a property for it that can be coded. After seeing it written in the manual, I thought it might exist.

Thanks for your suggestions.

Jason

It’s impossible to code this via a method.

BUT, I find that using tabless tabpanels is a much more flexible solution - since you can script everything about them. You can even move the location to the top, left, right or bottom of the screen at runtime.

You can also have different nav forms in the tabpanel, and then programatically change the “tabIndex()” to change the nav stuff dynamically.