How to set item #2 in a JCombobox as selected default ?

JCombobox always set item #1 as default.
How to set item #2 or #3 or another # (except #1) as selected default ?

hey,
there is a method called setSelectedIndex(int index)
pass the index which u want to get selected by default.
Call this method after loading the data to the comboBox
for ex cbo.setSelectedIndex(1);
Hope this helps
Nagaraj

Similar Messages

  • How to Set Item limit for Picture library Slideshow webpart in SharePoint 2013

    Picture library Slideshow webpart is using the default view "All Pictures" and if I set a filter condition in the view, the images are displaying based on it but if I set an Item limit as "5" or any number in the "All Pictures"
    view it is not reflecting in the slideshow webpart.
    Any suggestion would be a great help as the users want to see only the latest 5 images in the slideshow webpart.
    Thanks & regards,
    Asha

    I don't think so there is any way to set a item count limit on Picture Library Slideshow web wart.
    Web Part setting only allows to provide library and View, In List view also you can only set Item Limit to be shown on the 'List View'. Slideshow web part take all the items in the list and show, view is only used to provide which field needs to be shown.
    There could be 2 options:
    - Write a JavaScript to limit the count, and in the view add Sorting by 'Created' date. You can get some example on how to modify "Library Slideshow web part" javascript here: http://blog.vgrem.com/2013/04/27/beyond-the-slideshow-web-part-capabilities-in-sharepoint-2010/
     This link does not have solution of what you want, but it gives a very well idea on what you can look and modify. It will not be that straight forward for sure.
     - Create a custom webpart, it could be a easier approach. As there are many slideshow Javascript library present, and through code you will just need do a query and pull data from library with required number of items to be shown.
    get2pallav
    Please click "Propose As Answer" if this post solves your problem or "Vote As Helpful" if this post has been useful to you.

  • How to set input ready query to display mode as default when open workbook?

    Dear All,
    Hi, i have a question here about IP query.
    as my current situation, my workbook included one input ready query, therefore, when i open my workbook which default is Edit mode which mean all value can be edited.
    but, i want it to display mode when open workbook, and i already have a edit button, if i want to edit the value i will use Edit button, so, i wan it as display mode when i first open workbook.
    so, can anyone tell me how to set it as display mode when open workbook which included input ready query?
    Regards
    wenlong
    Thanks a million

    in Data Provide Specfici  commad
    Edit
    Dsiplay
    Filter command
    Assigen Query /Query view
    pls select Edit then save

  • How to set a dynamic variant for date in select-options in the upper field

    Hi  Variant experts Good Evening!
           I have the following problem while setting up a dynamic varinat .
    Ex: select-options: dat for sy-datum.  
    I am able to save the lower limit as a dynamic value but not able to save the upper values as dynamic in the select-options. Could any of you please help me in this.
    Regards
    Ravi.

    i hope dynamic variant concept is not there,
    but u can use the fn module DYPRO_GET_VALUES  and
    DYNPRO_SET_VALUES
    DYNPRO_GET_VALUES gets the values in the screen,
    DYNPRO_SET VALUES sets the values.
    first get the values, compare and set the values as u want

  • How to set some line in ALV-OO as selected

    Hi,
    i use ALV-OO and will set some outputlines before first output as selected.
    Example:
    i have an output of 10 line. I will set line 2, 6, and 9 with default as selected because some valuy is greater as 1000.
    I will set it befaore the first output. Is this possible?
    Regards, Dieter

    Hi Himanshu,
    i have tested it and first it works like i want.
    But in second way i think in our case it's better to take editory checkboxes.
    Thanks for answer.
    Regards, Dieter

  • How to set item level permission for list item in SharePoint 2013

    Hi we had a custom List "ABC".
    List had 2 columns:
    Project Name: (P1, P2, P3, P4, P5, P6)
    Project Leads: (PL1, PL2, PL3, PL4, PL5, PL6).
    All project Leads can have permission to edit only their Project (P1, P2, P3) like
    PL1 can edit P1
    PL2 Can edit P2.....
    But my Question is how to restrict PL2 cannot have permission to edit P1
    is it possible to set permission for this through OOTB in SharePoint 2013.
    Any help will be appreciated......

    Hi
    check this similar post
    http://social.technet.microsoft.com/Forums/ro-RO/e1ea3655-0c6f-4b3d-a336-c42e8eb54c09/rights-to-edit-own-items-for-list-residing-on-publishing-site?forum=sharepointdevelopmentprevious
    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

  • How to set item values without using fields in branch's ACTION block?

    Okay, I will try to say this in a easy way so it is not weird.
    I have created a button, SAVE, that has a Branch of branch type: Branch To Function Returning A Page. This is my code for the branch:
    if :P2008_NAP_SUPPORTING_MATERIALS = 'Yes' then
    return '2092';
    else
    return '2040';
    end if;
    The code for this type of branch is stored in the ACTION block of the Branch page. The ACTION block for a Branch of branch type: Branch To Function Returning A Page is different than the ACTION block for a Branch of branch type: Branch To Page Or URL.
    I need to set some item values with some specific values, which I can do with a branch type: Branch To Page Or URL. This is not possible with the branch type: Branch To Function Returning A Page. The ACTION block is totally different.
    How can I set some values on say Page 2040 from Page 2008 without using fields in the branch's ACTION block?
    Thank you in advance,
    Maggie

    Andy and Scott,
    I love seeing different perspectives in solving problems, it opens my eyes to new ways of looking at/using the tools (reserved words and 'Function returning a Page', etc.).
    One of my pet peeves has been that on branches I was limited to only 10 variables to be passed (I know, who would want more - but there was an instance where I had to pass more), and an even more frustrating time when using report Column Linking, which limits me to 3 variables.
    At least with the Branch linking I can use your suggestion Andy and add the variable setting statements into the function. I am assuming of course (and I should be able to) that I will be able to set more that 10 variables in a IF condition prior to the RETURN statement. This method will be much more understandable, for me, when looking through the branch at a later time to see what is happening, than an URL link where all the variable are strung out 'in a line' so to speak.
    I will still need to use URL Target branching on Links contained within a Column Attribute when I need to pass more than 3 variables, of which I have several places where I do this.
    Thomas

  • How to set item values when redirecting to the same page.

    I just created a redirect button that I want to redirect to the same page and set the 2 page items on the page to the same value they had before the redirect.
    But I can't write:
    Set These Items: P1_Permit_Number,P1_Fishing_Year
    With These Values: &P1_Permit_Number.,&P1_Fishing_Year.
    Because there are no values in the session state, since a submit has not been done.
    So how do I do this?
    I know how to get the values stored in the items, e.g., $v('P1_PERMIT_NUMBER')
    but where do I place that command? It's not allowed under "With These Values"
    And I don't really want to make this a submit button and create a process that says:
    P1_PERMIT_NUMBER := $v('P1_PERMIT_NUMBER') because that would complicate the page too much -- I already have other processes and branches on the pages whose conditions would have to be modified so that they don't run during this scenario.
    Thanks.

    Thanks Gary and Andy. I rewrote the function according to above instructions:
    function redirectToURL()
    var permitNumber = document.getElementById('P1_Permit_Number');
    var fishingYear = document.getElementById('P1_Fishing_Year');
    var url = 'f?p=&APP_ID.:1:&APP_SESSION.::::P1_Permit_Number,P1_Fishing_Year:' + permitNumber +',' + fishingYear;
    window.location.href = url;
    But when I entered a value for permit number and fishing year and redirected, the word "null" appeared in the Permit page item, instead of the permit number that I had entered.
    Remember that I am not submitting here. So if the syntax you showed me, i.e. getElementById('P1_Permit_Number'), searches for the item's session state, then it will be wrong, since there is no session state value for the items at this point. Perhaps that is the reason I got the null?
    If so, what can I do?

  • HOW TO SET ITEM MASTER IN ITEM GROUP AUTHORIZATION

    Hello,
    Using Sap Business One 2007 B how to solve this item master authorization issue.
    Kind regards,
    Karunagaranjanani.

    Hi,
    Try this,
    Create 1 Mendatory UDF field in Item Master Header.
    ->> Choose Tools on menu bar.
    ->> User Defined fields. -> Manager User Fields.
    ->> Open the Manager User Fields Window.
    ->> Master Data.
    ->> Items. -> Items.
    and Click Add button in bottom right then add the UDF Title & Description.
    put the Tick mark of Set Default value for Field and put the value of 0.
    then, put the Tick mark of Mendatory Value and add the UDF.
    Assign the below FMS in UDF.
    ->> Open the Item Master and ShiftAltF2 in UDF then put the Saved Query.
    put the Tick mark of AutoRefresh and select the Item Group,
    put the Tick mark of Display saved values.
    Try assign the below FMS in UDF(Mendatory field).
    for example: Item Group -> (100) -> Item.
    Item Group -> (101) -> Accessories. Item Group -> (102) -> Hardware.
    USer sign 1 -> Manager. USer sign 2 -> Admin.
    SELECT ' ' FROM OITM T0
    WHERE
    $[OITM.ItmsGrpCod] in ('100', '101', '102')
    AND
    $[OITM.UserSign] in ('1', '2', '3')
    Regards,
    Madhan.

  • How to set item via URL only when that item is null

    From application A, I am attempting to set an application-level item of Application B via the URL to Application B. I only want the application-level item of Application B to be set when it the item is null. If it is not null, I don't want the application-level item to be set to something else.
    I can't think of a way to do this from within Application B after the URL takes the user to Application B and I can't think of a way to do it from within Application A before the URL is invoked. The URL in Application A is part of a List (Shared Component) so it is not clear to me how to use PL/SQL to dynamically tell the URL to include or not include the assignment of the application-level item in the URL call.
    Am I missing something obvious?

    You could pass the value into a different item in application B. A before-header page process in the target page could then perform the transfer of the sent item into another item if that other item is null.
    Scott

  • How to set item focus from javascript

    Hi all,
    i need to validate a form item with javascript to check required fields.
    The function is :
    function isRequired(field) {
    if ($v_IsEmpty(field)) {
    alert('The field is required!');
    html_GetElement(field).focus();
    return false;
    return true;
    Also in the form item attribute i added :
    onChange="isRequired(this);"
    If the filed is null, i see the alert but the focus is on the next item! How can i set the focus on the null item?
    Thanks,
    Sergio

    Denes, thanks for your answer.
    I tried
    html_GetElement($x(field).id).focus();
    but doesn't work.
    Also, if in the form item attribute i add
    onBlur="isRequired(this);"
    instead of
    onChange="isRequired(this);"
    the javascript works with both solution (html_GetElement(field).focus(); or html_GetElement($x(field).id).focus();) with IE7 but doens.t work with Firefox 3.0.1.
    Please help me, please
    Sergio

  • How to set the XML tree to be collapsed by default at run time?

    I am developing a simple software in Java, to improve my programming skills, the output of this program is an XML file. I am very new to XML. My question is that, every time the XML file is opened the tree is in expanded form, which appears to be the default setting at run time. I want it to be fully collapsed when the XML file is opened. I have read about certain solutions to this problem by using XSL or CSS. I am not familiar with XSL at the moment so I have not explored it yet. Is there any other way around this problem.
    I would like someone to just point me in the right direction so that I can eventually get to the answer.
    Any help will be highly appreciated.
    Thankyou

    Bscript wrote:
    My question is that, every time the XML file is opened the tree is in expanded form, which appears to be the default setting at run time. I want it to be fully collapsed when the XML file is opened. If you are asking to control the XML display in text editor when the XML is opened, I think you can't control it through the java. How the individual editor shows the XML is their property. For example, if you open the file in notepad, you may not get the pretty XML however if you open if the file in XML editor like XMLSpy, you may get its hierarchical representation.

  • How to set focus and mark red on certain select option field

    hi experts
    I embedded a select_option view in my application and  tried to use IF_WD_SELECT_OPTIONS->request_focus to set focus on a certain select option field if the logical check failed, and also hope the low field of the select option can be marked red....but things does not happen that way....
    could anyone kindly tell me how to implement that requirement?
    tkx and regards
    sun

    What is the problem you are facing in this ?
    Requesting focus is easy.
    just call the method request focus and pass the id of the parameter whose lower value field you want to focus.
    as shown below.
    code you might have written in wddoinit
    DATA: LT_RANGE_TABLE TYPE REF TO DATA,
            RT_RANGE_TABLE TYPE REF TO DATA,
            READ_ONLY TYPE ABAP_BOOL,
            TYPENAME TYPE STRING.
        DATA: LR_COMPONENTCONTROLLER TYPE REF TO IG_COMPONENTCONTROLLER,
            L_REF_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.
    *   * create the used component
      L_REF_CMP_USAGE = WD_THIS->WD_CPUSE_SELECT_OPTIONS( ).
      IF L_REF_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
        L_REF_CMP_USAGE->CREATE_COMPONENT( ).
      ENDIF.
        WD_THIS->M_WD_SELECT_OPTIONS = WD_THIS->WD_CPIFC_SELECT_OPTIONS( ).
        WD_THIS->M_HANDLER = WD_THIS->M_WD_SELECT_OPTIONS->INIT_SELECTION_SCREEN( ).
    LT_RANGE_TABLE = WD_THIS->M_HANDLER->CREATE_RANGE_TABLE( I_TYPENAME = 'ZDEALERID' ).
    * * add a new field to the selection
      WD_THIS->M_HANDLER->ADD_SELECTION_FIELD( I_ID = 'ID'
      IT_RESULT = LT_RANGE_TABLE I_READ_ONLY = READ_ONLY ).
    code for focusing a field.
    wd_this->m_handler->request_focus( i_id = 'ID' ).
    you must have declared attributes m_handler and m_wd_select_options type reffering to IF_WD_SELECT_OPTIONS and
    IWCI_WDR_SELECT_OPTIONS respectively.
    and regarding that red color i am not sure it is possible without using message manager.
    thanks
    sarbjeet

  • How to set "Avoid Aggregation on Duplication Rows" Checked by default?

    When users create new rows, How can we set the avoid Aggregation on duplicate rows set checked on ? Is there any parameter setting available in config files?
    thanks
    Raj

    Hi,
    To be fair, it's a pretty odd question in the first place.
    If you have an enhancement request, please feel free to submit it on the "ideas place" for webI: https://cw.sdn.sap.com/cw/community/ideas/businessanalytics/sbowebi
    regards,
    H

  • How to set a page template as an "application level default template"?

    Hi,
    For some reason, my default application level page template is not 'default' anymore. is there a way to set that? Thanks.

    See Home>Application Builder>Application 999999>Shared Components>Themes>Create / Edit
    Jeff

Maybe you are looking for

  • Apps don't work after update to 5.0.1

    after i update my ipod 4th gen from 4.3.5 to 5.0.1 the apps like angry birds don't work. it likes the app start by flash only one and then comes nothing. the screen show the start display.

  • "startup disk full" error message

    So, I get this error message saying "your startup disk is full: you need to make disk space available by deleting files" (or something along those lines). I went through my files, saved about 10 gigs of stuff to my external HD, then deleted it from m

  • BA and EC-PCA

    Hi sap guru's could you pls explain differnece between Business Area and Profit Center Accounting with an examples Thanks

  • Blocking and non-blocking workflows

    How to specify a workflow to be blocking and non-blocking? Regards, Miguel

  • Loading pl/sql scripts into OWB and running it

    Hi, Does anyone have an example for loading and executing PL/SQL Scripts in OWB?. Thanks Mehdi