RichWidget Container Expand & Collapse

RichWidget Container Expand & Collapse

  

Hi everyone,


I'm using Container_ExpandCollapse' RichWidget but i need that the containner begin collapsed and not expanded.

But by default the container begin expanded and it only collapses when i click on the widget.

Anyone can help me to face this issue?

Thanks in advance,

Pedro Gonçalves

Hi Pedro,

Have you tried to set the Display property of the associated container to False?



Cheers,
Tiago Simões
Hi Tiago,


It works!

Thank you very much, i had no idea!


Pedro Gonçalves
While this works, if your page is a 'submit' page (in fact my editrecord container is the one I am minimizing) the full page refreshes and the container reverts back to it's hidden state.

What would be the easiest way to persist the state even after a 'submit' action?

Cheers,
Hans
Hi Hans,

My first guess would be to have an optional "IsVisible" boolean input parameter, which is False by default, and when you submit mark it as true. Use that parameter's value to regulate whether you display the container or not.

Does this do the trick?

Regards,

Paulo Tavares
I was on the same train of thought. But as usual overthought it again.

You are of course right. What I was worried about (incorrectly) was that it would interfere with the expand/collapse widget. It doesn't, it picks up on all of this out of the box.

It's amazing how many 'bad habbits' I have had to set aside when switching between Visual Studio and Agile Platform. A change like this would have probably kept me busy for an hour or so. Now it's reduced to a mere minute if you don't overthink it :)

Cheers, and thanks.
Hans
Well, to be fair, the only reason I wasn't able to overthink it was because I didn't have the context of your specific scenario :)

Still, I'm glad it all worked well.

Keep up the good work.

Paulo Tavares
Hmm, actually it only partly resolves it, since the expand/collapse widget does not alter the local boolean variable (and I can't seem to find anything to hook into to do it 'manually') the boolean never goes back to false if you use the widget and a refresh of the page is done (by a second submit button for instance).

Am I over thinking it again and missing an obvious solution ?

Cheers,
Hans
Well, that's the problem with me hoping that a "first guess" will solve the problem. :)

You're right: the widget does not change that variable's value. What if you don't refresh the container on submit, but only what you need to refresh, using Ajax? Would that result in the expected behavior?

Regards,

Paulo Tavares
Yep, sure would. And I can animate the change as part of the refresh :) there's a bonus.

Like I said, I need to stop overthinking it.

Cheers,
Hans