I have a strange problem.
My application has a Popup Menu with dates (LongDate format) and the RowTag is filled with the dates in SQLDate format.
In the SelectionChanged event, I use ListIndex to fill a field with the selected date.
// Fill globalShowdate with selected date
App.globalShowdate = pmDate.RowTag (pmDate.ListIndex)
When I run the program in debug mode, ListIndex is working as supposed, 0 for the 1st select date, 1 for the 2nd selected date, …
It turns out that when the same program is run on the Windows server, when I select a date ListIndex is always -1.
Am I doing something wrong or is this a bug?
It’s getting more and more weird.
On the Windows Server, every (text)field I enter data is empty after losing the focus.
The screen shows the text entered, but the field itself is empty.
When running in debug mode, there are no problems.
I made a small test-application
A webpage with a textfield, a label displaying the text of the textfield and a message box showing the text of the textfield
On the (customers) Windows server no text is shown in the label and the message box.
In debug mode text is shown in the label and in the message box.
Than I tried it on the my website’s Linux server, text is shown in the label and in the message box.
I also tried older releases of Xojo (2015r1) but the result is still the same.
For now I have no clue why this isn’t working on the Windows server.
Joking aside, if the Windows server meets the system requirements you should try to recreate the problem in a test project. If you can reproduce the problem, create a bug report.
Thank you Tim.
The screen prints are from a test project.
Next step for me is to contact the customer’s provider to find out the exact version of the Windows server.
Now I’m not able to deliver the software to the customer.
The reservation system for the upcoming performances doesn’t work and my customer is not happy at all.
That makes two, because I’m not happy at all too!
[quote]every (text)field I enter data is empty after losing the focus.
The screen shows the text entered, but the field itself is empty.[/quote]
This may be way off but…
Do you have Implicit Instantiation turned on in the project?
There is a small chance that what you are seeing is data entered on one copy of a window, while you are interrogating the automatically created default copy.
If you create a window like this:
dim w as new Window1
w.show
then you need to refer to that window as w in future
If any of your code ALSO refers to Window1, then you have two windows on the go
Window1 will be full of empty text boxes and listboxes with listindex = -1 etc, while w contains the actual data.
I only have 1 window and that window is set as DefaultWepPage in App.
In my test program I fill a label with the entered text in the TextChanged event of the Text Field.
lbltestfield.Text = testfield.Text
This works fine in Debug run mode and also on the Linux server where my website is hosted.
On the Windows server where the website of my customer is hosted, the text is shown on the screen, but the field itself is really empty during/after entering text.
p.s.
Changed the title of this thread because it is more than just a problem with ListIndex.
Then you get in Hashtag the name of the TextField, followed by a semicolon, then the content of Text. Use a split on “;” and cycle through the WebPage controls to set each text property.
Instead of Hashtag you can use a WebSDK control Xojo.TriggerServerEvent, but that is beyond the scope of a single post.
[quote=245282:@Antonio Rinaldi]The app is CGI or exe?
[/quote]
It’s CGI.
I’ve tried exe, but that didn’t run at all.
[quote=245282:@Antonio Rinaldi]Have you tried any different action?
Like a push button that set the labelText?
[/quote]
It’s not about filling the labeltext, it’s about entering data in a text field that, when moving to another field, is always empty.
There are a lot of (editable) fields on the official webpage.
The white background is information about the upcoming performance.
The grey background contains editable textfields and popupmenu’s for the reservation.
@Michel Bujardet,
The program works fine in debug mode, under OS X, Windows 10 and on a Linux server (where my website is hosted).
As soon as I put the program on the Windows server, where the website of my customer is hosted, the fields (popupmenu’s, text field, text areas) are always empty after selection/entering data.
To me that indicates that the problem has nothing to do with my code.
It’s the combination of Xojo and Windows server that creates this weird behavior.
BTW : Have you tried changing the super to TextArea ? With some luck, the bug won’t manifest.
Otherwise, here is another idea that I just tested, although I could not reproduce the bug that seems to be specific to the particular version of Windows server.
Apparently, the wipe happens upon LostFocus. So up until then, Text behaves normally.
I tried creating a myTextField subclass, with
Sub TextChanged()
if me.text <> "" then
myText = me.text
end if
RaiseEvent TextChanged
End Sub
I added an event definition TextChanged so the instances keep that event.
myText is a string property of myTextField
Sub LostFocus()
me.text = mytext
RaiseEvent LostFocus
End Sub
The way it works is by setting aside the content of Text while it exists in myText, and reinstate it in LostFocus as it had disappeared.
Not being able to reproduce the issue, I do not know the exact moment at which the Text property is wiped. If it is after LostFocus took place, you could maintain a flag like hasFocus set in GotFocus and LostFocus, and do
if hasfocus then
Changing the super for TextField from WebTextField to myTextField should alleviate the issue. You can easily do that with search replace for all the TextFields at once.