Xojo2024R1: combo box insisting on helping with password

Anthony;
This is almost too good to be true, very easy and it works. Thank you. I placed this code into Shown event behind the WebRectangle that has the combo box.

me.Style.BorderThickness = 0

This now makes the container WebRectangle invisible in the browser and prevents browser from misguided “password prompt”.

Happy to help! Don’t forget to mark a solution so it’s easier for others to find in the future.

I prefer using Opening when possible, as Shown code may produce flicker (display the border for a fraction of a second in some situations).

1 Like

It will also send additional data from the server to the client each time the control is shown, which isn’t optimal for production.

This post should be marked as the solution so that it shows at the top of the thread.

Well, nothing is ever easy. The WebRectangle that I have placed on the page now is overlaying entry fields and drop down list boxes (it must be tall enough to expose the combo box placed inside). It looks like now I need to control the height of the WebRectangle too.

Is the login view a separate WebPage from whatever this view is?

Yes, the login web page is a separate class. I have just done few more tweaks. It seems now to be working. I have only left the label inside the WebRectangle and moved the combo box out of WebRectangle, this way only the WebRectangle is now small and does not overlap the entry fields below the combo box.


Note: combo box shows now without key symbol

I guess is limiting the overflow, right? I remember a bug that we can’t change the overflow setting in Opening or Shown events.

You may use JavaScript or a timer.calllater to change the overflow: hidden to overflow: visible

Rectangle1.Style.Value("overflow") = "visible"

Alberto, the fix I found working was to keep only the label in the WebRectangle. I don’t understand why that has such an effect but who cares, as long as it works I take it. Maybe one day I will become a little more sophisticated and will actually understand these intricacies, but for now I am happy camper.

I would think closing the login web page would close the DOM objects and that Safari shouldn’t get confused.

I would suggest leaving this post marked as the answer because it will be more helpful to someone stumbling upon this thread in the future. The post you’ve changed it to is specific to your project.

1 Like

Tim;
I have checked the web app I am working on, I found no reference to the LoginPage.Close (or Self.Close inside LoginPage). Currently when web app time outs the LoginPage will show. Are you suggesting I should add explicit LoginPage.Close somewhere after successful login?

Yes, I think that might help, but can’t confirm at this time (I haven’t set up a project to reproduce the original error).

You will have to turn Implicit Instance off and instantiate the page, but if it works it might be easier than all of this control nesting.

// To log in
var oLogin as new LoginPage
oLogin.Show
// Successful login would close the page after opening the next page
var oDashboard as new DashboardPage
oDashboard.Show

self.Close
1 Like

OK, I can try that. The web app I am working on has many web pages with implicit instance turned on including LoginPage. I just need to understand how to bring the LoginPage back when web app times out. Thanks for your suggestion.

My first blob should work in whatever event you’re using to show the login page when the timeout occurs.

1 Like

It’s good practice to close a WebPage when you’re done using it to free up memory in the user’s browser. Closing a login page should also be done for security reasons. If you don’t explicitly close a WebPage, then it hangs around inside the browser’s DOM for the life of the session.

Well, it may or may not be, I can’t argue with the orig. developer of the web app, I am only working with the legacy code converting to the latest and greatest. I don’t really know what the implication will be if I do LoginPage.Close, will the page automatically open upon the timeout or will I have to open it explicitly?

Nothing ever is easy in life nor in programming. Thanks as usual.

As I mentioned, you will need to create a new instance in whatever event handles the timeout. Since we know nothing about the project, that’s as specific as I can be.

Thank you, that is what crossed my mind as well.