How to set multi select by script to a list box.

Hi All,
I have a list box with multiple select on the form with list (Say A,B,C,D,E,F,G ..)
When I select A,C,E ans say this.RawValue I get A,C,E separated by carrage returns.
When i submit the form in my Fm I get A#C#E its all fine.
Now when the form is openend for the 2nd time to update values I get the value as A,C,E separated by carrage return thats fine too.
Now i need to set these 3 values as selected by default so i had some java script in form ready.
Where i iterate tru these list match the entries in the dropdown its fine untill here.
this.setItemState(index,true)
is the code to set them as selected but when i do only the 1st found is set to selected not the remaining ones.
Am i doing something wrong here, please let me know with your suggestions.
below is my script.
var ddValue =  this.rawValue;
ddValue = ddValue.replace("#","\n");
var ddArray = ddValue.split("\n");
var ddLen = ddArray.length;
var textValue = "";
GM_INTAKE_STRUCTURE.sf80.sfItemBuilder.sfHeaderConditions.dlExpenseType.clearItems;
GM_INTAKE_STRUCTURE.sf80.sfRequestSummary.dlItem.clearItems;
for(var i = 0;i<ddLen;i++){
     for(var j = 0;j<this.length;j++){
          if(this.getSaveItem(j) == ddArray<i>){
               this.setItemState(j,true);                
               GM_INTAKE_STRUCTURE.sf80.sfItemBuilder.sfHeaderConditions.dlExpenseType.addItem(this.items.nodes.item(j).value,this.getSaveItem(j));
Thanks & Regards,
Sai

Hi Sai,
     The replace function is only replacing the first occur of #, not all of them. But you don't even need to replace the # before you do the split, just change your first lines to split directly with the # character. Your code should look as follow:
var ddValue =  this.rawValue;
var ddArray = ddValue.split("#");
var ddLen = ddArray.length;
var textValue = "";
GM_INTAKE_STRUCTURE.sf80.sfItemBuilder.sfHeaderConditions.dlExpenseType.clearItems;
GM_INTAKE_STRUCTURE.sf80.sfRequestSummary.dlItem.clearItems;
for(var i = 0;i<ddLen;i++){
     for(var j = 0;j<this.length;j++){
          if(this.getSaveItem(j) == ddArray<i>){
               this.setItemState(j,true);                
GM_INTAKE_STRUCTURE.sf80.sfItemBuilder.sfHeaderConditions.dlExpenseType.addItem(this.items.nodes.item(j).value,this.getSaveItem(j));
Best regards, Aldo.
Any comments and feedback are welcome.

Similar Messages

  • How to read the selected value of a dropdown list box

    Hello,
    I have 2 custom fields which are of type dropdown list on Accounts(CRMM_ACCOUNT) PCUI application details tab.I need to read the selected value of first dropdown list item,based on that second dropdown list will be populated.
    I know where to populate the dropdown list box,it is in FILL_DROPDOWN_LISTBOX.
    I dont know how to trap the selection made on dropdown list.
    PLease guide me on how to trap the dropdown list field selection value.
    Thanks in advance.
    Thirumala.

    Hello,
    Check what is done in standard for the fielf REGION which is inked to the country.
    Otherwise, you can do the following :
    - in field group customizing, for field 1, flag the 'send request' flag. So, when you change the value in this field via the dropdown, the MAC methods are immediately called.
    - Put the new value in a global variable (GV).
    - in the fill_dropdown_listbox method, get the value from this GV and based on it, filter the values for the dropdown of field 2.
    Hope this will help you,
    Regards,
    Frederic

  • Set multi select-options

    Hi,
    Do you know how to set multi select-options in ABAP, i know i can use default to set single value. but is it possible set multi value for select-options. Thanks

    Hi ,
    Just like Rich Heilman said,
    with a litle modification:
    select-options: s_datum for sy-datum.
    initialization.
    s_datum-sign = 'I'.
    s_datum-option = 'BT'.
    s_datum-low = sy-datum.        s_datum-high = sy-datum+30.    append s_datum.
    s_datum-low = sy-datum + 1.  s_datum-high = sy-datum+31.    append s_datum.
    s_datum-low = sy-datum + 2.  s_datum-high = sy-datum+32.    append s_datum.
    s_datum-low = sy-datum + 3.  s_datum-high = sy-datum+33.    append s_datum.
    Regards,

  • How to set page numbers in scripts

    Hi,
        i want page numbers at bottom of page,
      please tell me how to set page numbers in scripts?

    Hi,
    In footer
    use this
    &PAGE& / &SAPSCRIPT-FORMPAGES&
    &PAGE& of &SAPSCRIPT-FORMPAGES&
    reward if it helps..
    regards,
    Omkar.

  • How to set Multi User Environment in the weblogic 5.1 and 6.1 server..(Urgently)

    Hi all,
    I need to know how to set Multi User Environment in the weblogic 5.1
    properties file..
    Here my question is..:)
    1) I have a database with multiple users and having different privileges
    for the users.. and i need to use all the privileges when user aceess
    the database through weblogic server connectionPool.
    2)According to the user privileges i need access the database tables
    content and gives the frontEnd(jsp).
    3)How to modify dynamically weblogic.properties file in the weblogic
    5.1.
    If anybody having idea reg. this issues pl...help me..
    Thanks in advance
    Chandu([email protected],[email protected])

    Hi. A JDBC connection pool is a set of identical, interchangeable, pre-made
    connections, and the controls to make sure only one user uses a particular
    connection at any one time. If you want to have different DBMS users, you can
    have a separate pool for each DBMS user, which may contain as many or few
    connections as you want. Some applications has a pool for the accounting
    applications, and another for the sales applications etc. Some do have a
    separate pool for john, jane, joe etc, each with one connection. Pools
    can be created and destroyed dynamically using the dynamic pool API.
    Joe
    softstar wrote:
    >
    Hi all,
    I need to know how to set Multi User Environment in the weblogic 5.1
    properties file..
    Here my question is..:)
    1) I have a database with multiple users and having different privileges
    for the users.. and i need to use all the privileges when user aceess
    the database through weblogic server connectionPool.
    2)According to the user privileges i need access the database tables
    content and gives the frontEnd(jsp).
    3)How to modify dynamically weblogic.properties file in the weblogic
    5.1.
    If anybody having idea reg. this issues pl...help me..
    Thanks in advance
    Chandu([email protected],[email protected])

  • How to set default selection in html:radio

    hai
    how to set default selection in <html:radio>.

    No it won't help.
    You can't set a value into an <input type="file"> control at all. The user has to put values in themselves.
    The reason behind this is security. If the programmer could put any value they liked in there, you could upload any file at all from a users computer without their intervention. eg C:\windows\system32\passwords.txt
    Bottom line: you can't put a default value into the input type="file" control.
    And a good thing too ;-)

  • How to set default selected checkbox in af:tableSelectMany /

    Hi,
    I am new to ADF technology, I am using JDev 10..3g.
    I want to set the checkbox as default selected for particular rows.
    but I don't know how to set default selected checkbox in <af:tableSelectMany />
    Is there any way to do this using ADF<af:tableSelectMany />
    Thanks,
    Mohammed

    Hi Jeroen,
    Thanks for reply. but the problem is that I am getting data from database and based on some flag I need to select checkbox while page is loading first time.
    at that time the table is null as till now it not rendered. and when its rendered it means page is displayed now.
    just before display I need to set checkbox as selected.
    I don't want to do like this (when user is pressing any command button then only is should update checkbox selection).
    Thanks,
    Mohammed.

  • How to set up selected ringtone in i-phone 5...?

    hi, please help
    how to set up selected ringtone in i-phone 5...?

    i mean if i want to select my own song from i-tune and want to set it as a ringtone...then how is it done..?

  • How do set multi ip address on solaris8

    I set multi ip address by following command:
    inconfig hme0:1 159.226.140.55 netmask 255.255.255.0
    system error:not found interface hme0:1.
    I shoud how to set multi ip address on solaris8

    are you sure you have your hostname.hme:1 file in the /etc directory?
    you need to create that file with your hostname in it for virtual ip to work.

  • After selecting the value from the list box, want to disable checkbox

    hi guru,
    After selecting the value from the list box, want to disable checkbox and custom control textbox(container) in module pool.
    so please help me on this.
    thanx,
    man

    in PBO,
    loop at screen.
      if screen-name = your textbox's name.
        screen-input = 0.
        modify screen.
      endif.
    endloop.

  • How to set up rules/conditions on a drop down box to ensure its been filled if a value in a text box is selected.

    Hi, I am in midst of creating a form in infopath. I have a text box field in which the user will enter the number of issues he has. if the user has entered the number of issues he has, then he will need to select the type of issues from a multi selection
    box. Thus i need to know how to set up rules/conditions to ensure that the user has to complete the multi selection box if he enters a value in text box for the number of issues. 

    I assume what you are asking is to make multi selection box as mandatory. If not please explain with a example
    Try below:
    http://webcache.googleusercontent.com/search?q=cache:ItIYeZ8K2gEJ:sharepointkings.blogspot.com/2013/06/make-multi-select-list-box-required-in.html+&cd=4&hl=en&ct=clnk&gl=in&client=firefox-beta
    If this helped you resolve your issue, please mark it Answered

  • How to view multi-select responses in individual columns

    Hi,
    I have a multi-select field on my form. Users can check none, one, or many responses. When viewing the resluts, the response are concatenated together by a semi-colon and displayed in one column. I need to be able to sort based on the specific responses. Other form engines put these types of multi-select responses into unique columns for sorting purposes. How do I do this in Adobe Forms?
    Thanks,
    Doug Ward

    Doug,
    Did you try the right click and leftclick on the column letter?  I'm pretty sure that addresses the issue.
    Here are a couple of screen shots using a multiselect field with choices "AnswerOne AnswerTwo AnswerThree"
    Here is what happens when you right click on the column heading:
    Here is what happens when you left click on the column's letter (in this case B):
    You'll see that in both cases, you can sort first or last by any of the options in the multiselect field.  If you sort first by AnswerOne, all the responses that chose "AnswerOne" will show up first.  If you sort last by "AnswerOne" all of them will show up last.
    Does this solve the issue you're describing?
    Another option would to use the filtering functionality.  If you open up FormsCentral, go to the Help Menu, and click on FormsCentral Help, then click on "View Responses" and click on "Sort and Filter data", it will walk you through filtering data.  Here is the link
    You can set up filters to show only the response that answer "AnswerOne" or any number of combinations ("AnswerOne" AND "AnswerThree", "AnswerTwo" OR "AnswerThree").
    Hope one of these two methods helps
    Anatole

  • How to disable Multi-selection thing in slicer.

    Hello,
    I am using Slicer in Excel Sheet and i want to disable Multi-selection thing in slicer.
    Is it possible to throw an exception or doesn't allow to do a multiple selection in excel slicer using VBA or without?
    Quick help ll be appreciated  :)
    Thanks & regards,
    Gaurav Badhani.

    Thanks for your reply,
    I used below given code and it's working and i put this code on ThisWorkbook and calling on
     Workbook_SheetCalculate
    Workbook_SheetSelectionChange
    it's working fine but whenever i am selecting slicer value using CTRL key this code is not excuting coz system is not able to call events
    Kindly help me with the events or code coz i am using CTRL key for multi selection and whenever i am using CLRL key it's not working
    Please find below given code
     Dim scl As SlicerCacheLevel
        Dim oSlicer As Slicer
        Dim i As SlicerCaches
        Set i = ActiveWorkbook.SlicerCaches
        Dim oSi As SlicerItem
        Dim ItemsAllowed As Integer
        Dim cntItems As Integer
        ItemsAllowed = 1
        cntItems = 0
        Application.EnableEvents = False
        For Each oSi In ActiveWorkbook.SlicerCaches("Slicer_RC_Description").SlicerItems
             If oSi.Selected Then cntItems = cntItems + 1
            If cntItems > ItemsAllowed And oSi.Selected Then
                oSi.Selected = False
                MsgBox "Please select only one item"
                Application.EnableEvents = True
                Exit Sub
            End If
        Next oSi
    Also tell me what event i should use for ur code or how can i use code using CTRL key
    Thanks & Regards,
    Gaurav Badhani
    A

  • How  to do, multi select drop down in struts

    Hi, I need an example of multi select drop down in struts.
    i m able to select multiple options by giving multiple="true" , but how can i set all these values to actionForm property to save in to the database.
    Thanks
    Naren.

    Hi, I need an example of multi select drop down in
    struts.
    i m able to select multiple options by giving
    multiple="true" , but how can i set all these values
    to actionForm property to save in to the database.
    Thanks
    Naren.In your action you need to call getParameterValues, which (if everything goes according to plan) will give you a String array of the values that were selected.
    Good Luck
    Lee

  • How to use multi select in a query report

    I defined a lov. This lov retuns name and a id. I want to use the result of this multi select in my query.
    I always get invalid number when I choose two items of the select. When I debug I see that the return value of the multi select is 1:2. How can I change the seperator : in , I tried the following but this does't work.
    if :P26_PRODUCTTYPE IS NOT NULL then
    l_sql := l_sql ||' and producttype in
    (REPLACE(:p26_producttype,'':'','','' ))';
    end if;

    as you're finding, multiple values selected from html db multi-select list items (and checkboxes) are stored as a single, colon-delimited string. i explained an easy way to handle this via pl/sql in...
    Multiple select list
    ...that post shows you how to throw the selected values into a pl/sql table and step through them as needed. it also showed how to use an instr to parse through the string if you want to go that route. you could use that same instr logic right in your sql query. so let's say your lov for your multi-select item (P1_MY_MULTISELECT, we'll call it) was defined as...
    select ename, empno from emp order by 1
    ...and your user selected KING, FORD, and JONES. :P1_MY_MULTISELECT would store those values as...
    7839:7902:7566
    ...you could then write a query to return the selected enames with something like...
    select ename, job
    from emp
    where insrt (':'||:P1_MY_MULTISELECT||':',':'||empno||':') != 0
    ...hope this helps,
    raj

Maybe you are looking for