How to add -Select- as the first value in dropdownbox?

Hi All,
I am having a dropdownbox with the set of values. I need to add -SELECT- as the first and default value. Please do advise how to achieve this.
Code and screenshot below.
var oModel = new sap.ui.model.odata.ODataModel("../../services/admin/typesTable.xsodata/", false);
var oSort = new sap.ui.model.Sorter("ID", false);
var lblType = new sap.ui.commons.Label();
lblType.setText("Type");
var ddbType = new sap.ui.commons.DropdownBox();
ddbType.setRequired(true);
var oItemTemplate = new sap.ui.core.ListItem();
oItemTemplate.bindProperty("text", "NAME");
oItemTemplate.bindProperty("key", "ID");
ddbType.setModel(oModel);
ddbType.bindItems("/TYPES", oItemTemplate, oSort);
lblType.setLabelFor(ddbType);
oChildLayout.createRow(lblType, ddbType);
Thanks in advance
Aravindh

Hi,
Refer this discussion on exact requirement empty/"all" entry in DropdownBox with OData model - cleanest solution
Regards,
Chandra

Similar Messages

  • How to add spaces to the column value to make it up specifi length string please

    Hello There,
    Could you please guide me here to solve this issue,
    in my column (named as State) contains values as below
    California
    Washington
    Utah
    Connecticut
    Massachusets
    in the output how can i add a spaces to make up every column values as 15 length (for ex, Utah is 4 length then need to add 11 spaces, California is 10 would like to add 5 spaces)
    i tried below but no use in Sql 2008 R2
    SELECT  distinct state
       state
    +SPACE(35-len(state)),
    len(state+SPACE(35-len(state)))
    FROM dbo.ordersInfo
    Thank you in advance
    Milan

    Fixed length CHAR(n) data in SQL is automatically padded with spaces. Either change the column's data type or cast to it. Also, the ISO-11179 rules are that the column should be "state_name" and not just the root attribute "state" -- state_code, state_population,
    etc are a few of the confusions you created. 
    Another rule of RDBMS is that we do not do display formatting in the data. That is what presentation layers do. Why are you trying to fake COBOL in SQL? 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • How can I reduce the selection for the characteristics value in a BW query

    Good morning,
    I need to find out how I can reduce the selection for the characteristics values in a BW query.
    In a BW query I have a characteristic "Due month".
    The characteristic values shown in the query are from 01.2001->03.2007. I would like to reduce it to the last 2 years,in the query view,  without deleting the data for the other years in the cube.
    Do you know how this can be done?
    Thank you in advance for your feedback.
    Kind regards,
    Linda Verding
    Staff Consultant - CSC

    hi,
    First thing you have to do is check the report how the data is being restricted only to those months.
    1) one it can be variable in which the code is written for that to populate for last few years.
    or else it must have been hardcoded for these months.
    Go into your report and underneath the characteristicsCALMONTH there must be an variable or hardcoding.
    You need to change this here in the report.
    You dont have to delete anything there.
    Regards, Siva

  • I am unable to add contacts with their phone numbers. I add one press done and then it shows up but when I add another one the first one is deleted. How can I add them and make sure they stay.  Upper left hand corner there is partial circle w/ arrow

    I Unable to add contacts. I add one and then press done.  It shows up but after I add another one the first one is gone.  How do I save them?

    Hi,
    Troubleshooting a start up script can be difficult. There are some third party programs that also keep logs of start up programs, however for Firefox this may be different.
    Is Firefox a startup program? [http://www.winxptutor.com/msinfo32.htm]
    Its also possible to check the Web developer tools for any scripts in a page: [https://developer.mozilla.org/en-US/docs/Tools/Debugger]
    In the control panel there is also Administrative tools to view event logs, but this may be something a local technician can walk you through.

  • In itunes how to add selected groups

    in itunes how to add selected groups

    BalusC wrote:
    You're placing an array of all values into single SelectItem instead of creating a new SelectItem for each value of the array.With other words: you should not place all values in one SelectItem. You should create a new SelectItem for each value of the array.

  • Setting the JComboBox to the first value

    Hi ,
    I have a JComboBox in a one of the table columns. My UI is in a seperate class and the model is in a seperate class. I cannot define the JComboBox as any other specifier than private in the UI. I have added a defaultCellEditor to the combo.
    Now my table model will have the setValue. My table model is in a seperate class. My parent UI frame object is being passed to it. What I want to do is everytime a value is selected , after the selection next time I click on the combo the fisrt value appears selected.
    Secondly if I click on the dropdown option and click else where then the first value gets selected and my setValue for the cell never gets called. Is there any way I can avoid that.
    Regards,
    Anand

    Hi Ananth,
    Thank yo for your reply.
    This is how my code below looks like after I applied your solution and I got the error. (See below)
    <?if:(sum(current-group()/NUMINCOMPLETE)!=0 And (xdoxslt:get_variable($_XDOCTX,’vTotalE’)!=0?>(sum(current-group()/NUMINCOMPLETE))div(xdoxslt:get_variable($_XDOCTX,’vTotalE’))*100<?end if?>
    I think its a syntax error only. Can you help me again organize this one?
    Error:
    FOProcessor setLocale: en-us
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.invokeNewXSLStylesheet(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLTWrapper.transform(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.createFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.generate(Unknown Source)
         at RTF2PDF.runRTFto(RTF2PDF.java:629)
         at RTF2PDF.runXDO(RTF2PDF.java:439)
         at RTF2PDF.main(RTF2PDF.java:289)
    Caused by: oracle.xdo.parser.v2.XPathException: Expected ')' instead of ' And '.
         at oracle.xdo.parser.v2.XSLProcessor.reportException(XSLProcessor.java:806)
         at oracle.xdo.parser.v2.XSLProcessor.newXSLStylesheet(XSLProcessor.java:571)
    Thanks Much.
    JP
    Edited by: BIPnewbie on Feb 10, 2012 4:00 AM

  • SelectOneChoice - showing the first value as the default?

    Using a selectOneChoice, how do you get the first value to show in the form as the default? It always displays a blank item when the form first comes up. I don't want the user to have to select a value for the defaults. I have 'selection required' on.
    --------- .jspx page ------------
    <af:selectOneChoice value="#{bindings.View1country.inputValue}".....>
    <f:selectItems value="#{bindings.View1country.items}"/>
    </af:selectOneChoice>
    -------- pagedef xml ---------------
    <list id="View1country" IterBinding="View1Iterator"
    ListOperMode="0" StaticList="true">
    <AttrNames>
    <Item Value="country"/>
    </AttrNames>
    <ValueList>
    <Item Value="United States"/>
    <Item Value="Canada"/>
    </ValueList>
    </list>

    thanks - I am using ADF BC read-only view objects, but I don't see anywhere to define the selection on the VO properties? I defined the list on the front-end .jspx page by adding a selectOneChoice and defining its properties.

  • How to add spaces at the end of record

    Hi Friends,
    i am creating a file which contains more than 100 records.
    In ABAP i have internal table with on field(135) type c.
    some time record have length 120, somtime 130 its vary on each record.
    but i would like to add space at the end of each record till 135 length.
    Can you please help me how to add speace at the end of record.
    regards
    Malik

    So why did you said that in your first posting? My glass sphere is out for cleaning...
    Instead of type c use strings and add spaces until they have the appropriate length.
    loop at outtab assigning <pout>.
      while strlen( <pout>-val ) < 135.
        concatenate <pout>-val `` into <pout>-val.
      endwhile.
    endloop.

  • How to dynamic select based on runtime value ?

    how to dynamic select based on runtime value ?
    I want to write a select function, which do selecting based on parameters. eg,
    CREATE OR REPLACE FUNCTION myfunction
    (tableName VARCHAR2, pkName VARCHAR2, pkValue VARCHAR2, requestString VARCHAR2)
    RETURN VARCHAR2 AS
    BEGIN
    select requestString from tableName where pkName=pkValue;
    RETURN NULL;
    END;
    myfunction('users', 'user_id', '100', 'user_name'); it will select 'user_name' from table 'users' where 'user_id' = '100'.
    This way could save lots of coding. but it can't pass compiler. how to work out ?
    Thanks.

    While this may save code, if used frequently it will be ineffecient as all [explicative deleted]. The danger is that it would be used even for repeatable statements.
    This mode of operation ensures that every statement [calling the funciton] needs to be reparsed, which is extremely expensive in Oracle (in CPU cycles, recursive SQL and shared pool memory).
    Such reparsing is rarely a good thing for the environment ... it could easily lead to buying more CPU (bigger box) and therefore adding more Oracle license ... which could quickly exceed the typical developer's salary.
    However - if you really, really want to do this, look up 'execute immendiate' in the PL/SQL manuals.

  • Reg:How to add fields to the scripts in detail

    How to add fields to the scripts in detail.
    Plz give me one example help me out.

    Hi
    add fields to the scripts by sending that field between  two &s.
    for example if u want to add lifnr of lfa1 table then pass field like this.
    &wa_lfa1-lifnr&.here wa_lfa1 is work area for internal table it_lfa1.
    if name1 then &wa_lfa1-name1&
    in this way you can add fields to the script under any window.
    i am sending one example program for scripts.
    &--structure declaration--
    TYPES:BEGIN OF ST_LFA1,
          LIFNR TYPE LFA1-LIFNR,
          NAME1 TYPE LFA1-NAME1,
          LAND1 TYPE LFA1-LAND1,
          ORT01 TYPE ORT01,
          REGIO TYPE REGIO,
          END OF ST_LFA1.
    TYPES:BEGIN OF ST_EKKO,
          EBELN TYPE EKKO-EBELN,
          BUKRS TYPE EKKO-BUKRS,
          AEDAT TYPE EKKO-AEDAT,
          ERNAM TYPE EKKO-ERNAM,
          BSTYP TYPE EKKO-BSTYP,
          LIFNR TYPE EKKO-LIFNR,
          END OF ST_EKKO.
    TYPES:BEGIN OF ST_EKPO,
          EBELN TYPE EKPO-EBELN,
          EBELP TYPE EKPO-EBELP,
          LOEKZ TYPE EKPO-LOEKZ,
          AEDAT TYPE EKPO-AEDAT,
          MATNR TYPE EKPO-MATNR,
          NETWR TYPE EKPO-NETWR,
          END OF ST_EKPO.
    &--internal table,work area declaration--
    DATA:WA_LFA1 TYPE ST_LFA1,
         IT_LFA1 TYPE STANDARD TABLE OF ST_LFA1,
         WA_EKKO TYPE ST_EKKO,
         IT_EKKO TYPE STANDARD TABLE OF ST_EKKO,
         WA_EKPO TYPE ST_EKPO,
         IT_EKPO TYPE STANDARD TABLE OF ST_EKPO.
    &--data declaration--
    DATA:TOTAL TYPE EKPO-NETWR,
          V_EBELN TYPE EKKO-EBELN.
    data: v_item(20) type c.
    &--parameter for purchase document number--
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS P_PURDOC LIKE V_EBELN.
    SELECTION-SCREEN END OF BLOCK B1.
    START-OF-SELECTION.
      PERFORM GET_DATA_FROM_EKKO.
      PERFORM GET_DATA_FROM_LFA1.
      PERFORM GET_DATA_FROM_EKPO.
    &--grand total--
      LOOP AT IT_EKPO INTO WA_EKPO.
        TOTAL = TOTAL + WA_EKPO-NETWR.
        CLEAR WA_EKPO.
      ENDLOOP.
    &--open form--
      CALL FUNCTION 'OPEN_FORM'
       EXPORTING
        DEVICE                            = 'PRINTER'
        FORM                              = 'Z_50886_VENDOR'
        LANGUAGE                          = SY-LANGU
       EXCEPTIONS
         CANCELED                          = 1
         DEVICE                            = 2
         FORM                              = 3
         OPTIONS                           = 4
         UNCLOSED                          = 5
         MAIL_OPTIONS                      = 6
         ARCHIVE_ERROR                     = 7
         INVALID_FAX_NUMBER                = 8
         MORE_PARAMS_NEEDED_IN_BATCH       = 9
         SPOOL_ERROR                       = 10
         CODEPAGE                          = 11
         OTHERS                            = 12
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    &--write form for header details--
      READ TABLE IT_EKKO INTO WA_EKKO INDEX 1.
      CALL FUNCTION 'WRITE_FORM'
       EXPORTING
         ELEMENT                        = 'HEAD'
         WINDOW                         = 'HEADER'
       EXCEPTIONS
         ELEMENT                        = 1
         FUNCTION                       = 2
         TYPE                           = 3
         UNOPENED                       = 4
         UNSTARTED                      = 5
         WINDOW                         = 6
         BAD_PAGEFORMAT_FOR_PRINT       = 7
         SPOOL_ERROR                    = 8
         CODEPAGE                       = 9
         OTHERS                         = 10
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    &--write form for item details--
      LOOP AT IT_EKPO INTO WA_EKPO.
      concatenate wa_ekko-ebeln wa_ekpo-ebelp into v_item.
        CALL FUNCTION 'WRITE_FORM'
         EXPORTING
           ELEMENT                        = 'ITEM'
           WINDOW                         = 'MAIN'
    EXCEPTIONS
       ELEMENT                        = 1
       FUNCTION                       = 2
       TYPE                           = 3
       UNOPENED                       = 4
       UNSTARTED                      = 5
       WINDOW                         = 6
       BAD_PAGEFORMAT_FOR_PRINT       = 7
       SPOOL_ERROR                    = 8
       CODEPAGE                       = 9
       OTHERS                         = 10
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDLOOP.
    &--write form for vendor details--
      READ TABLE IT_LFA1 INTO WA_LFA1 INDEX 1.
      CALL FUNCTION 'WRITE_FORM'
       EXPORTING
         ELEMENT                        = 'VENDOR'
         WINDOW                         = 'ADDRESS'
       EXCEPTIONS
         ELEMENT                        = 1
         FUNCTION                       = 2
         TYPE                           = 3
         UNOPENED                       = 4
         UNSTARTED                      = 5
         WINDOW                         = 6
         BAD_PAGEFORMAT_FOR_PRINT       = 7
         SPOOL_ERROR                    = 8
         CODEPAGE                       = 9
         OTHERS                         = 10.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    &--write form for grand total--
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
        WINDOW                         = 'TOTAL'
    EXCEPTIONS
       ELEMENT                        = 1
       FUNCTION                       = 2
       TYPE                           = 3
       UNOPENED                       = 4
       UNSTARTED                      = 5
       WINDOW                         = 6
       BAD_PAGEFORMAT_FOR_PRINT       = 7
       SPOOL_ERROR                    = 8
       CODEPAGE                       = 9
       OTHERS                         = 10
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    &--close form--
      CALL FUNCTION 'CLOSE_FORM'
       EXCEPTIONS
         UNOPENED                       = 1
         BAD_PAGEFORMAT_FOR_PRINT       = 2
         SEND_ERROR                     = 3
         SPOOL_ERROR                    = 4
         CODEPAGE                       = 5
         OTHERS                         = 6
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *&      Form  get_data_from_ekko
    FORM GET_DATA_FROM_EKKO .
      SELECT EBELN
             BUKRS
             AEDAT
             ERNAM
             BSTYP
             LIFNR
          FROM EKKO INTO TABLE IT_EKKO WHERE EBELN = P_PURDOC.
    ENDFORM.                    " get_data_from_ekko
    *&      Form  get_data_from_lfa1
    FORM GET_DATA_FROM_LFA1 .
      IF NOT IT_EKKO[] IS INITIAL.
        SELECT LIFNR
               NAME1
               LAND1
               ORT01
               REGIO
               FROM LFA1 INTO TABLE IT_LFA1 FOR ALL ENTRIES IN IT_EKKO WHERE
                    LIFNR = IT_EKKO-LIFNR.
      ENDIF.
    ENDFORM.                    " get_data_from_lfa1
    *&      Form  get_data_from_ekpo
    FORM GET_DATA_FROM_EKPO .
      IF NOT IT_EKKO[] IS INITIAL.
        SELECT EBELN
               EBELP
               LOEKZ
               AEDAT
               MATNR
               NETWR
               FROM EKPO INTO TABLE IT_EKPO
               WHERE EBELN = P_PURDOC.
      ENDIF.
    ENDFORM.                    " get_data_from_ekpo

  • How to add subpartitions to the existing subpartition template

    Hi All,
    My Question is ,how to add Subpartition to the exiting subpartition template. e
    like i have created a table with subpartition template with with 5 subpartitions like
    subpartiton one_1 value (121)
    subpartition two_2 value(122)
    and now i one to add one more subpartitin to the existing subpartition template(Like modify the existing subpartition templete).
    subpartition three_3 value(123)
    Could any suggest me.
    Thanks
    Sree

    >
    My Question is ,how to add Subpartition to the exiting subpartition template.
    >
    Follow the example in the section for 'Modifying a Subpartition Template' in the VLDB and Partitioning Guide
    http://docs.oracle.com/cd/E11882_01/server.112/e25523/part_admin002.htm#i1007904
    >
    You can modify a subpartition template of a composite partitioned table by replacing it with a new subpartition template. Any subsequent operations that use the subpartition template (such as ADD PARTITION or MERGE PARTITIONS) now use the new subpartition template. Existing subpartitions remain unchanged.
    If you modify a subpartition template of an interval-* composite partitioned table, then interval partitions that have not yet been created use the new subpartition template.
    Use the ALTER TABLE ... SET SUBPARTITION TEMPLATE statement to specify a new subpartition template. For example:
    ALTER TABLE emp_sub_template
    SET SUBPARTITION TEMPLATE
    (SUBPARTITION e TABLESPACE ts1,
    SUBPARTITION f TABLESPACE ts2,
    SUBPARTITION g TABLESPACE ts3,
    SUBPARTITION h TABLESPACE ts4

  • How can I select only the music I want on my iPhone without putting all of it on?

    How can I select only the music I want on my iPhone without putting alll of it on my phone?

    http://support.apple.com/kb/PH12313

  • How to do selection of the Matt Black/ Photo Black in the print setup of Acrobat Pro (for an Epson 7890).

    How to do selection of the Matt Black/ Photo Black in the print setup of Acrobat Pro (for an Epson 7890) ? Selection of the media ?

    Acrobat's print dialog doesn't deal with hardware-specific features, for that you have to click on the "Properties" button next to the dropdown printer selection field.

  • How stop PS6 from removing the DPI value from an image when using "save for the web"?

    How stop PS6 from removing the DPI-value from an image when using "save for the web"?
    Example:
    - Open a tif image, that contains a dpi value (resolution).
    - Use the splice tool in PS6.
    - Export the slices with "Save for web", as gif-files.
    Then the dpi value is removed, the gif files has no dpi value (it's empty).
    How can we stop PS6 from removing the dpi value when using "save for web"?
    OR:
    When using the slice tool, how can we save the sliced pieces without PS removing the dpi value?

    you can make your art go a little bit over the bounds. or you can make sure your artboart and art edges align to pixels

  • How can I find out the first intial row in VA02-output transaction??

    How can I find out the first intial row in the screen which appears during sales order change (VA02) >>enter the sales order number >>after the first screen appears >>in the menu bar go to EXTRAS>>OUTPUT>>HEADER>>EDIT??
    I have to find out the first row in the OUTPUT column which is empty,then populate it with some data using BDC.
    usefull answers will be rewarded.
    regards,
    Shashank .

    Pass the sale order number in the object key of NAST table,
    if u get 3 entires, then u need to place ur entry in the fourth row in that table control thru BDC.
    I think u got the logic.
    Regards,
    Sujatha.

Maybe you are looking for

  • Trying to download the CS^ Master Suite but run into an error when I download it

    this the error message I get when I hit the download button how do I fix it. I want to evaluate some programs before I decide to buy them

  • Convert from pdf to word?

    i cant convert from pdf to word - when i sign in it greys out the conversion setting so i cant use it - what am i missing?

  • Variant data size in Netork STREAM RT to PC

    Hello, I want to develop an universal Network stream subVI that can be used to transfer any type of data, depending on what data type you connect. I found that I should use Variant Type and I have done it. But there is a problem that my application p

  • Get Windows "Service Pack Nr"

    I use Windows NT SP5. (SP = Service Pack) How can I get the information SP5. with System.getProperty( ) I get os.name and os.version but not the SP. I know it's OS specific. But is there any class / commands which gets this value "SP5". IF not, is it

  • How do I "force" a Nano to mount?

    for some reason my Nano isn't mounting - it plays fine & charges when I connect it to the G5, but I haven't been able to get it to mount. any suggestions? w