Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Save frame status
#1
(Sorry for possible duplicate post. I can't find the original one in forum... Sad )
Hello,

I use an application model like the "AsyncRenderFrame" demo.
Only one frame is active, the previous is detroyed.

Where do I save the previous frame state if I need to reopen it?
I mean: checkboxes, radios, edits, dataset cursors, etc.

Now I use the "session.clipboard" system as a memory kv store for this purpose, but I am not sure if it is a good choice.

Thanks,
Eddy
Reply
#2
(04-11-2022, 11:53 AM)sonjli Wrote: (Sorry for possible duplicate post. I can't find the original one in forum... Sad )

That is because it hadn't been approved from the moderation queue yet. I have just now done so, so you should be able to see it now.

Reply
#3
If you need to preserve the status of the frame, just don't destroy it. You can hide it using the visible property as you do with any control. When you need it again, just make it visible again.

Have in mind that RenderInvisibleControls of TIWForm may also affect the way you make them visible/invisible. If RenderInvisibleControls is disabled you will need a full post back (not an Async event) to make it visible again (I'm supposing that you have 2 frames in the same form).

You can also just have one on top of the other if they have the same size.
Reply
#4
(04-12-2022, 03:17 AM)Alexandre Machado Wrote: If you need to preserve the status of the frame, just don't destroy it. You can hide it using the visible property as you do with any control. When you need it again, just make it visible again.

Have in mind that RenderInvisibleControls of TIWForm may also affect the way you make them visible/invisible. If RenderInvisibleControls is disabled you will need a full post back (not an Async event) to make it visible again (I'm supposing that you have 2 frames in the same form).

You can also just have one on top of the other if they have the same size.

I understand.
I have a lot of frames to load and dozens of users using the webapp.
I am not sure that never destroying the frames is a good choice for memory usage.
Any advice about this?
I am going to build a frame stack for every route in application and save this stack in session. Is this a good solution or not?
Example:

Route 1:
Main Form -> (Initialize the stack) open Frame 1 (if exists in stack: visible true, else create, add to stack) -> open Frame 2 (if exists in stack: visible true, else create, add to stack) -> Open Frame 3 (if exists in stack: visible true, else create, add to stack)

Back-route 1:
Close Frame3 (visible false) -> Show Frame 2 from stack -> Close Frame 2 (Visible false) -> Show Frame 1 from stack-> Close Frame 1 (Free the entire stack)

And so on, for every route starting from main form.

Thanks,
Eddy
Reply
#5
Mmmmm....
I made some experiments but the stack idea is not very good.

Solution 2:
I have a iwregion that contains frames.

I have 2 frame types:
- Main: It stays only on top of iwregion
- Child: It stays on top of a "Main" or another "Child"

When I open a "Main" then I clear the iwregion from any other contained frame (free).
When I open a "Child" then I left the iwregion with all its frames, one on top of the other.
When I close a "Child", I destroy it, so I can see the frame under.
When I close a "Main", I destroy it. Now I see a clean iwregion without frames.

This seems to me a bit better solution, isn't it? What do you think?

Thanks,
Eddy
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)