I have a generic web container that holds a webgrid and some other controls. I start the webcontainer with a minimum size and would like to resize it during runtime when the webgrid it contains is populated. The webgrid will resize fine, but I cannot figure out how to get the container to resize. Instead I get scroll bars which in this case are not really desirable.
The only way I saw that the container will pay attention to a new size is in a shown event. Is that true? If so how do I call the page, to then re-raise the containers shown even? If anyone has a recommendation I would sure appreciate it!
You might have to create a timer that gets started in the shown event to then size your web containers appropriately. We’ve had a bunch of dynamically created sizing issues so you’re not alone.
In one project we gave up and put all of the containers on the webpage (so they were static and invisible) and then resized them and switched visibility on the fly. There is something inherently flawed with Xojo webpages returning incorrect dimensions.
It’s been a few releases since this project but we literally could never resize our dynamic web containers properly because we never got the right size. If memory serves the width wasn’t too bad but the height was never right.
There is another thing, is that there is often a discrepancy between dimensions set in Xojo, and the actual size of the control in the DOM. Never huge, but there.
Hi Guys and thanks for the responses.
I will try doing some of the things your mentioned. The only thing with the timer is then the objects will flash, at least once. But maybe there is something that can be done with that too.
I agree with the page size problem. I saw you both write about it in this thread
I tried switching to a palette instead but it doesn’t solve my issue. Containers get the right size but the controls inside it that are locked at the bottom still don’t resize and keep their original size.
It is a one year old project that used to show fine. I don’t remember having issues with that.
Thanks Michel, the palette plus some new code lines finally made it work.
I would like to leave a comment about all the energy it required me to get it right. My comment is not targeting anyone personally. I also want to thank everyone here sharing their solutions and thoughts. That is just fantastic and very different from many other working environments I’ve been working in. We also love to work with Xojo, it has been a relief when we started with this platform 3 years ago.
Such a basic functionality (I refer to control position and resizing for exemple) should be available and working out of the box. I’ve spent to much time figuring a way to make it work. It is totally counterproductive and frustrating…
Even if we buy the Pro Licence, we never make the desktop projects. People want Web Apps, they want their applications to be accessible from anywhere, for multiple users, in couple of different languages and most of them don’t want to bother with server maintenance, licensing… So I wish there would be more improvement on the tools we have to develop Web applications since I think it deserves more care and attention.
Thanks Mr Bikini for your feedback. As I said, I had no intention of being unpleasant, just stressing out that Web Development is very popular (am I wrong?) and being efficient is of great importance.
As a very small business owner, these little things can become very frustrating. We often use “personal time” or time that should be dedicated to other business tasks (business development is one of them) when things go wrong. At the end it not good for me neither for Xojo team.
Nevertheless, I appreciate a lot Xojo as a platform and as a community as well. Hopefully we’ll be able to improve the web framework in the near future!