Webpart - Get selected list items

All,
I have a SharePoint list and a webpart located above it. In the webpart, I have a button. Is there a way to know the selected list items when user clicks on the button?
For example, I have a Company list which contains Company A, B, C, and D. User has selected Company A and D. When user clicks on the button of the webpart, could the webpart know that Company A and D has been selected?
Thanks,

check this
http://social.msdn.microsoft.com/Forums/en-US/699166b1-9d98-44bd-b07c-2c508215a11a/how-to-get-the-selectedchecked-list-item-id-in-list-item-view-webpart-using-jquery?forum=sharepointcustomizationprevious
http://social.msdn.microsoft.com/Forums/en-US/3d15fd44-adb1-4b51-a56e-6811220e5a60/how-to-get-the-selected-item-of-a-sharepoint-list-?forum=sharepointdevelopmentlegacy

Similar Messages

  • InfoPath: Cascading Fields, need to get ID of final selected list item

    I have a two drop down lists in an InfoPath form. They are getting their data from a SharePoint List that has two columns: Objectives, Strategies.
    The drop down lists are cascading. So dropdown list 2 (DDL2) values change depending on what dropdown list 1 (DDL1) is set to.
    So my list looks like this:
    objective 1 - strategy 1
    objective 1 - strategy 2
    objective 1 - strategy 3
    objective 2 - strategy 1
    objective 2 - strategy 2
    The cascading part in InfoPath works correctly. My problem is that I need to get the ID of the item (strategy) selected in DDL2.
    DDL1 gets its values from an external data source (sharePoint list):
    Entries: /dfs:myFields/dfs:dataFields/d:SharePointListItem_RW
    Value: d:Objective
    Display name: d:Objective
    DDL2 gets its values from the same external data source (sharePoint list):
    Entries: /dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Strategies[../d:Objective = xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/my:SharePointListItem_RW/my:obj]
    Strategy is filtered based on Objective = Objective
    Value: Strategies
    Display name: Strategies
    How can I get the ID of the Strategy selected in DDL2 so that I can write it out to another column that SharePoint can use in a workflow. The only value returned in for DDL2 is Strategy, no ID option.

    Hi Sonners,
    If you want to get the ID of the selected "Strategy" item in DDL2, I think you may need to use the same approach to retrieve the same external data source(SharePoint list have the Objectives and Strategies columns) on another field, then
    filter the list item ID based on the selected Strategy value in DDL2 which equals to the strategy value in that external SharePoint list.
    Or you don't need to get the list item ID of the "Strategy" selected in DDL2 in InfoPath form, you can directly get the list item ID which is filtered by the condition SharePoint list item "Strategy" column value equals
    to the value selected in DDL2 in Desinger workflow, then use the ID value as you want in workflow.
    I have tried a similar method for another requirement like this
    post, you can take a look.
    Thanks
    Daniel Yang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Set Default Value of Multi-select list item

    I have a multi-select list item I want to default the value of to '%' (which is really '%null%') and have it selected. I tried setting default value of item, but it doesn't take '%null%'. I also tried a computation with a static of
    :P507_ITEM := '%null%'; How do you get the default value set and selected?

    Hi
    Shijesh is right, you need to change your null return value and use that return value as your default. Try and use something of the same datatype as your real return values if you plan to use '%' to display all as it will make your queries simpler. eg.
    Company A returns 1
    Company B return 2
    % returns 0
    Then your query would be...
    SELECT ...
    FROM ...
    WHERE company_id = DECODE(:P_COMPANY,1,1,2,2,0,company_id)
    Hope this makes sense.
    Cheers
    Ben

  • TypeError: s.text(...).addClass is not a function on a Select list item jquery mobile theme

    Hi.
    i got a page with jquery mobile template, i got an select list item based on customers , when i touch the field, it display correcty all my customers, but when i try to pick some records i just get the error (i am using firefox firebug to see the error):
    TypeError: s.text(...).addClass is not a function
    ...ollapsiblebound",!0).bind("expand collapse",function(t){var n=t.type==="collapse...
    here is my query :
    select
    nombre_cliente || ' ' || apellidos_cliente a, codigo_cliente b
    from sti_cliente
    where
    codigo_compania in (select distinct codigo_compania from STI_COMPANIA_SUCURSAL_USUARIO where upper(codigo_usuario) = upper(:APP_USER))
    and estado_cliente = 'A'
    and (MANEJA_INVENTARIO_CONSIGNACION = 'S'
    and (codigo_compania, codigo_vendedor) in (select codigo_compania, codigo_vendedor from VTA_MAESTRO_VENDEDORES where codigo_usuario = upper(:APP_USER)) or cliente_contado = 'S')
    order by nombre_cliente, apellidos_cliente
    i have supress a dynamic action based on the field, but seems the problem is something within the query.
    i am running on :
    Application Express 4.2.4.00.08
    Application Express Listener version : 2.0.5.287.04.27
    Application Express Listener server info: Grizzly/1.9.49
    thanks for any tip.

    PLEASE DO NOT post to long since expired threads.  The poster is probably NOT following this thread and your response doesn't really help them with their issue...
    Elephants wear tu-tus so they can hide in pine trees. Did you ever see an elephant in a pine tree? No? Well then, you know it works.
    Thank you,
    Tony Miller
    LuvMuffin Software
    Ruckersville, VA

  • Passing Multiple Selected List Items to a "New Item" Form in Another List with Multiselect Lookup Field

    Hi!
    Version Info:  SharePoint 2013 Server Standard (*BTW...I do not have access to Visual Studio*)
    I have two lists, let's call them
    -Assets
    -Asset Checkouts
    "Assets" is the parent list, and "Asset Checkouts" has a lookup column (multiselect) which is tied to the serial # column in the "Assets" list.
    Basically, what I need to accomplish is this:  I would like to be able to select multiple list items in the "Assets" list, and create a new item in "Asset Checkouts", and pre-fill the multiselect lookup column in the NewItem form
    for "Asset Checkouts" with the values from the selected items in "Assets".
    Any ideas or suggestions on how to do this would be most appreciated!
    Thanks!

    Hi,     
    According your description, you might want to add new item in "Asset Checkouts" list when selecting items in "Assets" list.
    If so, we can achieve it with SharePoint Client Object Model.
    We can add a button in the "Assets" list form page, when selecting items, we can take down the values of columns of the selected items, then click this button which will create
    new item in "Asset Checkouts" list with the values needed.
    Here are some links will provide more information about how to achieve it:
    Use
    SP.ListOperation.Selection.getSelectedItems() Method to get the list items being selected
    http://msdn.microsoft.com/en-us/library/ff409526(v=office.14).aspx
    How to: Create, Update, and Delete List Items Using JavaScript
    http://msdn.microsoft.com/en-us/library/office/hh185011(v=office.14).aspx
    Add ListItem with Lookup Field using Client Object Model (ECMA)
    http://notuserfriendly.wordpress.com/2013/03/14/add-listitem-with-lookup-field-using-client-object-model-ecma/
    Or if you just want to refer to the other columns in "Assets" list when add new item in "Asset Checkouts" list, we can insert the "Assets" list web part into the NewForm page
    of the "Asset Checkouts" list, then when we add new item in the "Asset Checkouts" list, we will be able to look through the "Assets" list before we select values for the Lookup column.
    To add web part into the NewForm.aspx, we need to find the button "Default New Form" from ribbon under "List" tab, then we can add web part in the NewForm.aspx.
    In the ribbon, click the button “Default New Form”:
    Then we can add web part into NewForm.aspx:
    Best regards
    Patrick Liang
    TechNet Community Support

  • Increase value of Select List Item with a Button

    Hi all,
    I've got an apex appli which is working well.
    In one report page I use a select list with a LOV, but I want to "enhance" this functionality:
    I need a kind of button which increments the item-value of the select list by 1,
    so that the user can easily skip to the next value of the LOV without scrolling thru the select list.
    Unfortunately I dont't get it working. Has anyone an idea how to realize that?
    thanks in advance
    Frank

    Hello Frank,
    Assuming your select list item is called P1_SELECT, you can define an HTML button, next to the item, that will do the trick.
    In the Post Element Text field of P1_SELECT, you can have similar code to the following:
      <input type="button" value="Next Value" onclick="$x('P1_SELECT').selectedIndex+=1;" />Hope this helps,
    Arie.

  • Improper casting of bind in select list item?

    Hi all,
    In v3.1.2, I have a Select List item called P1_DEPT_FILTER where the LOV is:
    Number of Columns          1
    Display Null                Yes
    Null display value           -- ALL --
    Null return value
    List of values definition     select DNAME, DEPTNO from DEPT order by 1
    In a computation of another item on the same page, I have a SQL Query in the computation that contains a WHERE clause referencing the Select List item:
         AND (:P1_DEPT_FILTER IS NULL OR assigned_belt LIKE :P1_DEPT_FILTER)
    The problem is that sometimes the computation query returns no rows. Using APEX debug and also dumping the session variables shows P1_DEPT_FILTER to contain the expected value based on what I selected, so I created a LOGON TRIGGER on the owner's database for the owner's schema to fire up a SQL Trace with binds. The bind variables for the computation query show "dty=1", which is a (n)varchar2 type, instead of the expected "dty=2".
    My theory is that this improper casting is causing the computation to not work correctly, since running the computation query outside of APEX works perfectly.
    I'm missing something here, but am stuck on where to continue troubleshooting. Thoughts?
    TIA!
    Rich
    Edited by: socpres on Dec 17, 2008 4:02 PM (typo)

    Hey Scott,
    My apologies for not posting the exact SQLin my original post -- I tend toward obfuscation. In any case...
    That computation and it's slight derivatives appear on computations for P3_ID, P3_ID_NEXT, and P3_ID_PREV, as well as the "Get Next or Previous Primary Key Value" process. Since the value returned for the P3_CHAMPION_FILTER Select List is "8" when I attempt to filter, I altered the P3_CHAMPION_FILTER for each of the 4 SQLs similar to this:
    SELECT
        NVL(MIN(ID),0)
    FROM
        vip_project.project_table
    WHERE
        project_document IS NULL
        AND lead_team_charter_date IS NOT NULL
        AND (NVL(:P3_BELT_FILTER,0) = 0 OR assigned_belt = TO_NUMBER(:P3_BELT_FILTER))
    --     AND (NVL(:P3_CHAMPION_FILTER,0) = 0 OR assigned_champion = TO_NUMBER(:P3_CHAMPION_FILTER))
        AND (NVL(:P3_CHAMPION_FILTER,0) = 0 OR assigned_champion = 8)And it works perfectly! Without a filter on Champion, the correct 56 rows meeting the criteria are available for navigation on the form. If I select the item in the P3_CHAMPION_FILTER that corresponds to the value of "8", only the 3 rows for that "champion" column are navigable. Here's what debug says about the P3_CHAMPION_FILTER field when I select the "8" item:
    0.14: ...Session State: Saved Item "P3_BELT_FILTER" New Value="0"
    0.14: ...Session State: Saved Item "P3_CHAMPION_FILTER" New Value="8"
    0.14: ...Session State: Save "P3_ID" - saving same value: "1"
    And the Session State:
    100     3     P3_CHAMPION_FILTER     Select List     8     I
    So, in theory, changing the "TO_NUMBER(:P3_CHAMPION_FILTER)" to "8" should have no effect, but it does. Baffling!
    Thanks!
    Rich

  • Selected list items to Word document

    I found online many posts to generate a word document with all items included in a list.
    But is is possible to have the generation triggered by the user and to include only a subset of the list items?

    Hi  ,
    According to your description, my understanding is that you want to generate a word document with selected list items in your SharePoint 2010.
    You should look into the Word Control Toolkit, which uses the Open XML format SDK to achieve what you require.
    The basic functionality is that you use the Edit Control Block on a selected list item to generate and populate a Word document using a template you can select from a drop-down list.
    Here's some links to get you started:
    Generating Documents from SharePoint Lists with Open XML Content Controls
    http://blogs.msdn.com/b/ericwhite/archive/2009/10/14/generating-documents-from-sharepoint-lists-using-open-xml-content-controls.aspx
    Word Content Control Toolkit (Codeplex)
    http://dbe.codeplex.com/releases/view/5508
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Help with select list item and dynamics action

    G'Day Apex Gurus,
    I having problems trying to achieve to trigger the help window of a select item automatically. A help window is triggered when the select item label is clicked but my client would like to be triguered automatically as soon as the user click to see the options in the select list.
    I think that I should be able to do it with dynamic actions but I can not get it to work.
    I know when someone click on the label of the select list item trigger this JavaScript
    javascript:popupFieldHelp('277938589795252851','1545903379570909')
    So I want to trigger the javascript also when the user click of the select list item and pull down the options and for that I think that Dynamic actions is the way to go but I can't get it right.
    This is what I a doing:
    I created a Dynamic option as follow:
    Name : test
    Sequence: 30
    Even: Click
    Selection type: Item(s)
    Item(s): P1_RATING <- a selection list item
    Condtion: - No Condition -
    True Actions
    Sequence: 10
    Action : Execute JavaScript Code
    Fire when event result is :True
    Fire on page load: ticked
    Code: javascript:popupFieldHelp('277938589795252851','1545903379570909')
    I appreciate any one who can tell me what i am doing wrong here or provide a solution to my problem of achieving to trigger the help window of a select item automatically.
    Kind regards
    Carlos

    Hi Carlos,
    I set up a test case in exactly the same way and it worked fine for me. I created a page item called P1_DA_DEMO and added some static select list values then added some help text. The settings I used are below, I suggest you try again but also make sure you have no other Javascript errors on the page. Use a tool like firebug to check.
    Name : Dynamic Action Demo
    Sequence: 10
    Even: Click
    Selection type: Item(s)
    Item(s): P1_DA_DEMO <- a selection list item
    Condtion: - No Condition -
    True Actions
    Sequence: 10
    Action : Execute JavaScript Code
    Fire when event result is :True
    Fire on page load: Not Ticked
    Code: javascript:popupFieldHelp('277938589795252851','1545903379570909')
    Event Scope set a s Bind.
    Thanks
    Paul

  • Dynamic Select List Item

    Hi all,
    I want to change from a Text Field to a Select List item.
    The list items should consist of 'Buyer' from a Linked_table in another Db.
    Do I have to create a LOV (List of Value) or can I do it in another way?
    //Lasse

    Edit the item and change the Display As value from Text Field to Select List.
    Then scroll down to the List of Values region and enter your query. Something like:
        select buyer_name, buyer_id
        from buyerThere is no need to create an LOV unless you plan on using the query in multiple forms.

  • Create a black border for select list item

    Need help on creating border on a select list item.
    I tried using style ="border:1px solid black"; in HTML Form Element Attribute , but its not working for select list item, though it works on text field item.
    Nilesh

    Browsers and versions? (Always supply this information when discussing presentation and UI problem.)
    If it's IE, then this is not possible (at least up until IE7 which is all I can test on at present).
    (As HTML, CSS and JavaScript exist outside of APEX, you should search more widely than just OTN when looking for information on these topics.)

  • How do you get the value of a selected list item?

    I have a drop-down list that the user can choose from. How do I get the value of what they selected? I thought I could do this by using the NAME_IN function, but I'm getting FRM-40105 Unable to resolve reference to item X. I don't know what I'm doing wrong.
    Thanks!

    Hi,
    You can use an WHEN-LIST-CHANGED trigger, attached to the list-item itself. And, in this trigger, you can use the name of the item to refer its value.
    For example:
    :block_name.list_item_name
    John

  • How do I get the list index for the selected list item

    How can I obtain the list index for the currently selected
    element in a list item? I'm trying to move the label and value
    from on list box to another by using the add_list_element built-
    in and it requires the list index.
    Thanks for your help...

    Hi,
    You can`t get the Index for the selected item..
    you can get the Value of then Tlist using :Block.ListName .
    maybe theis code will help you..
    PROCEDURE pr_PasarElementos(ls_Origen           varchar2,                    ls_destino          varchar2,          cValor                    varchar2 default null) IS
         nCont_Orig     number := 0;
         nCont_Dest     number := 0;
    begin
    nCont_Orig := GET_LIST_ELEMENT_COUNT(ls_Origen);          nCont_Dest := GET_LIST_ELEMENT_COUNT(ls_destino);
         Add_List_Element(ls_destino,nCont_Dest+1,cValor,cValor);
         for rec_Orig in 1..nCont_Orig loop
         if GET_LIST_ELEMENT_VALUE(ls_Origen,rec_Orig) = cValor then
         delete_list_element(ls_Origen,rec_Orig);
         end if;
         end loop;
    end;
    you can call the procedure with :
    pr_pasarElementos('control.ls_activos','control.ls_inactivos',:CONTROL.ls_activos);
    here I`m working with the Value equal to the Label... you would need to look for the Label of the origin (ls_Origen) list using the Value (cValor) you already have.
    I hope this help you.

  • How to highlight selected list item in sap ui5?

    I have a list..in which custom list items have been used.
    On click of any custom list item it should get highlighted,
    I am able to click on each custom item...and have added an browser event
    on its click..which changes its color ..
    function to change its color goes like this:
    hbox.attachBrowserEvent("click", function(event) {
                    var idOfHbox= this.getId();
                     $('#'+idOfHbox).css"backgroundcolor","#e6f2f9");
    ALso for each custom list item I have used a button and a checkbox in a HBox..
    So am changing the hbox color (on click event).
    The problem here is...
    When i select one item, and then select another item..both of them are highlighted..
    I want only the current selected item to be highlighted.
    Please guide..

    Have you tried using the SelectionChange event on the list, rather than the browser onClick event?
    I believe the SelectionChange event is fired for each selected and deselected item in the list.
    https://sapui5.hana.ondemand.com/sdk/docs/api/symbols/sap.m.ListBase.html#event:selectionChange
    Many thanks,
    Jason

  • How To? Select List item return 2 values (high and a low)

    Can anyone suggest how to make a select list drop box return 2 values for my query.
    eg:
    Pick from
    Last Week
    Last Month
    Last Year
    return high/lo values of
    5-feb-06 12-feb-06
    01-jan-06 31-jan-06
    01-jan-05 31-dec-06
    Such that my query can refer to it as
    select *
    from tabx
    where dte > :parm_lo
    and dte < :parm_hi
    You get the idea ..

    I haven't tested this at all, so it may not work, but the first thing that springs to mind is not returning the two dates, base it on the current date, i.e. have your select list return something like -
    Last Week - Return 'W'
    Last Month - Return 'M'
    Last Year - Return 'Y'
    then use a query something like -
    SELECT *
      FROM tabx
    WHERE dte >
              CASE v ('ITEM')
                 WHEN 'W'
                    THEN TRUNC (SYSDATE, 'd')
                 WHEN 'M'
                    THEN TRUNC (SYSDATE, 'Mon')
                 WHEN 'Y'
                    THEN TRUNC (SYSDATE, 'yyyy')
                 ELSE dte - 1
              ENDLike I said, completely untested and may not work...you may also have to play around with the boundary values (NLS settings too perhaps).

Maybe you are looking for

  • Bootloader errors during install on Macbook 7,1

    I had Arch up and running on my Macbook 7,1 with / and /home partitions, and decided that I wanted to make /home larger. For some reason, it didn't occur to me to just resize my /home and OS X partitions, so I backed up and wiped Arch off my disk ent

  • Use of text in a movie clip

    Hello I am trying to use Text | New Text | Default Text at the beginning of a clip. I have managed to get the text to fade in but not to fade out. Is it possible to use both those techniques on the same text? I wondered, too, if it were possible to p

  • What screen resolutions are available on His-res 15" MacBook Pro?

    Hi.  I can see in the apple web site specs what the various screen resolution settings are for the standard resultion, 1440x900, 15" MacBook Pro (1440x900, 1280x800, 1152x720,  etc.) But what are the settings available for the 15" MacBook Pro with th

  • How do you control the volume of multiple audio tracks

    Hi I have about eight tracks of audio in my Finalcut timeline. When played, sometimes the music track will be much louder than the narration track or the FXs track will be louder than the all tracks. How do I lower or raise the volume of tracks so th

  • OSB Proxy Service deployed in cluster environment FTP issue

    Hi, I have a OSB 11g proxy service based on a FTP JCA adapter. Here are the JCA settings: <connection-factory location="JNDI_FILE_TOKEN" UIincludeWildcard="FILENAME_TOKEN"/>   <endpoint-activation portType="Get_ptt" operation="Get">     <activation-s