Button click handler using values through UDPClient

I am making a BCI system for my master thesis, and I am new to C#, so I would like to know if it is possible to click a button through a value obtained though a fx UDP client.
What I wloud like to do :
Acquirer data through MATALB -> send the data to the BCI interface made in Visual Studio WF Application -> the values clicks the button represtented by the specific value, and so forth.
It is the possibility I am seeking, I have not found any really usable online yet.
Question:
Is it possible to click a button using a value instead of mouseclick in Windows forms Application?
- Andrew have mentioned button.PerformClick()
Method, could this sovle the problem?
Thanks for answers.
Regards 
Aslak

Hej Andrew,
Thanks, I have just had trouble finding a example regarding this. I am allmost new to all in C#, so are there any webpages I could look at that you kow that could help ?
Regards 
Aslak
You're not likely to find a webpage with an example such as you've described, no.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace CS_WinFormsSnippet
public partial class Form1 : Form
public Form1()
InitializeComponent();
Button myButton = new Button();
private void Form1_Load(object sender, EventArgs e)
myButton.Text = @"It's Christmas at Ground Zero!";
myButton.Click += new EventHandler(myButton_Click);
myButton.Dock = DockStyle.Fill;
this.Controls.Add(myButton);
System.Threading.ThreadStart ts = new System.Threading.ThreadStart(this.myButton_TimedClicker);
System.Threading.Thread t = new System.Threading.Thread(ts);
t.IsBackground = true; // makes the thread die with the process.
t.Start();
void myButton_Click(object sender, EventArgs e)
if (e.GetType().Equals(typeof(ButtonClickEventArgsWithValue)))
MessageBox.Show(@"... and if the radiation level's okay, I'll go out with YOU to see all the neeeeew muuuutations on New Year's Day!");
else
MessageBox.Show(@"The Button has been preeeeessed...");
// "Christmas At Ground Zero" is a classic holiday tune by Weird Al Yankovic.
void myButton_TimedClicker()
do
System.Threading.Thread.Sleep(20000); // wait 20 seconds.
this.myButton_Click(null, new ButtonClickEventArgsWithValue(2));
} while (true); // just keep going until the form is closed. don't worry, it's a background thread.
// You can still click the button on the form to see the first messagebox without the second. The second messagebox only shows up when you call the click event programmatically, using the specified EventArgs inheritor.
public class ButtonClickEventArgsWithValue : EventArgs
public Int32 eventValue = 0;
public ButtonClickEventArgsWithValue(Int32 value)
this.eventValue = value;
Would you like to know more?

