PDA

View Full Version : [CLOSED] TriggerField Text property is empty



supera
Feb 08, 2012, 4:25 PM
Hi!

TriggerField.Text property is empty in DirectEvents TriggerClick

I made a little example:

1 - Run example!
2 - Click in 'Find' button
3 - Fill the triggerfield 'Find what?'
4 - click in 'search' trigger button in trigger field!
5 - The text you typed in did not return the txtSearchValue.text property



<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Test2.aspx.vb" Inherits="WebApplication3.Test2" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">

''ESTES COMANDOS SÃO PERTENCENTES AO GRID E AO STORE, E ESTÃO AQUI PARA ATUALIZAR O MESMO COM A NOVA ESTRUTURA
Protected Sub Page_Load(sender As Object, E As EventArgs) Handles Me.Load
If (Not ExtNet.IsAjaxRequest) Then

End If
End Sub

Protected Sub txtSearchValue_Click(sender As Object, e As DirectEventArgs)
Dim mb As Ext.Net.MessageBox = New Ext.Net.MessageBox
mb.Alert("txtSearchValue.Text", "txtSearchValue.text value is: " & txtSearchValue.Text)
mb.Show()
End Sub

</script>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<ext:ResourceManager ID="resManagerSGCO" runat="server" Namespace="SuperaWeb.SGCO" />
<form id="form1" runat="server">
<ext:Panel runat="server" ID="panelExplorerWebTab" Layout="FitLayout" Flex="1">
<TopBar>
<ext:Toolbar ID="tbWebExplorer" runat="server">
<Items>
<ext:Button ID="btnFind" runat="server" Icon="Find" Text="Find" ToolTip="Find records" >
<Menu>
<ext:Menu ID="Menu1" runat="server">
<Items>
<ext:ComboBox ID="cmbSearchField" runat="server" FieldLabel="Find in" LabelWidth="80" Width="265">
<Items>
<ext:ListItem Text="ID" Value="ID" />
<ext:ListItem Text="Name" Value="Name" />
</Items>
<SelectedItems>
<ext:ListItem Text="ID" />
</SelectedItems>
</ext:ComboBox>
<ext:ComboBox ID="cmbSearchMatch" runat="server" FieldLabel="Math" LabelWidth="80" Width="265">
<Items>
<ext:ListItem Text="Any" Value="Any" />
<ext:ListItem Text="Start" Value="Start" />
<ext:ListItem Text="Equal" Value="Equal" />
</Items>
<SelectedItems>
<ext:ListItem Text="Any" />
</SelectedItems>
</ext:ComboBox>
<ext:TriggerField ID="txtSearchValue" runat="server" FieldLabel="Find what?" LabelWidth="80" Width="265" EmptyText="text/value to search" >
<Triggers>
<ext:FieldTrigger Icon="Search" />
</Triggers>
<DirectEvents>
<TriggerClick OnEvent="txtSearchValue_Click" />
</DirectEvents>
</ext:TriggerField>
</Items>
</ext:Menu>
</Menu>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<Items>
</Items>
</ext:Panel>
</form>
</body>
</html>

Vladimir
Feb 08, 2012, 5:32 PM
Please set RenderToForm="true" for Menu, please ensure that form height is enough to show the menu (for example, set height="200" for top panel)

supera
Feb 08, 2012, 5:42 PM
Hi Vladmir...

Thanks for your reply!

I´m following the steps, but not working yet! I forgot something?

Follow the code with your suggestions.



<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Test2.aspx.vb" Inherits="WebApplication3.Test2" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">

''ESTES COMANDOS SÃO PERTENCENTES AO GRID E AO STORE, E ESTÃO AQUI PARA ATUALIZAR O MESMO COM A NOVA ESTRUTURA
Protected Sub Page_Load(sender As Object, E As EventArgs) Handles Me.Load
If (Not ExtNet.IsAjaxRequest) Then

End If
End Sub

Protected Sub txtSearchValue_Click(sender As Object, e As DirectEventArgs)
Dim mb As Ext.Net.MessageBox = New Ext.Net.MessageBox
mb.Alert("txtSearchValue.Text", "txtSearchValue.text value is: " & txtSearchValue.Text)
mb.Show()
End Sub

</script>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<ext:ResourceManager ID="resManagerSGCO" runat="server" Namespace="SuperaWeb.SGCO" />
<form id="form1" runat="server">
<ext:Panel runat="server" ID="panelExplorerWebTab" Layout="FitLayout" Height="300">
<TopBar>
<ext:Toolbar ID="tbWebExplorer" runat="server" >
<Items>
<ext:Button ID="btnFind" runat="server" Icon="Find" Text="Find" ToolTip="Find records" >
<Menu>
<ext:Menu ID="Menu1" runat="server" RenderToForm="true">
<Items>
<ext:ComboBox ID="cmbSearchField" runat="server" FieldLabel="Find in" LabelWidth="80" Width="265">
<Items>
<ext:ListItem Text="ID" Value="ID" />
<ext:ListItem Text="Name" Value="Name" />
</Items>
<SelectedItems>
<ext:ListItem Text="ID" />
</SelectedItems>
</ext:ComboBox>
<ext:ComboBox ID="cmbSearchMatch" runat="server" FieldLabel="Math" LabelWidth="80" Width="265">
<Items>
<ext:ListItem Text="Any" Value="Any" />
<ext:ListItem Text="Start" Value="Start" />
<ext:ListItem Text="Equal" Value="Equal" />
</Items>
<SelectedItems>
<ext:ListItem Text="Any" />
</SelectedItems>
</ext:ComboBox>
<ext:TriggerField ID="txtSearchValue" runat="server" FieldLabel="Find what?" LabelWidth="80" Width="265" EmptyText="text/value to search" >
<Triggers>
<ext:FieldTrigger Icon="Search" />
</Triggers>
<DirectEvents>
<TriggerClick OnEvent="txtSearchValue_Click" />
</DirectEvents>
</ext:TriggerField>
</Items>
</ext:Menu>
</Menu>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<Items>
</Items>
</ext:Panel>
</form>
</body>
</html>

Vladimir
Feb 08, 2012, 6:14 PM
I guess you have to wait next public release, we made many changes therefore i cannot post simple fix
I tested your sample with last code and all works correctly

supera
Feb 08, 2012, 6:37 PM
Thanks for your reply Vladimir...

If I download the source again, I already have these changes?

Thanks for your help!

Daniil
Feb 09, 2012, 9:21 AM
Well, no.

It will be available with the next release which is imminent.

supera
Feb 09, 2012, 10:12 AM
Ok, thanks for your help ... I'm waiting for the next version then.