When multiple WLineEdit and WPushButton widgets are attached to a WTemplate, the setFocus property of the WLineEdit widgets does not seem to work. The last WLineEdit widget, as defined in the layout.xml file, gets the focus. This used to work correctly with Wt 3.3.8.
Updated by Bert Cuypers over 4 years ago
- File ChangePasswordWidget.cpp ChangePasswordWidget.cpp added
- File ChangePasswordWidget.h ChangePasswordWidget.h added
- File Layout.xml Layout.xml added
Hi Roel, here you go. I call this widget for example from a (bootstrap) navbar on the right-hand side in a pop-up menu.
Updated by Roel Standaert over 4 years ago
This is the case in general it seems. When autofocus is enabled, it will focus on the first child. However, when using a
children() will return the widgets in it in order of their key. Because
"confirmPassword" < "currentPassword",
confirmPassword will be focused on instead. This wasn't the case in Wt 3, because in Wt 3 the widgets were returned in the order that they were bound. I'll see if something can be done about that, but with a
WTemplate, it's not as simple to determine what is the real first widget.