PDA

View Full Version : Ext.Msg.notify



threewonders
Mar 10, 2011, 4:05 PM
I have a combobox that I have added a notification. How I can display the contents of the combobox in the notification?



<ext:ComboBox ID="camp"
runat="server"
Editable="false"
FieldLabel="Campaņa"
StoreID="dsCampas"
DisplayField="Name"
ValueField="CampaignID"
ForceSelection="true"
TypeAhead="true"
TriggerAction="All"
Mode="Remote"
AllowBlank="false"
PageSize="10"
SelectOnFocus="false"
AnchorHorizontal="100%"
DataIndex="Name"
>
<Listeners>
<BeforeSelect Handler="#{Button2}.setDisabled(false);Ext.Msg.notify('Butt on Click', camp.ValueField );" />
</Listeners>
</ext:ComboBox>


I've tried #{camp}.getvalue(), camp.value, camp.displayvalue .... and I did not succeed.
If for example I use camp.mode I get me out remote

Thanks and sorry for my bad English

geoffrey.mcgill
Mar 10, 2011, 4:43 PM
Hi,

I believe it would be #{camp}.getValue(). Please note the use of the uppercase 'V' in Value.

Example


#{camp}.getValue()

geoffrey.mcgill
Mar 10, 2011, 4:44 PM
More information available in the client-side docs, see

http://dev.sencha.com/deploy/dev/docs/?class=Ext.form.Field&member=getValue

threewonders
Mar 10, 2011, 5:12 PM
I've tried #{camp}.getValue() and I did not succeed.

geoffrey.mcgill
Mar 10, 2011, 6:00 PM
I tested a simplified version of your code and it does appear to work correctly when calling .getValue().

Example


<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!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>Ext.NET Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:ComboBox
ID="ComboBox1"
runat="server"
FieldLabel="Country">
<Items>
<ext:ListItem Text="Austria" />
<ext:ListItem Text="Bulgaria" />
<ext:ListItem Text="Canada" />
</Items>
<Listeners>
<Select Handler="Ext.Msg.notify('Value', #{ComboBox1}.getValue());" />
</Listeners>
</ext:ComboBox>
</form>
</body>
</html>


In the code you posted, you have configured the <BeforeSelect> event, which will fire before the item has been selected. This will give the affect of appearing to return the last item, not the current item.

I've changed to the <Select> event in my code.

Hope this helps.