[CLOSED] Can't figure out how to get value from combobox

  1. #1

    [CLOSED] Can't figure out how to get value from combobox

    Hi,

    I am stucked with this combobox :
         
        <ext:ComboBox runat="server" ID="CB_AgentPlan" StoreID="Store_AgentPlan" DisplayField="agent" ValueField="cp" width="250px" />
    
        <ext:Store ID="Store_AgentPlan" runat="server">
            <Model>
                <ext:Model runat="server">
                    <Fields>
                        <ext:ModelField Name="agent" Type="String" />
                        <ext:ModelField Name="cp" Type="String" />
                    </Fields>
                </ext:Model>
            </Model>
        </ext:Store>
    I set a DirectEvent on a button but when I call CB_AgentPlan.SelectedItem.Value or Text from code-behind I only get a null. The Count property is equals to zero but from other posts I understand it's normal when you use stores. I tried to pass a parameter (below) but it's not doing much.

    <ext:Button ID="Button1" runat="server" Text="Dispatcher la prestation" Icon="Accept">
    <DirectEvents>
     <Click OnEvent="SendAgent">
    <ExtraParams>
    <ext:Parameter Name="AgentPlan" Value="#{CB_AgentPlan}.getValue();" />
    </ExtraParams>
     </Click>
    </DirectEvents>
     </ext:Button>
    Cheers :)
    Last edited by Daniil; Jun 13, 2013 at 2:30 PM. Reason: [CLOSED]
  2. #2
    Hi @Fractal,

    If you want to use ComboBox.SelectedItem, that ComboBox should be inside:
    <form runat="server">
    Is it?

    Also could you clarify what is wrong this that?
    <ext:Parameter Name="AgentPlan" Value="#{CB_AgentPlan}.getValue();" />
    I just do not understand well this:
    I tried to pass a parameter (below) but it's not doing much.
  3. #3
    If you want to use ComboBox.SelectedItem, that ComboBox should be inside:
    <form runat="server">
    Is it?
    It was simply that thank you Danil :)

Similar Threads

  1. Replies: 5
    Last Post: Mar 15, 2013, 4:24 AM
  2. Replies: 4
    Last Post: Nov 30, 2011, 5:25 AM
  3. Replies: 4
    Last Post: Sep 28, 2011, 8:57 AM
  4. Replies: 1
    Last Post: Apr 17, 2011, 1:21 PM
  5. Replies: 2
    Last Post: Apr 21, 2009, 10:37 AM

Posting Permissions