Similar Messages

  • How to move a selected row data from one grid to another grid using button click handler in flex4

    hi friends,
    i am doing flex4 mxml web application,
    i am struck in this concept please help some one.
    i am using two seperated forms and each form having one data grid.
    In first datagrid i am having 5 rows and one button(outside the data grid with lable MOVE). when i am click a row from the datagrid and click the MOVE button means that row should disable from the present datagrid and that row will go and visible in  the second datagrid.
    i dont want drag and drop method, i want this process only using button click handler.
    how to do this?
    any suggession or snippet code are welcome.
    Thanks,
    B.venkatesan.

    Hi,
    You can get an idea from foolowing code and also from the link which i am providing.
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
    width="613" height="502" viewSourceURL="../files/DataGridExampleCinco.mxml">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.binding.utils.BindingUtils;
    [Bindable]
    private var allGames:ArrayCollection;
    [Bindable]
    private var selectedGames:ArrayCollection;
    private function initDGAllGames():void
    allGames = new ArrayCollection();
    allGames.addItem({name: "World of Warcraft",
    creator: "Blizzard", publisher: "Blizzard"});
    allGames.addItem({name: "Halo",
    creator: "Bungie", publisher: "Microsoft"});
    allGames.addItem({name: "Gears of War",
    creator: "Epic", publisher: "Microsoft"});
    allGames.addItem({name: "City of Heroes",
    creator: "Cryptic Studios", publisher: "NCSoft"});
    allGames.addItem({name: "Doom",
    creator: "id Software", publisher: "id Software"});
    protected function button1_clickHandler(event:MouseEvent):void
    BindingUtils.bindProperty(dgSelectedGames,"dataProvider" ,dgAllGames ,"selectedItems");
    ]]>
    </mx:Script>
    <mx:Label x="11" y="67" text="All our data"/>
    <mx:Label x="10" y="353" text="Selected Data"/>
    <mx:Form x="144" y="10" height="277">
    <mx:DataGrid id="dgAllGames" width="417" height="173"
    creationComplete="{initDGAllGames()}" dataProvider="{allGames}" editable="false">
    <mx:columns>
    <mx:DataGridColumn headerText="Game Name" dataField="name" width="115"/>
    <mx:DataGridColumn headerText="Creator" dataField="creator"/>
    <mx:DataGridColumn headerText="Publisher" dataField="publisher"/>
    </mx:columns>
    </mx:DataGrid>
    <mx:FormItem label="Label">
    <mx:Button label="Move" click="button1_clickHandler(event)"/>
    </mx:FormItem>
    </mx:Form>
    <mx:Form x="120" y="333">
    <mx:DataGrid id="dgSelectedGames" width="417" height="110" >
    <mx:columns>
    <mx:DataGridColumn headerText="Game Name" dataField="name" width="115"/>
    <mx:DataGridColumn headerText="Creator" dataField="creator"/>
    <mx:DataGridColumn headerText="Publisher" dataField="publisher"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:Form>
    </mx:Application>
    Link:
    http://social.msdn.microsoft.com/Forums/en-US/winformsdatacontrols/thread/ae9bee8d-e2ac-43 c5-9b6d-c799d4abb2a3/
    Thanks and Regards,
    Vibhuti Gosavi | [email protected] | www.infocepts.com

  • Associate Button Clicked for a Value. Please help.

    How do I assoiate the 'Button Clicked' for a particular value.?
    I have a list displayed from a HashTable on a Layout
    The hashTable contains :
    ht.put("Monday Data ", new JButton("More Info"));
    ht.put("Tuesday Data ", new JButton("More Info"));
    ht.put("Wednesday Data", new JButton("More Info"));
    When I click the More Info for Monday Data,I shud see Monday Data and so on?
    How do I associate the 'More Info Button' to the 'Key'?
    Can anyone please advise?
    Here is my code
    public class JPanelDemo extends JFrame{
    private JPanel JButtonPanel;
    private Hashtable ht = new Hashtable();
    Enumeration enum;
    public JPanelDemo() {
    JButtonPanel = new JPanel();
    Container c = getContentPane();
    JButtonPanel.setLayout(new GridLayout(3,3));
    // Put Data into Table.
    ht.put("Monday Data ", new JButton("More Info"));
    ht.put("Tuesday Data ", new JButton("More Info"));
    ht.put("Wednesday Data ", new JButton("More Info"));
    // Instantiate ButtonHandler.
    ButtonHandler handler = new ButtonHandler();
    // Enumerate thru Keys.
    enum = ht.keys();
    while(enum.hasMoreElements()){
    String str = (String) enum.nextElement();
    JButtonPanel.add(new JLabel(str)); // Get the Key
    JButton jB = (JButton)ht.get(str); // Get the Value associated with the Key
    JButtonPanel.add(jB);
    jB.addActionListener(handler);
    c.add(JButtonPanel,BorderLayout.NORTH);
    show();
    public static void main(String[] args) {
    JPanelDemo JPanelDemo1 = new JPanelDemo();
    // Inner Class for BUTTON handling.
    private class ButtonHandler implements ActionListener {
    public void actionPerformed(ActionEvent e) {
    JOptionPane.showMessageDialog(null," You Pressed " + e.getActionCommand());
    //** Here,I need to view the KeyName and not the Button Name.
    } // End ButtonHandler.
    } // End of class

    Thank you thank you thank you!  Here is the revised script with the changes.  about to go plug it in and see if it works.
    // Custom Calculate script
    (function () {
        // Get the input field values
       var leasemonth = Number(this.getField("LeaseBegMonth").valueAsString);
       var leasestartday = Number(this.getField("LeaseBegDay").valueAsString);   
       var rentamount = Number(this.getField("MonthlyRent").valueAsString);
       var leasedays = 0
        // calculate how many days in the month
    if ( leasemonth==1)
           leasedays = 31;
    else if (leasemonth==2)
           leasedays = 28;
    else if ( leasemonth==3)
           leasedays = 31;
    else if (leasemonth==4)
           leasedays = 30;
    else if ( leasemonth==5)
           leasedays = 31;
    else if (leasemonth==6)
           leasedays = 30;
    else if ( leasemonth==7)
           leasedays = 31;
    else if (leasemonth==8)
           leasedays = 31;
    else if ( leasemonth==9)
           leasedays = 30;
    else if (leasemonth==10)
           leasedays = 31;
    else if ( leasemonth==11)
           leasedays = 30;
    else if (leasemonth==12)
           leasedays = 31;
        //CALCULATE HOW MANY DAYS REMAIN
        var daysremain = leasestartday-leasedays   
        //CALCULATE THE PRORATE AND DISPLAY IT
        event.value = (rentamount/leasedays)* daysremain

  • Button click handler: isn't invoked

    Hi i have a problem with my buttons but i cant see it,
    i am trying to close the bet screen when a button is
    pressed but it dosen't reach the if statement can
    anyone see the problem here is the code(i also have a class main that invokes class roulette):
    import java.util.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    public class BetScreen extends JFrame {
         private Container container;
         private FlowLayout layout;
         public  JButton oddButton;
           public  JButton evenButton;
           public  JButton redButton;
            public  JButton blackButton;
           public  JButton specifButton;
           public BetScreen()
             super("Bet Screen");
             layout = new FlowLayout();
             container = getContentPane();
             setLayout( layout );
             getContentPane().setBackground(Color.RED);
            layout.layoutContainer( container );
            oddButton = new JButton("Odd");
             add( oddButton );
             oddButton.addActionListener(
            new ActionListener()
          public void actionPerformed(ActionEvent event)
                System.out.println(event.getSource());
            System.out.println(oddButton);
              wager();
        }//end method actionPerformed
        }//end method actionListener
        );//end call to addActionListener
    }//end class.....................................................................................................................
    (This is in a different class)
    .....................................................................................................................import java.util.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    public class Roulette extends JFrame {
           private Container container;
           private JButton spinButton;
         private JButton quitButton;
           private FlowLayout layout;
           private JButton placeBetButton;
           public Roulette()
             super("Main Menu");
             layout = new FlowLayout();
             container = getContentPane();
            setLayout( layout );
             placeBetButton = new JButton("Place Bet");
             add( placeBetButton );
             placeBetButton.addActionListener(
        new ActionListener()
            public void actionPerformed( ActionEvent event )
             BetScreen betScreen = new BetScreen();
                 betScreen.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          betScreen.setSize(300,100);
          betScreen.setVisible(true);
          System.out.println(event.getSource());
          if(event.getSource() == betScreen.oddButton)
          betScreen.setVisible(false);
          }//end if
        }//end method actionPerformed
        }//end method actionListener
        );//end call to addActionListener
        }//end if

    This probably seems like a stupid question but what does a reference to a frame actually mean? JFrame frame1 = new CustomFrame1();
    JFrame frame2 = new CustomFrame2( frame1 );
    Now you have created frame2 by passing a reference ot frame1 to frame2. So now any code in frame2 has access to trame1, which means you could use the setVisible( false ) method on frame1, from an ActionListener in frame2. Its a terrible design as I don't see why the second frame would close the first frame, but it is possible.

  • Launch Internet Explorer using button click

    Hello friends
    I want that on click of a button Internet Explorer opens with an html file. Actually the file which opens is a report which I want to show to the user.
    Please help me in doing this.

    you could try doing something like this in your button click handler
    String command = "c:\\program files\\Internet Explorer\\iexplore.exe c:\yourfile.html"
    Runtime rt = Runtime.getRunTime();
    rt.exec(command);

  • Open MXML component + button click

    Hi,
    I have an MXML component within my Flex 2 Application, and
    within this component I have a button which when clicked, I want to
    "go / link to" (open) another MXML component.... e.g.:
    <mx:Application.......>
    <mx:panel............>
    <mx:button label="open other page" click="open the other
    MXML component etc..."/>
    </mx:panel>
    </mx:Application>
    Additionally I want to be able to pass a variable (on the
    same button click) to the component that is being opened on the
    button click, and use this variable within the second
    component......
    Could anyone suggest the best method of going about this?
    Thanks,
    Jon.

    In general all of the components of an application are
    created at start up. You then use view states and navigation
    containers to display the component when needed. If you want to
    create a component then check out this subject 'Creating deferred
    components' in the docs. Primarily you worry about deferred
    creation of objects if you want to reduce the file size of your
    swf. View states would be one way to handle the display of the
    components.

  • Trigger ics:catalogmanager on button click

    Is it possible to render/execute ics:CatalogManager on button click function using JavaScript?
    Currently on click we call Cs-element in which we execute ics:catalogmanager tag, But this on run-time causes the entire page to refresh. Which we don't want it to be like.
    Kindly provide the solution a.s.a.p.

    Kinjal,
    Instead of posting/submitting to the CSElement, calll the CSElement using Ajax call.

  • Using style sheets in a button click event

    hi. doing a project and extending the WoodStocks application. so need to google and find how to add keyboard short cuts to the data grid, the combo box, how to manually add the read only and edit columns and to do error handling for the save button. once
    i do this, then need to have two buttons. two different styles sheets, and using xml and xsl. so, do i just then do the xml and the xsl style sheet headers in a cutton click event. have gone through the learning from http://www.w3schools.com, and done the
    xml and the xsl tutorials. and so. just asking for your feedback, tips and tricks. and now, looking to have two style sheets, one for a visual user and one for a blind user. what aspects should i have in each style sheet. looking for feedback, advice. thanks.
    marvin.
    http://startrekcafe.stevesdomain.net http://groups.yahoo.com/groups/JawsOz

    hi. but i need to do this in c #, so it is relevant to c#
    http://startrekcafe.stevesdomain.net http://groups.yahoo.com/groups/JawsOz

  • Datagrid disappering on clicking while using popup button

    Hi,
    I have a popup button, which on opening presents a datagrid
    control. i can scroll through the datagrid.
    Problem is that if i accidentally click on the datagrid, the
    datagrid disappears back under the pop up button. Is there a way i
    can have it stop doing this and allow me to click through items in
    the datagrid without closing.
    I wanted the datagrid to close when an item is double
    clicked, so i had the double click property of the datagrid enabled
    but the problem again was if i had a single click on the datagrid
    it would close :(
    any suggetions?
    many thanks,
    abhi

    Manoj,
    I have tried out a prototype for this one. It seems to work but involves an extra button that user has to click.
    When the user selects the value from the combo box,instead of pushing the value to its destination, collect it in a cell say B2.
    use a toggle button from the components. when u click on ON in toggle button it pushes a 1 to the destination specified say C1.
    The destination cell where the combo box is feeding the selection has a formula like this E1=IF(C1=1,B2,D1). Note that D1 is a cell which populates blank value to ur combo box destination. it has the formula =""
    with the above set up: the user selects the value in the combo box and then clicks on the toggle button only then the value from combo box is placed at the combo box destination(E1).
    But the problem with the above set up is that the toggle button remains in the ON status once selected, pushing further selection in the destination with out the involvement of the toggle button.
    To overcome this pull in a RESET button clicking which it resets the status of the toggle to OFF again. this is the extra button I was referring to.
    Hope it helps!
    Thanks,
    Karthik

  • Open the default email application through button click in struts

    Hi can someone help me with launching the default mail application from a jsp page through button click? I am using struts.

    Yes you can send the dynamic values to the JS,
    I have never tried <bean:write but you can use as,
    var make="<%=makeFromJava%>"Where make is a JS variable and makeFromJava is a java variable where you can sent/set some dynamic values

  • Problem setting a hidden item value when button clicked with dynamic action or pl/sql process

    Apex 4.1
    Oracle 11g
    I have a page that consists of a main region and several sub regions.  I have a pl/sql process in After Header SET_DISPLAY(:P400_DISPLAY :='MAIN';)
    Three subregions have a contional display where P400_DISPLAY = STORE.  This works in hiding the sub regions.
    Now I want to change the P400_DISPLAY value to STORE to show the subregions when I hit a button.
    I tried creating a dynamic action for on click of the add button but get the following error:
    The selected button uses a 'Button Template' that does not contain the #BUTTON_ID# substitution string
    I went to the templates and found:
    Substitution Strings
    Substitution strings are used within sub templates to reference component values. This report details substitution string usage for this template.
    Substitution String
    Referenced
    From
    Description
    #LINK#
    Yes
    Template
    To be used in an "href" attribute
    #JAVASCRIPT#
    No
    To be used in an "onclick" attribute
    #LABEL#
    Yes
    Template
    Button Label
    #BUTTON_ATTRIBUTES#
    No
    Button Attributes
    #BUTTON_ID#
    No
    Generated button ID will be either the button's Static ID if defined, or if not will be an internally generated ID in the format 'B' || [Internal Button ID]
    I then tried creating a page process, pl/sql, :P400_DISPLAY :='STORE'; when the appropriate button is pressed.  The button action is submit page. However, it does not change the P400_DISPLAY value and the subregions stay hidden.
    Suggestions please on how to fix the template or change the P400_DISPLAY value?

    The root issue is that, although you change the value of your page item, it isn't visible to other areas of the page until it is in the session. So, any other action based on the value of your page item; the visibility of a control, a report based on the item's value, etc. will all be unaffected by changing the value of the page item until it has been changed in the session. Even after this the items are stored in the session, you must thereafter do something to cause the value to be reevaluated. To see the effect of this, observe that your page loads and evaluates the value of your page item, it sees that is "MAIN" and hides the regions. However, it doesn't reevaluate them after this.
    So; your choices to get this value set in the session are to either Submit the page, or use JavaScript to set the value in the session. If you use the latter of these, you'll have to do some further work to cause the visibility tests to be re-run, So, let's stick with with the submit method.
    What you've done above sounds correct for this but, there are a lot of decisions you could have made that might have caused things not to happen in the correct sequence.
    Firstly, let's confirm that what I describe above is your problem. From the development environment, load the page, click the button to change the value and submit. Now, click the link labelled Session. Is it still set to MAIN? If so; this is your issue.
    Let's start with the your After Header computation. Did you set it to *only* run if the current value of your page item is NULL??? If not, that's your problem.
    Load Page -> Item set to 'Main' by Computation -> Click Button -> Item set to STORE -> Submit -> Load Page -> Item set to 'Main' by Computation
    See the problem?
    Assuming this isn't the issue, you created a Branch to the same page, right? What is your process point for the Branch? Is it *After* Validation, Computation etc? Because if not, you aren't changing the value before the submit happens.
    I bet it is the first issue but, take a look at these.
    Cheers,
    -Joe

  • Open Dialog box on button click using Visual Webpart

    Hi,
    I am trying to create New Item,Edit Item & Delete Item button in Visual web part.On clicking on the button it should open the corresponding custom form on dialogue box.I don't want to create any button in the ribbon.I just want to create UI page for
    all buttons and also corresponding input forms on button click in Visual web part.
    Is it possible through visual web part?
    I will be needing your initial guidance to achieve this.
    Please help.
    Thank you.

    Hi,
    According to your post, my understanding is that you want to open modal dialog in a visual web part.
    To open a modal dialog, there are multiple ways, such as using JavaScript.
    However, for your scenario, you should register the script from the C# code, there are some articles for this topic, you can refer to them.
    http://www.ashokraja.me/articles/How-to-Programmatically-Show-or-Hide-a-Modal-Popup-Dialog-with-Server-Side-Code-in-Share-Point-2013
    http://blogs.perficient.com/microsoft/2012/01/sharepoint-2010-closing-a-modaldialog-manually-from-code-c-and-javascript/
    More reference:
    http://blogs.msdn.com/b/chaks/archive/2011/09/14/modal-dialog-box-in-sharepoint-sandbox.aspx
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • How can I get a List ID information using JScript on ribbon button click - SharePoint2010

    Dear All,
    I want to display the custom list ID column information on ribbon button click using a JScript.
    For This I have added a JScript in Layout folder in VS 2010 empty project solution and I have put
    the following Jscript code. While running and clicking the ribbon button, it seems like JScript is not
    invoking and not producing any result. It is like control is not going to Jscript file. How can I find out
    the issue???? can anyone please help me on anything wrong with my script or is
    it some-other problem which causes the blank result???
    It is a farm sharepoint2010 solution, debugging is not working in Visual Studio & IE!!!!
    Somebody please help, hard to find the error.....
    Please note the JScript Code: RibAlert.js
    <script>
    '//var siteUrl = '/sites/MySiteCollection';
    var siteUrl = 'http://a5-12457/AllItems.aspx';
    function retrieveListItems()
    var clientContext = new SP.ClientContext(siteUrl);
    var oList = clientContext.get_web().get_lists().getByTitle('Custom List');
    var camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml('<View><Query><Where><Geq><FieldRef Name=\'ID\'/>' +
    '<Value Type=\'Number\'>1</Value></Geq></Where></Query><RowLimit>10</RowLimit></View>');
    this.collListItem = oList.getItems(camlQuery);
    clientContext.load(collListItem);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    function onQuerySucceeded(sender, args)
    var listItemInfo = '';
    var listItemEnumerator = collListItem.getEnumerator();
    while (listItemEnumerator.moveNext())
    var oListItem = listItemEnumerator.get_current();
    listItemInfo += '\nID: ' + oListItem.get_id() +
    '\nTitle: ' + oListItem.get_item('Title') +
    '\nBody: ' + oListItem.get_item('Body');
    alert(listItemInfo.toString());
    function onQueryFailed(sender, args)
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    </script>
    Please note the Elements.xml
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction
    Id="CustomRibbonButton"
    Location="CommandUI.Ribbon"
    RegistrationId="100"
    RegistrationType="List">
    <CommandUIExtension>
    <CommandUIDefinitions>
    <CommandUIDefinition
    Location="Ribbon.ListItem.Manage.Controls._children">
    <Button
    Id="Ribbon.ListItem.Manage.Controls.TestButton"
    Command="ShowAlert"
    Image16by16="http://a5-12457/IconLib/ICONBTN.jpg"
    Image32by32="http://a5-12457/IconLib/ICONBTN.jpg"
    LabelText="Comapre alert"
    TemplateAlias="o2"
    Sequence="501" />
    </CommandUIDefinition>
    </CommandUIDefinitions>
    <CommandUIHandlers>
    <!-- <CommandUIHandler Command="AboutButtonCommand" CommandAction="javascript:alert();" EnabledScript="javascript:enable();"/> -->
    <CommandUIHandler Command="ShowAlert" CommandAction="javascript:alert();" EnabledScript="return true;"/>
    </CommandUIHandlers>
    </CommandUIExtension>
    </CustomAction>
    <!-- <CustomAction Id="Ribbon.Library.Actions.Scripts" Location ="ScriptLink" ScriptSrc="/_layouts/DocumentTabTwo/RibButton.js" /> -->
    <CustomAction Id="Ribbon.Library.Actions.Scripts" Location ="ScriptLink" ScriptSrc="/_layouts/RibAlert.js" />
    </Elements>

    Dear All,
    I want to display the custom list ID column information on ribbon button click using a JScript.
    For This I have added a JScript in Layout folder in VS 2010 empty project solution and I have put
    the following Jscript code. While running and clicking the ribbon button, it seems like JScript is not
    invoking and not producing any result. It is like control is not going to Jscript file. How can I find out
    the issue???? can anyone please help me on anything wrong with my script or is
    it some-other problem which causes the blank result???
    It is a farm sharepoint2010 solution, debugging is not working in Visual Studio & IE!!!!
    Somebody please help, hard to find the error.....
    Please note the JScript Code: RibAlert.js
    <script>
    '//var siteUrl = '/sites/MySiteCollection';
    var siteUrl = 'http://a5-12457/AllItems.aspx';
    function retrieveListItems()
    var clientContext = new SP.ClientContext(siteUrl);
    var oList = clientContext.get_web().get_lists().getByTitle('Custom List');
    var camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml('<View><Query><Where><Geq><FieldRef Name=\'ID\'/>' +
    '<Value Type=\'Number\'>1</Value></Geq></Where></Query><RowLimit>10</RowLimit></View>');
    this.collListItem = oList.getItems(camlQuery);
    clientContext.load(collListItem);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    function onQuerySucceeded(sender, args)
    var listItemInfo = '';
    var listItemEnumerator = collListItem.getEnumerator();
    while (listItemEnumerator.moveNext())
    var oListItem = listItemEnumerator.get_current();
    listItemInfo += '\nID: ' + oListItem.get_id() +
    '\nTitle: ' + oListItem.get_item('Title') +
    '\nBody: ' + oListItem.get_item('Body');
    alert(listItemInfo.toString());
    function onQueryFailed(sender, args)
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    </script>
    Please note the Elements.xml
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction
    Id="CustomRibbonButton"
    Location="CommandUI.Ribbon"
    RegistrationId="100"
    RegistrationType="List">
    <CommandUIExtension>
    <CommandUIDefinitions>
    <CommandUIDefinition
    Location="Ribbon.ListItem.Manage.Controls._children">
    <Button
    Id="Ribbon.ListItem.Manage.Controls.TestButton"
    Command="ShowAlert"
    Image16by16="http://a5-12457/IconLib/ICONBTN.jpg"
    Image32by32="http://a5-12457/IconLib/ICONBTN.jpg"
    LabelText="Comapre alert"
    TemplateAlias="o2"
    Sequence="501" />
    </CommandUIDefinition>
    </CommandUIDefinitions>
    <CommandUIHandlers>
    <!-- <CommandUIHandler Command="AboutButtonCommand" CommandAction="javascript:alert();" EnabledScript="javascript:enable();"/> -->
    <CommandUIHandler Command="ShowAlert" CommandAction="javascript:alert();" EnabledScript="return true;"/>
    </CommandUIHandlers>
    </CommandUIExtension>
    </CustomAction>
    <!-- <CustomAction Id="Ribbon.Library.Actions.Scripts" Location ="ScriptLink" ScriptSrc="/_layouts/DocumentTabTwo/RibButton.js" /> -->
    <CustomAction Id="Ribbon.Library.Actions.Scripts" Location ="ScriptLink" ScriptSrc="/_layouts/RibAlert.js" />
    </Elements>

  • Clicking add button to display the values

    requrement is like this
    Could anyone give suggestions with some code .
    we have lovs using this one we are searching for the value(ex emloyee name) that value is returned to the base page filed like message text input . we have add button, when ever we click that button to display the value(ex employee name ,desigantion this is from another table )on that same page.

    I could not understand your requirement. Post more details of the requirement with specific details.
    Message was edited by:
    Srini

  • Result handler not getting invoked on button click - URGENT

    Hi Folks,
    We are working on a form submit application where we populate the form and finally click on button to submit the completed form. We are using BlazeDs On button click I call java service and expect a response object back to flex UI. We are getting the java call invoked successfully and the log clearly shows that the appropriate objects are returned from java service, however, the result handler is not getting inviked to capture the result in flex mxml. I am in urgent need of your help on this
    Code snippet:
    <mx:Script>
    <![CDATA[
    protected  
    function Service_resultHandler(event:ResultEvent):void
    Alert.show(
    "event.result.troubleTicketId ::"+event.result.status); 
    var u:URLRequest = new URLRequest("http://www.adobe.com/flex");navigateToURL(u,
    "_blank"); 
    private function faultHandler_exitService(event:FaultEvent):void {Alert.show(event.fault.faultString +
    '\n' + event.fault.faultDetail); 
    var u:URLRequest = new URLRequest("http://www.google.com");navigateToURL(u,
    "_blank"); 
    protected  
    function submit_clickHandler():void
    //Alert.show("1");
    createTicketForm.setCallDetails_callRegion(FlexUI_callDetails_callRegion);
    //Alert.show("2"+FlexUI_callDetails_callRegion);
    createTicketForm.setCallDetails_callRegion2(FlexUI_callDetails_callRegion2);
    exitService.createTroubleTicket(createTicketForm);
    ]]>
     </mx:Script>  
    <mx:RemoteObject id="exitService" destination="ExitService" fault="faultHandler_exitService(event)">
    <mx:method name="createTroubleTicket" result="Service_resultHandler(event)"/>
    </mx:RemoteObject>
    <mx:Button 
    label="submit Ticket" width="65" height="22" textAlign="right" x="904" y="-10" click="submit_clickHandler()" />
    My Java service:
    public  
    class ExitService {  
    public CreateTmsTicketResponse createTroubleTicket(CreateTicketForm createTicketForm){
    return  
    createTmsTicketResponse;}
    remoting-config.xml:
     <destination id="ExitService">  
    <properties>  
    <source>com.qwest.qportal.flex.createTicket.ExitService</source>  
    </properties>
     </destination>

    Please refer to below link, hope it helps:
    http://forums.asp.net/t/1927214.aspx?The+IListSource+does+not+contain+any+data+sources+
    Please ensure that you mark a question as Answered once you receive a satisfactory response.

Maybe you are looking for