How to get the previoulsy selected value in a combobox

How to get the previoulsy selected value in a combobox. i WANT the current and the previously selected value of the combobox.

Just add to combobox ItemListener. When item is changing in itemStateChanged arrives 2 events. ItemEvent.DESELECTED and ItemEvent.SELECTED with corresponding item's values. Just write something like this:
        comboBox.addItemListener(new ItemListener() {
            Object prevValue;
            public void itemStateChanged(ItemEvent e) {
                if (e.getStateChange() == ItemEvent.SELECTED) {
                    //do what you need with prevValue here
                } else {
                    prevValue = e.getItem();
        });

Similar Messages

  • How to get the current selected value of a combo box or a option button?

    Hello All,
    I want to catch the current selected value of a combo box and also of a option button and want save it into different variables in my code. These option button and combo box are in a SAP business one form which I have created through VB dot.net coding.
    But I don't know how to do that, can any one send any example code for this.
    Regards,
    Sudeshna.

    Hi Sudesha,
    If you want to get the selected values you can do it as follows: The Combo Box value you can get from the combo box. If you want to get it on the change event, you must make sure that you check when BeforeAction = False. If you want to get an Option Button value you should check the value in the data source attached to the option button.
            Dim oForm As SAPbouiCOM.Form
            Dim oCombo As SAPbouiCOM.ComboBox
            Dim oData As SAPbouiCOM.UserDataSource
            oForm = oApplication.Forms.Item("MyForm")
            oCombo = oForm.Items.Item("myComboUID")
            oApplication.MessageBox(oCombo.Selected.Value)
            oData = oForm.DataSources.UserDataSources.Item("MyDataSourceName")
            oApplication.MessageBox(oData.ValueEx)
    Hope it helps,
    Adele

  • How to get the old selection in ListSelectionListener valueChanged() method

    Hi,
    Is anyone know how to get the old selection index/value in the ListSelectionListener valueChanged() method? The list.selectedValue() always return the same value which is the new selection. The ListSelectionEvent.getFirstIndex() and getLastIndex are always firstIndex <= lastIndex so that you cant' tell which one is the old selection.
    Please help and thanks!

    Just test the two indexes (first and last): if the corresponding row is selected, then the other is unselected. That gives you the old (unselected) and new (selected) item.
    Of course, I have supposed that you were using a SINGLE_SELECTION model...
    Hope this helped,
    Regards.

  • How to get the default selection color from JTable

    Hi, there,
    I have a question for how to get the default selection color from JTable. I am currently implementing the customized table cell renderer, but I do want to set the selection color in the table exactly the same of default table cell renderer. The JTable.getSelectionBackgroup() did not works for me, it returned dark blue which made the text in the table unreadable. Anyone know how to get the window's default selection color?
    Thanks,
    -Jenny

    The windows default selection color is dark blue. Try selecting any text on this page. The difference is that the text gets changed to a white font so you can actually see the text.
    If you don't like the default colors that Java uses then use the UIManager to change the defaults. The following program shows all the properties controlled by the UIManager:
    http://www.discoverteenergy.com/files/ShowUIDefaults.java
    Any of the properties can be changed for the entire application by using:
    UIManager.put( "propertyName", value );

  • Reg: How to get the trip activity values in user exit.

    HI Experts,
    I have scenario like I need calculate the trip advance amount for an employee.
    Based on the employee travel days and employee’s activity type.
    Activity types means:  types of employee trips like
    1. Domestic
    2. International
    Here my problem is not getting trip activity values into my user exit.
    I am getting the all selection values in trip header except this TRIP ACTIVITY values.
    Please give me idea how I can read this trip activity value in to my user exit.
    I have written the below code for user exit.
    CHECK SY-TCODE EQ 'PR01'.
    MOVE TRIP_HEADER TO IT_PTRV_HEAD.
    APPEND IT_PTRV_HEAD.
    CHECK SY-TCODE EQ 'PR01'.
    MOVE TRIP_HEADER TO IT_PTRV_HEAD.
    APPEND IT_PTRV_HEAD.
    Thanks & Regards
    Sameera

    Hi,
    Try to use Enhancement  FITR0003.
    REWARD IF USEFUL

  • How to get the current month value for a customer exit variable?

    How to get the current month value for a customer exit variable? 
    And also if we have an InfoObject with date value (including date, month, year), then how to derive the month value from this date type of Char.?
    Thanks!

    Hi Kevin,
    Check here........
    Re: Customer Exist for "From Current Date To Month End"
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/25d98cf6-0d01-0010-0e9b-edcd4597335a
    Cal month
    Regards,
    Vijay.

  • How to get the latest procured value of a spare updated in material master

    How to get the latest procured value of a spare updated in material master

    J S S PRASAD
    See table MBEW via transaction SE16.
    However, you may need to look at the last PO created for that material.
    PeteA

  • How to get the anchor tag values in next jsp

    Hey all,
    I have two jsp files.
    in first jsp,
    I am getting the resultset.
    I am setting the resultset to the anchor tag.
    below is the code...
    <a target="_top" rel="contents" rev="contents" class="fordynamiclabel" href="ASCMasterTwo.jsp"><%=rSet.getString(1) %></a></td>
    whenever he click on any anchor tag,
    It will goes to ACSMasterTwo.jsp page for edit the compleate record.
    how to get the anchor tag value in that page...
    Please help me on this.

    You have to pass a parameter. An id is good.
    Of course you have to get an id from somewhere in the result set right?
    <a target="_top" rel="contents" rev="contents" class="fordynamiclabel" href="ASCMasterTwo.jsp?id=<%= rSet.getString("id") %>"><%=rSet.getString(1) %></a></td>Then you call
    request.getParameter("id");
    and look up the values related to that id in the database.

  • How to get the previous record value in the current record plz help me...

    In my sql how to get the previous record value...
    in table i m having the field called Date i want find the difference b/w 2nd record date value with first record date... plz any one help me to know this i m waiting for ur reply....
    Thanx in Advance
    with regards
    kotresh

    First of this not hte mysql or database forum so don;t repeate again.
    to get diff between two date in mysql use date_format() to convert them to date if they r not date type
    then use - (minus)to get diff.

  • VS2013 / Team Explorer vsix - How to get the currently selected build definition?

    Greetings,
    My goal with a simple extension is to right-click any build definition and if my "Show Build Def Stats" menu item is selected, pop a message box with some summary details I plan to pull from the IBuildDefinition interface.
    I'm missing something fundamental I'm sure, but I cannot figure out how in the menu handler the actual build definition that I clicked on.
    The menu command is added where I want it successfully:
    Symbol info used to get this there:
        <!-- This is the Build Definition Context Menu -->
        <GuidSymbol name="guidTeamExplorerBuildDefContextMenu" value="{34586048-8400-472E-BBBF-3AE30AF8046E}" >
          <IDSymbol name="menuBuildDefinitionContext" value="0x109"/>
        </GuidSymbol>
    I am stumped as to how to get the fact that I clicked the "ISRepository" build definition in either the Initialize() or MenuItemCallBack() methods, I haven't come across the right service or container object that I recognize.
    Much obliged!
    --Jordan

    I have been investigating this for a while using .NET Reflector and finally I got it:
    In VS 2013, add references to the following assemblies in the folder C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer:
    Microsoft.TeamFoundation.Controls.dll
    Microsoft.TeamFoundation.Build.Controls.dl
    And then use this code:
    Microsoft.TeamFoundation.Controls.ITeamExplorer teamExplorer;
    Microsoft.TeamFoundation.Controls.ITeamExplorerPage teamExplorerPage;
    Microsoft.TeamFoundation.Build.Controls.Extensibility.IBuildsPageExt buildsPageExt;
    teamExplorer = base.GetService(typeof(Microsoft.TeamFoundation.Controls.ITeamExplorer)) as Microsoft.TeamFoundation.Controls.ITeamExplorer;
    teamExplorerPage = teamExplorer.CurrentPage;
    buildsPageExt = teamExplorerPage.GetExtensibilityService(typeof(Microsoft.TeamFoundation.Build.Controls.Extensibility.IBuildsPageExt)) as Microsoft.TeamFoundation.Build.Controls.Extensibility.IBuildsPageExt;
    foreach (Microsoft.TeamFoundation.Build.Controls.Extensibility.IDefinitionModel definitionModel in buildsPageExt.SelectedDefinitions)
    System.Windows.Forms.MessageBox.Show(definitionModel.Name);
    * My new blog about VSX: http://www.visualstudioextensibility.com * Twitter: https://twitter.com/VSExtensibility * MZ-Tools productivity extension for Visual Studio: http://www.mztools.com.

  • Getting the last selected value of the combo  - very very urgent...........

    On my panel i have a jcombobox in upper half(which displays say the address type.) and few text fields on the lower half(which displays the add details). when the user selects a value in the combo box the text fields are populated based on the selection. The user can change the values displayed in the text fields. So before setting the new values in the text fields the last displayed values need to be saved.
    I have an ActionListener for my combo which gives me the currently selected value by calling getSelecetdItem()
    How can i get the last selcted value of the combobox without using any variable of my own.

    To update the last displayed details(the address details say) i need to check what type of address the combo had previousely.....
    when i display the panel first time the home address is set by default and i have a variable to hold this value..as the user changes the selection i update the variable...I don't want to use this variable..instead if i can get the last selcted value from the event that would be great...
    thanks

  • How to get the table of value field? and can we expand the technical limits

    Dear
    I have created value field in COPA with KEA6. And now, I need the table which the value fields are saved. Yet, I have tried a lot to find it and get failure? Can any guy help me? Please tell me how to get the table of a value field.
    And another question is that, can we extend the technical limits for the number of value field for ECC6.0?
    We have a note for R.4.x Please see below:
    OSS note 160892
    You can display the length of a data record using Transaction KEA0 ('Maintain Operating Concern'). After you have navigated to the 'Characteristics Screen' or to the 'Value field Screen' choose menu path 'Extras -> Technical Limits'.
    The maximum displayed here under 'Length in bytes on the DB' is the maximum length permitted by the Dictionary. The reserve required for the release upgrade must be subtracted from this value.
    To increase the allowed number of the value fields, increase the value that is assigned to field ikcge-bas_max_cnt (FORM init_ikcge_ke USING fm_subrc, approx. line 165) in Include FKCGNF20. It specifies the number of the possible value fields. The corresponding part of the source code is attached to the note as a correction.
    David Sun
    Regards!

    how to extend the limit of value numbers? please see the original question.

  • How to get the list of values for a dynamic parameter using Web Services SDK?

    <p>I am struggling to get the list of values for a dynamic parameter of a report.</p><p>I am using Java Web Services SDK ... I tried to use PromptInfo.getLOV().getValues() method but it does not work.</p><p>First of all ... is this possible (to get the list of values for a dynamic param) using Web Services?</p><p>Second of all, if this is possible, how should I do it ... it seems it works fine when running the report from CMC. It asks for DB logon info and after that it provides a list of values.</p><p>Thx </p>

    <p>Your assumption is correct. We are trying to get the LOVs from the Crystal Report. I was not aware that this is not supported by Web Services SDK.</p><p>We used Web Services SDK to integrated the Crystal Reports in our web application. We implemented some basic actions for reports: schedule, view instances, run ad-hoc reports.</p><p>We encountered this problem when trying to run/schedule reports with dynamic parameters (a list of values from DB). We were unable to get the LOVs.</p><p>Please let me know if you can think of an alternative to look at.</p><p>Thanks a lot,</p><p>Catalin </p>

  • How to get the URL parameter value when navigating from JSP Page to portal

    Hi All,
    I have web Dynpro application with one button, while clicking that button It will navigate to JSP page as external window. In the JSP page I have a input field and Button.
    In the JSP page input field I will enter some values and press submit button, it will navigate to Portal page by passing some URL parameter with values.
    Once user entering to portal by default WD page displayed, the same WD page I try to get the URL Parameter which I have passed from JSP page, but I am not able to get the URL parameter value.
    If same application running in without portal, I can able to get the URL parameter values. I am getting the URL parameter by interface view default inbound plug parameter.
    How do we resolve this problem?
    Regards,
    Boopathi M

    Hi
    Please try  these link might helpful for you
    1.[How to call WebDynPro application from JSP |/thread/452762 [original link is broken];
    2.[How to get the previous page url from abstract portal component? |/thread/1289256 [original link is broken];
    3.[how to launch and pass a parameter |/thread/5537 [original link is broken];
    Best Regards
    Satish Kumar

  • How to get the 'text' property value of a button in coding?

    Hi Experts,
    I'm using 10 buttons all are having common action('click'). when i click a button the 'text' value of the button should pass to a function.So the action is same but the passed value will be the 'text' value of the corresponding button.  I don't know how to get the 'text' property of a button in coding. Kindly help me to solve this problem.
    Thanks and Regards
    Basheer

    Hi,
    My event is like this.
    public void onActionclick(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
         String s =  ?  ; // should get the 'text' property of clicked button
         fillInput(s);     // function to be called
    The called function is,
    public void fillInput( java.lang.String id )
        String str=wdContext.currentContextElement().getNum();
        str = str + id;
        wdContext.currentContextElement().setNum(str);
    How can i get the 'text' property value of the corresponding button. Click action should be common to all buttons.
    Thanks and Regards,
    Basheer

Maybe you are looking for

  • Mac Mini Won't Boot with VGA Monitor Connected

    I have a new Mac Mini connected to an older VGA monitor using the Apple brand VGA adapter.  The mini is fully up to date and runs perfectly when booted.  However, if I reboot the mini with the VGA monitor connected, it fails to boot.  I just hear the

  • Help needed - XML forms not displaying in my repository

    Hi all I could really do with some help here.  I have a custom XML form for news articles.  It works fine in the standard documents repository, but I have my iView pointing to a folder in my own CM repository. When a user tries to directly access the

  • Project 2010 Calendar not working as expected

    I have created a custom 9/80 working calendar for our company.  We work Monday - Friday 7am to 12pm, 12:30 to 4:30 with every other Friday off.  I have assigned this calendar to the Project File and even indicated under File, Options that the standar

  • BizTalk WCF-WebHttp Custom Headers per message

    Hi, I have a requirement to connect to a service using the WCF-WebHTTP adapter that requires add custom http Header "X-Auth: <Value varies for messageType>" per message. So am using dynamic Request-Response port to set HTTPHeaders dynamically per mes

  • 7-zip SSIS task run with SQL agent gives "This operation requires an interactive window station" error.

    I have set up the 7-zip parameters to not require a response, and the process task object to have a "hidden" window.  This is also running with a proxy on the SQL agent.  Is there some other proxy setting, or package or job setting that needs to be d