Automatic button press

Hi everyone,
I have a "Flat sequence structure" as shown below.
on the second "frame" I have an "OK" button.
this OK button is triggering an event.
I want the button will be pressed once automaticly when the program enters to the second frame.
Do you have a nice solution?
I thought to change the event to "change value" and to  make a property node
"value (signaling)" that getting value from text file. I think that my solution isn't elegant.
maybe you have a better solutions?
thank you very much

You still don't make a lot of sense. It would probably help to attach the actual VI instead of a highly truncated picture.
What is the mechanical action of the button?
Do you really need to press the button programmaictally or would it be sufficient to simply triger the same code parts as if somebody had pressed the button?
Why do you need the FOR loop?
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • X200 in Hibernate Mode, it starts up automatically without pressing on the power up button....

    X200
    Dear all,
    When my X200 is in Hibernate Mode, it starts up automatically without pressing on the power up button....
    I installed Win Xp on it. All my drivers are installed.
    I swichted of the Power on Lan in the Bios, but still no difference.
    When I turn off my computer completely, I doesn't start up from himself. So it's only in hibernate mode.
    Does anyone has an idea what it coud be?
    Thanks a lot for your support.

    Take it right back and Apple will likely exchange it for another rather than have you demand your money back.
    This time, check to see if you have a lemon first before leaving.
    It's rare, but it does happen, sorry it happened to you.

  • I have reached out  to this community as my Iphone display gone black and got the solution to keep home and power button pressed. It worked but I would like to know why it went black

    I have reached out  to this community as my Iphone display gone black and got the solution to keep home and power button pressed. It worked but I would like to know
    1. Why it went black and is there a permanent fix for this
    2.Will the IOS gets automatically updated as I feel the IOS was 5 when I got the phone in 2012 december
    3.Do you suggest 7.1 for Iphone 4

    1. There is no way of knowing. These things happen.
    2. The iOS only gets updated when you want it to be.
    3. You should always update to the latest iOS your phone will support. Apple do not write the updates to make your experience worse.

  • When Button Pressed: 3171265167539056707

    I have a choice 3171265167539056707 listed under "When Button Pressed". What is that?

    Yeah, I have seen these cases where "foreign keys" are left dangling in the App Builder.
    When you delete a item, all computations based on that item are deleted
    Similarly, when you delete a button, all after-submit components based on that button should be automatically deleted (or at least set to Unconditional).

  • Simulate "When button pressed" condition

    I created a button a page (in region position).
    When I go to the Edit page for the button, the Optional URL Redirect section says "No target".
    I have a After Submit process on the page that has its "When button pressed" condition set to that button.
    Now, before firing the process, I would like to popup a Javascript confirm box that checks some value on the page and if it is ok, it submits the page
    So, I went to the URL redirect section on the button and changed the target to URL and specified the following URL
    javascript:{if (document.getElementById('SOME_ELEMENT').value=='foo' || confirm('Are you sure?')) doSubmit('BUTTON_NAME');}
    Now, what change do I need to make to the After Submit process to simulate the 'When Button Pressed' condition? Or would it automatically know that the submit was (indirectly, via the doSubmit) due to the button being pressed and accordingly fire?
    Hope I explained this clearly.
    Thanks

    Actually, I didnt need to change anything in my After Submit process. I still had it execute with no conditions and a 'When Button Pressed' of BUTTON_NAME and it worked fine! I didnt need to use the REQUEST value anywhere.
    Is this just a co-incidence, did I get lucky or is this the way things are supposed to work?
    javascript:{if (document.getElementById('SOME_ELEMENT').value=='foo' || confirm('Are you sure?')) doSubmit('BUTTON_NAME');}
    Or would it automatically know that the submit
    was (indirectly, via the doSubmit) due to the
    button being pressed and accordingly fire?The answer to my question above would seem to be "yes". Is that right?
    Thanks

  • Excel Simulate Button Press

    I have an excel file containing data and some macros. I'd like to use LabVIEW to automate the pressing of a command button which has a macro assigned to it. Is there a way to do this through the ActiveX properties and methods Excel exposes?
    Thanks,
    Craig

    Ok. I figured it out. I was asking the wrong question. I really just want to run a macro and it looks like there have been plenty of people on this forum that have asked the same thing.
    Solutions:
    1) LabVIEW 8.5 has some examples of calling macros (just search 'macro' in the example finder)
    2) You can also use the "Run Macro VI" in the report generation toolkit
    http://zone.ni.com/reference/en-XX/help/372120A-01/lvoffice/excel_run_macro/
    I ended up using the example provided by NI to guide me. The Application instance has a method of "Run" which allows you to call a macro by its XLS file and name (e.g. myDoc.xls!Button_Click_1)
    Thanks!
    Craig

  • Error -- No Such Trigger('when-button-pressed')

    Hi,
    I am getting the error ""No Such Trigger('when-button-pressed')"",
    when I am executing the code EXECUTE_TRIGGER( 'WHEN-BUTTON-PRESSED' );
    on some item(Key-Next-Item), although WHEN-BUTTON-PRESSED trigger exists.
    What could be the problem ?. It worked till yesterday, giving error from today, I havent
    changed any thing.
    Thanks in Advance
    Devender

    Steve's tip is the only good solution for this case.
    The problem in your case for example is:
    Let's say you have a block-trigger, which fires after your execute-trigger.
    Now a colleague of you, which don't know your code, create a WHEN-BUTTON-PRESSED on an item, then the new code is started and not the block-trigger-code.
    So, don't ever do this. Write your code in a package-function or -procedure and call it from the trigger. So you can re-user the functionality
    Gerd

  • Change control values on button press

    Hi, I've got a situation where I have several numeric controls where you can change different values. I also have several subVIs with control references (as described in this article: http://labviewwiki.org/Control_References) that takes in references to these numeric controls on the mainVI. These subVIs continously read the values in their own threads.
    So whenever I change a value on any of the controls, the values does of course change in the subVIs, since they reference to the value of the control.  How would I make the actual value only change only after I clicked the ok button?
    To illustrate this I made a VI with an event structure and a separate while loop that continoulsy reads a reference to the control and updats an indicator. I can think of a few cumbersome solutions, whereas I have two controls for every value. The second control would then be hidden and only written to in case of the Ok button press. But having two controls to do something simple as this seems superfluous.
    Message Edited by Siniz on 10-20-2009 10:36 AM
    Solved!
    Go to Solution.
    Attachments:
    ValueChangeOnButtonPress.vi ‏19 KB

    Given what you want to do then I would suggest that you use an Action Engine to contain your data. This has the advantage of decoupling the UI from the subtasks. I would recommend that your action engine consist of an array of clusters. Each cluster would contain the data values, in your case Ki, Kd and Kp for each controller. This has the advantage of reducing the individual values you are dealing with and treats the data for a given controller as a whole. The subtasks could either poll the data looking for a value change. You could even keep track of that in your Action Engine so you would only need to poll to see if the data changed. If it did, then read the data. You would need an index or ID to specify which controller's data you would want to access. The action engine allows you to grow your application if more controllers are added. You should use a typedef to define the cluster. If you wanted to make this more event driven you could use a single notifier shared by your subtasks that would simply indicate a data change event. Part of the data for the notifier could specify which data. That way only interested subtasks would take action. This type of architecture wouldn't add lots of wires to your diagram especially if you used a named notifier.
    Regardless of the way you choose to pass the data to the subtasks I would take a look at your UI. I haven't seen it so I can't comment on it specifically. However is you have 40 controls on the front panel at the same time it most likely is a confusing interface. There are ways to reduce the complexity and still provide the same functionality. If you haven't already looked at I would recommend getting the book The LabVIEW Style Book by Peter Blume. If you did reduce your UI to only work with a single controller or a couple of related controllers at a time the Action Engine approach would work nicely since you take your data from the FP and only update the data that has changed. From a UI perspective you have less controls to worry about on your UI and it will probably be easier for the user to understand. From the application's perspective you have decoupled the subtasks from the UI in a very clean way. Another approach would be to use LVOOP for your controller data and processing. Then you simply instantiate a new instance of the class (an object) for each controller that your system is using. This has an added benefit of allowing you to use different controllers and load them at runtime using dynamic dispatching.
    PS You are good for the overall Kudo count. Thanks.
    Message Edited by Mark Yedinak on 10-20-2009 12:33 PM
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Calling a report from forms - FRM-40735 when-button-pressed raised unhandle

    Hi,
    I created a form to generate a pdf report.
    its not going too well, so i need some help.
    my form only has one button , when pressed I want it to generate a report in pdf format.
    i created a when-button-pressed trigger and the following code is below:
    I also create a web service proxy jar file,
    the jar file is in the FORMS_BUILDER_CLASSPATH, and the jar file is imported from forms builder without any issues.
    As of now I am hard coding everything in the code below to see if it works.
    The error I am getting  FRM-40735 when-button-pressed raised unhandled exception ORA-105100 i dont know why ?
    This error is occurring at this line of code, please help, this is my first time doing something like this.
    obj := publicreportserviceclient.new(); DECLARE
    param_name varchar2(200);
    un varchar2(200);
    pw varchar2(200);
    out_file varchar2(200);
    obj ORA_JAVA.JOBJECT;
    BEGIN
    obj := publicreportserviceclient.new();
    param_name := 'EMP';
    un := 'Administrator';
    pw := 'Oracle123';
    out_file := 'D:\DevSuiteHome_1\j2ee\home\default-web-app'||'output';
    publicreportserviceclient.callRunReport(obj,'/~administrator/Learn/Test1/Test1.xdo','EMP','141414',un,
    pw,'pdf','New_Template',out_file);
    web.show_document('http://jmenge-de.de.oracle.com:8889/j2ee/' || 'output');
    exception
      --check for ORA-105101
      when ORA_JAVA.EXCEPTION_THROWN then
         message('Java Exception : '
          || Exception_.toString(ORA_JAVA.LAST_EXCEPTION));
          ORA_JAVA.CLEAR_EXCEPTION;
          return;
      --check for ORA-105100
      when ORA_JAVA.JAVA_ERROR then
                   message('Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR);
              return;
    END;This is my java function
        public void callRunReport (String reportPath, String paramName, String  paramValue, String
        username, String password, String format, String template, String outFile) {
        try {
                bip_webservice.proxy.PublicReportServiceClient myPort = new bip_webservice.proxy.PublicReportServiceClient();
                // Calling runReport
                ReportRequest repRequest = new ReportRequest();
                repRequest.setReportAbsolutePath(reportPath);
                repRequest.setAttributeTemplate(template);
                repRequest.setAttributeFormat(format);
                repRequest.setAttributeLocale("en-US");
                repRequest.setSizeOfDataChunkDownload(-1);
               ParamNameValue[] paramNameValue = new ParamNameValue[1];
                paramNameValue[0] = new ParamNameValue();
                paramNameValue[0].setName(paramName);
                String[] values = new String[1];
                values[0] = paramValue;
                paramNameValue[0].setValues(values);
                repRequest.setParameterNameValues(paramNameValue);
                ReportResponse repResponse = new ReportResponse();
                repResponse = myPort.runReport(repRequest,username,password);
                byte[] baReport = repResponse.getReportBytes();
                FileOutputStream fio = new FileOutputStream(outFile);
                fio.write(baReport);
                fio.close();
            } catch (Exception ex) {
                        ex.printStackTrace();
        }Thanks - please help

    If there is a way to make it work with Bi publisher, Please let me know.
    I need to something to make it work with BI publisher.
    thanks,
    Edited by: Rooney on May 27, 2010 1:27 PM

  • How can I call my chart in Forms6i on When Button Press Trigger?

    Hi Friends,
    I have make a chart in Graphic Builder 6i and save on path C:\graph\test.ogd
    Now I want to run this Chart from Form6i on When Button Press trigger.
    I have call my report in forms using this command on When Button Press trigger.
    Run_Product(reports,'C:\Cheema\Qdir_store\reports\pmms\sec_backlog',asynchronous,runtime,filesystem,TO_CHAR(NULL));
    So tell me How can I call my chart in Forms6i?
    Please reply me on urgent.
    Thanks,
    Shahzad

    Just to recall after a long break of couple of years..... Pls check out if not wrong.
    First of all you need to embeed the chart object on your layout window and make it visible = FALSE. This is a design time work. In the button press event, show the chart object by setting the visible property = TRUE.
    Note, i could not paste u the sample code as i don't have forms installation on my PC. The above states is a logic you can apply.

  • Help-I Need to hold a Abstract button pressed

    hi,
    I have captured a button instance from abbot. I need to hold the button pressed for 2 seconds without releasing.
    I need to know, how to do it?
    Pressing the button for more than 2 seconds without releasing will popup a menu.. i need to get the instance of the menu too...
    How can i do that, either through Java or with Abbot.
    Thanks,
    With Regards,
    Priyaa.

    what the heck is Abbot?I thought everyone knew about [url http://www.jahozafat.com/TV_Shows/Abbott_And_Costello/hey_abbott.wav]Abbot.

  • Why am I getting this error?  How do I add confirm message to button press?

    Using Java Studio Creator.
    I do not understand why I am getting the following page error:
    Description: An unhandled exception occurred during the execution of the web application. Please review the following stack trace for more information regarding the error.
    Exception Details: java.lang.IndexOutOfBoundsException
    Index: 0, Size: 0
    Possible Source of Error:
    Class Name: java.util.ArrayList
    File Name: ArrayList.java
    Method Name: RangeCheck
    Line Number: 546
    ======================================================================
    I have a page that works.
    It has a button that is created in the session bean code with the following java:
    button = (HtmlCommandButton)application.createComponent(HtmlCommandButton.COMPONENT_TYPE);
    button.setActionListener( application.createMethodBinding("#{ScheduleEditSessionBean.mainApply}", new Class[]{ActionEvent.class} ));
    button.setId( "applyUndates" );
    button.setType( "submit" );
    button.setTitle( "Apply updates.");
    button.setValue( "Apply" );
    button.setStyle(style);
    children.add(button);
    When the button is pushed, it calls the following session bean method:
    public void mainApply(ActionEvent actionEvent)
    updateScheduleData();
    scheduleAdjustFlag = 1;
    dataApplied = true;
    dataSaved = false;
    addControls();
    This all works just fine - no errors
    ====================================================================
    I wanted to add confirmation to the button press, so I removed the action listener for this button and added
    a javascript function call for the onclick method
    button = (HtmlCommandButton)application.createComponent(HtmlCommandButton.COMPONENT_TYPE);
    style = "text-align: center; font-family: 'Arial','Helvetica',sans-serif; " + font + " height: 22px; width: 115px";
    // Commented out this line button.setActionListener( application.createMethodBinding("#{ScheduleEditSessionBean.mainApply}", new Class[]{ActionEvent.class} ));
    button.setOnclick("confirmApply()"); // Added this line.
    button.setId( "applyUndates" );
    button.setType( "submit" );
    button.setTitle( "Apply updates.");
    button.setValue( "Apply" );
    button.setStyle(style);
    children.add(button);
    I added a dummy button to the page that has the following call to execute the mainApply method in the sessioon bean.
    The button action just calls the mainApply() method in the session bean
    public String mainApplyBtn_action() {
    seb.mainApply();
    return null;
    Added the javascript to the page that simply pushes the dummy button if confirmed.
    function confirmApply()
    if( confirm( 'Are you sure you want to Apply these changes?' ) )
    form1["form1:mainApplyBtn"].click();
    The session bean method looks like this it is the same method as before, but without the action event argument.
    public void mainApply()
    lsb.logMsg( "<ScheduleEditBean.mainApply> Main apply pushed" );
    updateScheduleData();
    scheduleAdjustFlag = 1;
    dataApplied = true;
    dataSaved = false;
    addControls();
    ==================================================================================
    Now, when I push the original 'Apply' button, I get the confirmation box just like I expected.
    But when I confirm the question, I get the error at the top of this post.
    If I push the 'dummy button' directly, I do not get the error.
    I do not understand why I should be gettng this error.
    Can anyone give me a clue as to why this change would cause the problem?
    The error is related to an ArrayList.
    I use several of these on the page, but they should be filled with data in the preRender method of the page.
    Can anyone suggest a way that I can add confirmation to a button that is created under program control?
    Thanks

    Make use of the fact that when an onclick event of a button returns 'false', the action will not be taken.
    Pseudocode:<h:commandButton value="submit" action="#{myBean.action}" onclick="return confirm('Are you sure?');" />

  • How to call a dynamic URL on 'button press' event, in MVC-based BSP

    Hi,
    My requirement is as below:
    On selecting a row in table view, and pressing a button, I need to open a browser.
    The Browser URL depends on the row selected.
    The key field from table view, is added at the end of the URL string.
    Shortly, I can say that, I am getting a value on row selection & want to pass it to button event.
    In Views Section, there are 2 tags- (1)table view & (2)button.
    Right now, I have put the code for getting the key field, in DO_HANDLE_DATA method.
    In Button's OnClientClick method, I have called the Javascript to open the browser.
    If I now write the code to concatenate the key field value to form the dynamic URL in 'OnClick' method,
    it will be called only after the browser is opened.
    (as OnClick event is executed only after OnClientClick event is executed)
    Could anyone please tell me what event (and in which tag) can be used to solve this.
    Is there any event which is triggered, as soon as the row is selected, &  before the button press event is triggered ?
    Would really appreciate responses made to this query.
    Thanks,
    Nisha Vengal.

    Hi Nisha,
    The crux of your issue here is that you want to call the event triggered with onClick before calling the event triggered on onClientClick. This can be achieved by the following code in the function called on the onClientClick.
    function fn_button()
               htmlbSL(this,2,'b_row_selection:onInputProcessing()');
               window.open("new_page",target="BLANK");
    Here, fn_button is the javascript function called on button click, and b_row_selection is the event triggered on the onClick event of row selection.
    Try this out and let us know if it works for you.
    Regards,
    Saurabh

  • Problem while hide a block on selection screen on button press

    Hi,
    I have added two buttons on the application toolbar of the selection screen. I have input fields under two blocks on the selection-screen. Initially the second block is hidden. If I press the button 1 the second block should be made visible.
    For this to happen, I captured the button 1 click event using the following statement.
    IF sscrfields-ucomm = 'FC01'.
    Inside the if ... endif, I looped at the screen and made the second block visible. It was working fine.
    loop at screen.
      if screen-group4 = '013'.
         screen-invisible = 1.
         screen-active    = 0.
      endif.
    endloop.
    Later the second button was added. Now when i run the report for the first time, if button 2 is clicked the hidden block appears on the selection screen even though i have not added any code for it.
    Just to check, i commented the logic to display the hidden block on button 1 click event. Even without any code the first time i press any of the two buttons added on the application toolbar the hidden block is displayed.
    I saved a variant for the report.
    During execution of the report, if i select any variant then the hidden block is displayed.
    Can anyone please tell me how to fix this problem.
    Regards,
    T2.

    Hi All,
    The problem is solved.
    Everyone was confusing between the pushbutton on the selectio-screen and on apllication toolbar
    (where you have the execute icon).
    Please find the code below. Thanks for you time and help. I appreciate it.
    REPORT ztest.
    INCLUDE <icon>.
    *  TABLES                                                              *
    TABLES: t001,              " Company Codes
            lfa1,              " Vendor Master (General Section)
            sscrfields.        " Fields on selection screens
    * To capture button press event.
    DATA: gv_button_press       TYPE c.
    * Menu Painter: Program interface for dynamic texts
    DATA: gs_dyntxt             TYPE smp_dyntxt.
    *  SELECTION SCREEN                                                    *
    SELECTION-SCREEN FUNCTION KEY 1.
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-s01.
    * Company Code.
    SELECTION-SCREEN BEGIN OF BLOCK ccode WITH FRAME TITLE text-s02.
    SELECT-OPTIONS: s_bukrs FOR t001-bukrs OBLIGATORY MEMORY ID buk.
    SELECTION-SCREEN END OF BLOCK ccode.
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN BEGIN OF BLOCK dsel WITH FRAME TITLE text-s04.
    * Vendor Master.
    SELECTION-SCREEN BEGIN OF BLOCK vend WITH FRAME TITLE text-s07.
    SELECT-OPTIONS: s_konzs FOR lfa1-konzs MODIF ID aw1.
    SELECT-OPTIONS: s_txcd1 FOR lfa1-stcd1 MODIF ID aw1.
    SELECT-OPTIONS: s_txcd2 FOR lfa1-stcd2 MODIF ID aw1.
    SELECTION-SCREEN END OF BLOCK vend.
    SELECTION-SCREEN END OF BLOCK dsel.
    * INITIALIZATION                                                       *
    INITIALIZATION.
    * Populate the Application toolbar button attributes.
      PERFORM populate_app_toolbar_buttons.
    * Hide the dynamic screen intially.
      PERFORM hide_screenfields.
    * AT SELECTION SCREEN                                                  *
    AT SELECTION-SCREEN.
    * Capture the button press event.
      PERFORM capture_button_press.
    * AT SELECTION-SCREEN OUTPUT.                                          *
    AT SELECTION-SCREEN OUTPUT.
    * Show/Hide the dynamic selection screen based on button press.
      PERFORM adapt_screen.
    *&  Form  populate_app_toolbar_buttons                                 *
    *   Display Icon on the application toolbar buttons. Also set the      *
    *   function codes for these buttons.                                  *
    FORM populate_app_toolbar_buttons.
      CLEAR gs_dyntxt.
      WRITE icon_fencing     TO gs_dyntxt-icon_id AS ICON.
      MOVE  text-b01         TO gs_dyntxt-quickinfo.   " Dynamic Selections
      MOVE gs_dyntxt         TO sscrfields-functxt_01.
    ENDFORM.                    " populate_app_toolbar_buttons
    *&  Form  hide_screenfields                                            *
    *   Initially hide the Dynamic selection screen.                       *
    FORM hide_screenfields.
      LOOP AT SCREEN.
        IF screen-group1 = 'AW1'.
          screen-invisible = '1'.
          screen-active    = '0'.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    ENDFORM.                    " hide_screenfields
    *&  Form  capture_button_press                                         *
    *   Set the flag based on button press event. Appication bar button    *
    *   tcode is available only at 'At Selection-screen' event.            *
    *   Use the captured data at 'At Selection-screen Output' event.       *
    *   Screen adjustments is possible only under this event.              *
    FORM capture_button_press.
      IF sscrfields-ucomm = 'FC01'.
        IF gv_button_press IS INITIAL.
          gv_button_press = 'X'.
        ELSEIF gv_button_press EQ 'X'.
          CLEAR gv_button_press.
        ENDIF.
      ENDIF.
    ENDFORM.                    " capture_button_press
    *&  Form  adapt_screen                                                 *
    *   Show/Hide the dynamic selection screen based on button press       *
    *   captured at 'At selection-screen' event.                           *
    FORM adapt_screen.
    * If button press flag is initial hide the dynamic selection screen.
      IF gv_button_press IS INITIAL.
        LOOP AT SCREEN.
          IF screen-group1 = 'AW1'.
            screen-invisible = '1'.
            screen-active    = '0'.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
    * Elseif button press flag is 'X' show the dynamic selection screen.
      ELSEIF gv_button_press EQ 'X'.
        LOOP AT SCREEN.
          IF screen-group1 = 'AW1'.
            screen-invisible = '0'.
            screen-active    = '1'.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " adapt_screen
    Regards,
    T2
    Message was edited by: Titu Joseph

  • Sending an object from client to server always on button press

    What I need is to send an object from client to server but I need to make server wait until another object is sent. What I have is the JFrame where you put the wanted name and surname, then you create a User object with these details and on button press you send this object to the server. I just can't hold the connection because when I send the first object, server doesn't wait for another button click and throws EOFexception. Creating the while loop isn't helpfull as well because it keeps sending the same object again and again. The code is here
    public class ClientFrame extends JFrame {
        private JButton btnSend;
        private JTextField txfName;
        private JTextField txfSurname;
        public ClientFrame() {
            this.setTitle(".. ");
            Container con = this.getContentPane();
            con.setLayout(new BorderLayout());
            txfName = new JTextField("name");
            txfSurname = new JTextField("surname");
            btnSend = new JButton(new AbstractAction() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    SSLSocketFactory f =
                            (SSLSocketFactory) SSLSocketFactory.getDefault();
                    try {
                        SSLSocket c =
                                (SSLSocket) f.createSocket("localhost", 8888);
                        c.startHandshake();
                        OutputStream os = c.getOutputStream();
                        ObjectOutputStream oos = new ObjectOutputStream(os);
                        InputStream is = c.getInputStream();
                        ObjectInputStream ois = new ObjectInputStream(is);
                        boolean done = false;
                        while (!done) {
                            String first = txfName.getText();
                            String last = txfSurname.getText();
                            User u = new User();
                            u.setFirstName(first);
                            u.setLastName(last);
                            oos.reset();
                            oos.writeObject(u);
                            String str = (String) ois.readObject();
                            if (str.equals("rcvdOK")) {
                                System.out.println("received on the server side");
                            } else if (str.equals("ERROR")) {
                                System.out.println("ERROR");
                        //oos.writeObject(confirmString);
                        oos.close();
                        os.close();
                        c.close();
                    } catch (ClassNotFoundException ex) {
                        Logger.getLogger(ClientFrame.class.getName()).log(Level.SEVERE, null, ex);
                    } catch (IOException ex) {
                        System.err.println(ex.toString());
            btnSend.setText("send object");
            con.add(btnSend, BorderLayout.PAGE_START);
            con.add(txfName, BorderLayout.CENTER);
            con.add(txfSurname, BorderLayout.PAGE_END);
            this.pack();
            setSize(200, 150);
            setVisible(true);
    public class TestServer {
        public static void main(String[] args) {
            try {
                KeyStore ks = KeyStore.getInstance("JKS");
                ks.load(new FileInputStream(ksName), ksPass);
                KeyManagerFactory kmf =
                        KeyManagerFactory.getInstance("SunX509");
                kmf.init(ks, ctPass);
                SSLContext sc = SSLContext.getInstance("TLS");
                sc.init(kmf.getKeyManagers(), null, null);
                SSLServerSocketFactory ssf = sc.getServerSocketFactory();
                SSLServerSocket s = (SSLServerSocket) ssf.createServerSocket(8888);
                printServerSocketInfo(s);
                SSLSocket c = (SSLSocket) s.accept();
                InputStream is = c.getInputStream();
                ObjectInputStream ois = new ObjectInputStream(is);
                OutputStream os = c.getOutputStream();
                ObjectOutputStream oos = new ObjectOutputStream(os);
                boolean done = false;
                User u;
                  while(!done){
                    u = (User) ois.readObject();
                    String confirmString = "rcvdOK";
                    String errorString = "ERROR";
                    if (u != null) {
                        System.out.println(u.getFirstName() + " " + u.getLastName());
                        oos.writeObject(confirmString);
                    } else if (u == null) {
                        oos.writeObject(errorString);
                is.close();
                s.close();
                c.close();
            } catch (Exception e) {
                    System.err.println(e.toString());
    }Thanks for any help, btw this doesnt need to be via ssl, the problem would be the same using only http. Please anyone help me:)
    Edited by: Vencicek on 7.5.2012 2:19
    Edited by: EJP on 7/05/2012 19:53
    Edited by: Vencicek on 7.5.2012 3:36

    Current code fails because it's sending still the same entity again(using while loop)No it's not. You are creating a new User object every time around the loop.
    which makes the system freezeWhich means that you are executing network code in the event thread. Don't do that, use a separate thread. At the moment you're doing all that sending inside the constructor for ClientFrame which is an even worse idea: you can never get out of there to the rest of your client program. This is a program design problem, not a networking problem.
    and doesn't allow me to set new parameters of the new entityI do not understand.
    I need to find a way to keep Server running even when the client doesn't send any data and wait until the client doesnt press the send button again to read a new object.That's exactly what happens. readObject() blocks until data is received.

Maybe you are looking for

  • How can I set up Thunderbird so it sees my custom folders?

    It only shows me Inbox, Outbox, Trash and Sent items. For example If I create a folder and move some of my mails there, the client will stop showing me anything. As if that mail is gone, but if I actually log in to my email using a browser it would a

  • Airtunes drops with ext. hard drive

    I recently "down-graded" from MBP to a white MacBook. My music is stored on an external drive, and I've been using AirTunes (with older Extreme) for years with no problems. But the other day the weirdest things began happening: 1.) Listening to tunes

  • Duplicate condtion types accepting in item condition (interesting)

    Hi Sap Guru's, When i am entering manual condition type in item condition type column Ex: PR00 basic price 2000/Rs, and again i am entering same condition type PR00 basic price 1000/Rs the system accepting same condition type ?? is there any standard

  • Email integration

    Hi! I have a mail server runnig Linux (sendmail, checkmail) and i want to have access to mail messages in that machine from a Portal page. I have experimented de IMAP portlet, but dont work fine, dont listed my mail messages, only give the number of

  • RMAN problem with block corruption

    Hi I have problem with the block corruption in one of the database . here is the error message . ora-01578:oracle data block corrupted (file# 10,block # 55309) ora-01110: data file 10: '/db/gist1/data/gist1_gis_nologging_01.dbf' ora-26040: data block