I mostly use B4A, but I need to update an old non-B4Xpages B4i app to add a new screen (the client won't pay to convert it).
Basically, when this new page of the clients app loads, I need to hide some of the views in the layout and possibly reposition other views. Then after everything is in place, I will resize the hosting panel to fit just the views that are visible. And since there is the possibility that I might end up with more views than can fit on the screen, I am using a scrollview.
In the attached example app, there are seven buttons stacked on top of each other on a panel, but the panel they are on I purposefully made not tall enough to fit all seven buttons so it will simulate the situation in which I need to resize the panel at runtime to properly display the views that were determined to be visible when the page loads.
So, I though it would be a simple matter of resizing the panel that the buttons are on when the page is loaded/resized, so all seven buttons can be seen.
But I am getting crazy results:
1) Upon running the app, you will get the below screenshot with buttons 6 and 7 not visible and only 3/4 of button5 visible - it seems my attempt to adjust the height of the hosting panel (panel1) to be tall enough to display button7 is not working for some reason.
2) When I run the app, the Page1_Resize event reports a particular screen height (which is the same as 100%y), but if I then wait a second or two and then click button 1 to manually force a rerun the resizing code, the 100%y value is now different (smaller) - indicating that the screen size seem to have changed after the initial Page1_Resize event, without the Page1_Resize event triggering again.
3) Only after clicking the Button1 THREE times, will the page then appear as desired - with all seven buttons being visible (need to scroll up to see button 7).
I must be missing something obvious, so if anyone has a hint of what is going on, your insight would be greatly appreciated
Basically, when this new page of the clients app loads, I need to hide some of the views in the layout and possibly reposition other views. Then after everything is in place, I will resize the hosting panel to fit just the views that are visible. And since there is the possibility that I might end up with more views than can fit on the screen, I am using a scrollview.
In the attached example app, there are seven buttons stacked on top of each other on a panel, but the panel they are on I purposefully made not tall enough to fit all seven buttons so it will simulate the situation in which I need to resize the panel at runtime to properly display the views that were determined to be visible when the page loads.
So, I though it would be a simple matter of resizing the panel that the buttons are on when the page is loaded/resized, so all seven buttons can be seen.
But I am getting crazy results:
1) Upon running the app, you will get the below screenshot with buttons 6 and 7 not visible and only 3/4 of button5 visible - it seems my attempt to adjust the height of the hosting panel (panel1) to be tall enough to display button7 is not working for some reason.
2) When I run the app, the Page1_Resize event reports a particular screen height (which is the same as 100%y), but if I then wait a second or two and then click button 1 to manually force a rerun the resizing code, the 100%y value is now different (smaller) - indicating that the screen size seem to have changed after the initial Page1_Resize event, without the Page1_Resize event triggering again.
3) Only after clicking the Button1 THREE times, will the page then appear as desired - with all seven buttons being visible (need to scroll up to see button 7).
I must be missing something obvious, so if anyone has a hint of what is going on, your insight would be greatly appreciated
Attachments
Last edited: