Combobox value with ExtraParams

  1. #1

    Combobox value with ExtraParams

    Hi

    I'm looking for some ideas how to do this. I have som rows of data ( listed in a table ), and for each row i have a combobox with a list of emails. For each row there also is a button that does something with the selected email.

    My problem is that my current code only gets the email selected from the beginning and not the one the user might have chosen since.

    ForEach Item In List
     
    Dim Email AsNew Coolite.Ext.Web.ComboBox
     
    ' Adds an emailaddress
    Dim Email1 AsNew ListItem
    Email1.Text = "1@example.com"
    Email1.Value = "1@example.com"
    Email.Items.Add(Email1)
     
    ' Adds another emailaddress
    Dim Email2 AsNew ListItem
    Email2.Text = "2@example.com"
    Email2.Value = "2@example.com"
    Email.Items.Add(Email2)
     
    ' Selects the first address
    Email.SelectedItem.Value = "1@example.com"
     
    Dim MyButton AsNew Coolite.Ext.Web.Button
    MyButton.AjaxEvents.Click.ExtraParams.Add(New Parameter("Email", Email.SelectedItem.Value.ToString(), ParameterMode.Value))
    ' MyButton.AjaxEvents.Click.Type = AjaxEventType.Load
    AddHandler MyButton.AjaxEvents.Click.Event, AddressOf DoSomething
    Next
    It's a stripped down example with the emailaddresses added for this example only.

    How do I get the correct selected value ?

    / Ulrik
  2. #2
    The code looks weird. Here it is again :

    ForEach Item In List
    Dim Email AsNew Coolite.Ext.Web.ComboBox
    ' Adds an emailaddress
    Dim Email1 AsNew ListItem
    Email1.Text = "1@example.com"
    Email1.Value = "1@example.com"
    Email.Items.Add(Email1)
    ' Adds another emailaddress
    Dim Email2 AsNew ListItem
    Email2.Text = "2@example.com"
    Email2.Value = "2@example.com"
    Email.Items.Add(Email2)
    ' Selects the first address
    Email.SelectedItem.Value = "1@example.com"
    Dim MyButton AsNew Coolite.Ext.Web.Button
    MyButton.AjaxEvents.Click.ExtraParams.Add(New Parameter("Email", Email.SelectedItem.Value.ToString(), ParameterMode.Value))
    MyButton.AjaxEvents.Click.Type = AjaxEventType.Load
    AddHandler MyButton.AjaxEvents.Click.Event, AddressOf DoSomething
    Next

Similar Threads

  1. Code behind ExtraParams
    By zeus in forum 1.x Help
    Replies: 2
    Last Post: Dec 20, 2011, 8:08 AM
  2. Replies: 6
    Last Post: Aug 01, 2011, 4:53 PM
  3. AjaxFormResult && ExtraParams
    By threewonders in forum 1.x Help
    Replies: 1
    Last Post: Jun 28, 2011, 7:30 AM
  4. more than one extraparams from a gridpanel
    By unaltro2 in forum 1.x Help
    Replies: 1
    Last Post: Jun 07, 2011, 4:35 PM
  5. How to use ExtraParams ?
    By iscript in forum 1.x Help
    Replies: 1
    Last Post: Aug 21, 2009, 7:09 AM

Posting Permissions