PDA

View Full Version : How to prevent section expand when user clicks on header



HankFay
2013-06-01, 18:26
Scenario: I am using the newly available activate() (thanks!) which happens when a section is being made the .activesection. I have the section set to collapsable = .F. The reason being that I want sections to be expandable only under certain conditions, which I am testing in the Activate delegate.

What happens: in runtime mode, the section expands when the header is clicked, regardless of what I've tried.
issue nodefault, but of course that only works in classes, and the lianja objects are base classes -- VFP did, fwiw, allow nodefault to prevent the current action in base classes
return .F. -- no reason this should have worked, but had to try
issue lianja.get("sectionname").collapse() -- I figured it was too early for it to work.
Question: is there a way to do this, or am in the land of ER?

thanks,

Hank

barrymavin
2013-06-01, 22:40
There is an attribute in the section attributes dialog. "Collapsible" -- just uncheck it and you can lay a page out as sections without having the sections expand/collapse when clicking on the header.

You can also check "Hide header" so that that the headers are only visible in development mode.

This lets you lay a page out visually using sections (and gadgets) when developing your UI but make the "development stuff" hidden in runtime mode.

311

312

HankFay
2013-06-01, 23:48
Oops: forgot to mention that I had unchecked Collapsable. Unchecking it does prevent a click from collapsing, but does not prevent a click from expanding. I can live with it expanding in this instance, but if I didn't have an alternative for 1 of the sections in particular, having it not able to be expanded would have prevented confusion.

thanks,

Hank

barrymavin
2013-06-01, 23:53
"collapsable" unchecked is designed to make a section always visible on the page so the section should be expanded before checking this then it cannot be collapsed. That is by design.

HankFay
2013-06-02, 20:50
"collapsable" unchecked is designed to make a section always visible on the page so the section should be expanded before checking this then it cannot be collapsed. That is by design.

The issue isn't whether it can be collapsed: that works as I would expect, which appears to be as-designed.

My question was how to prevent a section which is not expanded, from being expanded.

thanks,

Hank

barrymavin
2013-06-02, 21:10
Oh I see. Currently "Collapsible" is ignored in that scenario.