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

Similar Messages

  • How to update selected list items in SharePoint 2010?

    Hello All
    I have a list containing field named "Category". I want to develope a solution which will take two inputs: Old Category and New Category. The expected result is: all the list items will be fetched which have Old Category input value in
    their category field and the field is replaced with the input value New Category.
    I have a limitation that I can not use Visual Studio. So I am thinking to create aspx page with content editor webpart. But I am new to all these things. Could you please suggest the development approach for this?
    Thanks.

    Hello,
    I don't think CEWP can help you because you won't be able to find old and new category when there is any change in list. However you can identify the latest modified item from list but how will you identify whether category is old or new. If you have any
    other column in list which can tell you that category value has been updated then you can write ECMA or Jquery script to update other items.
    If have any column in list then see below jquery code, where you will see how to query the list: (In my case it is Active)
    var soapEnv = "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'><soapenv:Body><GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>";
    soapEnv += "<listName>Highlights</listName>";
    soapEnv += "<query><Query><Where><Eq><FieldRef Name='Active' /><Value Type='Text'>Yes</Value></Eq></Where><OrderBy Override='TRUE'><FieldRef Name='Modified' Ascending='FALSE' /></OrderBy></Query></query>";
    soapEnv += "<viewFields><ViewFields><FieldRef Name='Title'/><FieldRef Name='ows_FileLeafRef'/><FieldRef Name='Links'/></ViewFields></viewFields><rowLimit></rowLimit>";
    soapEnv += "</GetListItems></soapenv:Body></soapenv:Envelope>";
    Please comment if i misunderstood you?
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • 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).

  • 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

  • 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.

  • 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

  • How to Populate a List item with LOV'S

    How to Populate a list of items with Lov's
    and then how to dynamically change the Values of one LIST Item
    Based on the Value of anothe List item

    976798 wrote:
    --Hello..I want to ask that How to bind a list item with  table values? this below code does not populate items from database to list item.Pls any body give me solution.
    declare
         group_id RecordGroup;
         list_id Item:=Find_Item('LST_CLASS');
         status number;
    begin
         group_id:=Create_Group_From_Query('Answer_List','select CLASS_ID,CLASS_NM from CLASS_MSTR');
         status:=Populate_Group('Answer_List');
         message(to_char(status));
         Populate_List(list_id,group_id);
         end;Welcome to the Oracle Forums. Please take a few minutes to review the following:
    <ul>
    <li>Oracle Forums FAQ
    <li>Before posting on this forum please read
    <li>10 Commandments for the OTN Forums Member
    <li>How to ask questions the smart way
    </ul>
    Following these simple guidelines will ensure you have a positive experience in any forum; not just this one!
    Check this link: How to Dynamically Populate a Pop List ?
    Hope this helps
    Hamid
    If someone's response is helpful or correct, please mark it accordingly.

  • How to send a list item value to URL to open data related to item value

    Hi,
    Iam using Apex4.0 and iam facing some problem. Iam unable to send selected list item value to the url specified in the HTMl region.
    Here i want to open the data related to list item value in other page.
    List item - :Familyp
    i want to pass this selected value to the url and when ever user selected the list item and clicks on the url, then it should display the item value related data in new page.
    I tried with &FamilyP in url but it's not working. Any one help me plz.
    Regards
    Vamsi.Tata

    Is it a normal Select list or Multi Select list?
    If you have select list that allows you to select multiple options then you cannot pass it through URL. Multi-select /Shuttle keep colon separated list in the item, and this confuses Apex because the Apex URL uses colons for a different purpose. No escaping or URL encoding will help.
    If it is normal select list that allows selection of only one option then you can pass through the url. Unless of course the data has a colon in it.
    For multi-select, and when the value contains colon, the only way is to save the value in session state, same page item or any other place like Application Item, and then reference it at the other end. Never pass through the URL.
    Regards,

  • 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

  • HT1451 when editing info, how do i select multiple items to edit a group? For example, changing the artist name on multiple tracks at once?

    when editing info, how do i select multiple items to edit a group? For example, changing the artist name on multiple tracks at once?

    Same way you select multipl items anywhere else.
    Hold ctrl and click the items you want.
    If they are in consecutive order, click the 1st then Shift click the last.

  • How do I select multiple items on blackberry phone?

    How do I select multiple items on blackberry phone?

    Multiple items of what?
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • 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

  • How to delete a list-item with Contribute 4

    I use Contribute for a lot of my client for years and a few
    weeks ago i installed Contribute 4 for the first time for a new
    client .We dicovered that it's difficult or impossible to delete a
    list-item in a unordered list. Maybe also in other list-types but
    we haven't tried this yet. Does anybody know how to delete a
    list-item? In Contribute 3 you just had to use the backspace button
    but that isn't working anymore.
    Thanks for your help.
    Maarten Strik
    www.strikdesign.nl

    http://linesofcode.net/snippets/166

  • 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.)

Maybe you are looking for