WebComboBox: In read-only mode, ensure that no item is selected if the 'Index' property is negative.

[GB.WEB.GUI]
* BUG: WebComboBox: In read-only mode, ensure that no item is selected if the 'Index' property is negative.
This commit is contained in:
Benoît Minisini 2023-03-19 22:56:21 +01:00
parent f0fc89f5fa
commit 7653d34760
4 changed files with 24 additions and 9 deletions

View file

@ -1,6 +1,6 @@
# Gambas Project File 3.0
Title=Web application development using processes as session
Startup=Webform1
Startup=Webform3
Icon=.hidden/webform.png
Version=3.18.90
VersionFile=1

View file

@ -50,3 +50,9 @@ Public Sub WebListBox1_KeyPress()
WebTextBox1_KeyPress
End
Public Sub WebButton1_Click()
WebComboBox1.Index = -1
End

View file

@ -6,26 +6,33 @@
Arrangement = Arrange.Vertical
Margin = True
Spacing = True
{ WebComboBox1 WebComboBox
#MoveScaled(1,1,62,4)
ReadOnly = False
List = [("Élément 1"), ("Élément 2"), ("Élément 3"), ("Élément 4"), ("Élément 5"), ("Élément 6")]
{ WebContainer1 WebHBox
#MoveScaled(1,1,62,6)
Spacing = True
{ WebComboBox1 WebComboBox
#MoveScaled(1,1,22,4)
List = [("Élément 1"), ("Élément 2"), ("Élément 3"), ("Élément 4"), ("Élément 5"), ("Élément 6")]
}
{ WebButton1 WebButton
#MoveScaled(24,1,15,4)
Text = ("Reset")
}
}
{ WebComboBox2 WebComboBox
#MoveScaled(1,6,62,4)
#MoveScaled(1,8,62,4)
ReadOnly = False
List = [("Élément 1"), ("Élément 2"), ("Élément 3"), ("Élément 4"), ("Élément 5"), ("Élément 6")]
}
{ WebListBox1 WebListBox
#MoveScaled(1,11,62,28)
#MoveScaled(1,13,62,28)
Height = "10em"
List = [("Élément 1"), ("Élément 2"), ("Élément 3"), ("Élément 4"), ("Élément 5"), ("Élément 6"), ("Élément 7"), ("Élément 8"), ("Élément 9"), ("Élément 10"), ("Élément 11"), ("Élément 12")]
}
{ WebTextBox1 WebTextBox
#MoveScaled(1,40,62,4)
#MoveScaled(1,42,62,4)
}
{ WebTextArea1 WebTextArea
#MoveScaled(1,45,62,16)
#MoveScaled(1,47,62,16)
Expand = True
ReadOnly = True
}

View file

@ -94,6 +94,8 @@ Public Sub _Render()
If Not $bReadOnly Then
Print "</div>";
WebForm._AddJavascript("gw.combobox.resize(" & JS(Me.Name) & ");")
Else
If $iIndex < 0 Then WebForm._AddJavascript("gw.combobox.update(" & JS(Me.Name) & ",-1);")
Endif
Print