10g: Enabled list items and scrollbars look disabled

Hi,
Is there any way to change the way list items and scrollbars look in 10g?
Enabled list items and scrollbars look disabled to me (the list button on the list item and the arrow buttons on the scrollbars are greyed out).
Visual attributes doesn't seem able to control this.

Nope you're pretty much stuck with the look and feel of the decoratiosn unless you want to create your own pluggable component - this would give you more control but you'd have to consider if it's worth the investment.

Similar Messages

  • HT2531 Spotlight lists items and shows preview images.  BUT what about showing the location address of an item in my computer. Especially important if I've put the item in the wrong folder and what to locate it without multi-steps. iMac OS 10.5 was more u

    Spotlight lists items and shows preview images.  BUT what about showing the path/location address of an item in my computer.
    Especially important if I've put the item in the wrong folder and what to locate it without multi-steps. iMac OS X 10.5 was more useful.
    Old OSX Spotlight function automatically displayed path/location within the machine:  e.g. desktop/folder/sub-folder/item.
    Can I make Spotlight show the path?

    Press option-command and the path is displayed at the bottom of the little preview window.  Press command-return and the enclosing folder opens. 

  • I keep getting error 3004 when i try restoring and updateing my iphone 4 to iOS 7 i did everything 1. flushed dns 2. edited hosts 3. updated itunes and downloaded new one 4. switched usb ports 5. disabled antivirus 6. enabled ports 80 and 443 7. disabled

    I keep getting error 3004 when i try restoring and updateing my iphone 4 to iOS 7 i did everything 1. flushed dns 2. edited hosts 3. updated itunes and downloaded new one 4. switched usb ports 5. disabled antivirus 6. enabled ports 80 and 443 7. disabled firewall 8. even tryed putting mobile in DFU mode to restore it not of this worked so please help me

    please replyyy i'm stuck on this like whole week

  • Using a newly created Library document to create a list item and attach itself

    I have a workflow that moves a document from one library to another.
    When a document is moved to a certain library I want to create a list item with a link to the document in the list item.  Keep in mind there could be 10 files submitted to the library, so then in my list I would want 10 new list items created for
    each file, with a link to the individual file. or is there a way to attach the document to a newly created list item programmatically?
    is this possible?

    Hi,
    According to your post, my understanding is that you wanted to use a newly created Library document to create a list item and attach itself.
    I recommend to create a workflow assocaited to the second library, and start the workflow automatically when an item is created.
    Then add action as below:
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Is it possible to submit a list item and at same time query/search the results if parameters are matched.

    Hello,
    Is it possible to submit a list item and at same time query/search the results if parameters are matched.
    Example - user logon to site enter search parameters and hit submit button. Once done parameters gets saved in list and shows search results on page. I have been asked to do this with
    SP designer and InfoPath doesn’t work due items limits.
    Please suggest.
    Thanks,
    Manish
    Manish

    Hi Manish,
    may i ask if you need,
    when user account click the login button, it will be authenticate the user and then it will show search result page?
    may i know how the keyword of words to be put? is it together with the user account box, password and keyword?
    or it will be like, after user authenticate, it will redirect to search page, so that user may use the search page to input the keyword?
    Regards,
    Aries
    Microsoft Online Community Support
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • How to print out document list items (and with all comments!)

    Hi all,
    I am wondering how to get a good printout of document lists.
    In a web application I have some document list items and the users are adding many comments in it, so that the document list item doenst show all in the initial view, but scroll buttons to navigate up and down.
    I was surprised to read that the standard print functionality doesnt support document items.
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/43/68ce8391886e47e10000000a422035/content.htm
    How can I print out a list of all document list items with all comments?
    Ist there a workaround?
    thanks in advance for sharing your experiences, br, Michael

    Thanks guys for trying to help me...
    Gabriel, I not wanna do "a lot of trix" to get this out of iCal when it should be solved by iCal (from my point of view).
    Dancing Brook, Yes I hope we will see that in the future. I am convinced that there is many of us out there who want to see that function in iCal, even if they not really missed it yet.
    I have already sent a request to iCal feedback (hope they noted). Maybe they will if we are many doing so...

  • 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

  • How to create a multi column list item and select these values from a LOV

    Hi all,
    My requirements are:
    1) create an LOV which holds the productno, productname and productprice fields (this is working)
    2) at run time, select one record from LOV and populate the list/grid with this selected record values of productno, productname and productprice fields, so we are showing them on the form in the form of a table/grid (not working)
    3) be able to select multiple records from LOV and be able to populate the list item with multiple records (not working)
    4) have two more columns in the list/grid, for productquatity and total price (not wokring)
    Please help me.
    how can i create this grid or list in oracle
    whats the possible way of acheiving this in oracle

    If you use a list item to display multiple columns then you'll need to use a fixed-width font. You can achieve a similar look with proportional fonts by using a normal block and setting the fields' bevel to 'None'.
    Each column in the LOV has a Return Item property (under Column Mapping Properties). Set this to a :block.item reference for each column to bring the data back into those referenced fields.
    You can't select multiple records from an LOV. For this you will need to create your own form. Check the help for system.mouse_button_modifiers to see how to respond to Ctrl+click and Shift+click.
    To add columns just modify the LOV's record group's query.

  • Help: set the list item when scrollbar scrolls

    i need help regording how to set the listbox list item to be selected (i.e. item to be highlighted) when the vertical scrollbar scrolls.

    Hi Shreyas,
    You can insert the code below into the NewForm.aspx page of the list via a Script Editor web part:
    <script type="text/javascript">
    _spBodyOnLoadFunctionNames.push("ready");
    function ready()
    //12/04/2015 - 18/04/2015
    var sd = "";
    var ed = "";
    var d = new Date();
    //get start date of the week
    d.setDate(d.getDate() - d.getDay());
    sd = convertDate(d);
    //get end date of the week
    d.setDate(d.getDate() + (6 - d.getDay()));
    ed = convertDate(d);
    //populate the string into the Title field
    var title = document.querySelector("input[title='Title']");
    title.value = sd+" - "+ed;
    function convertDate(inputFormat) {
    function pad(s) { return (s < 10) ? '0' + s : s; }
    var d = new Date(inputFormat);
    return [pad(d.getDate()), pad(d.getMonth()+1), d.getFullYear()].join('/');
    </script>
    It will populate the “Title” field with the text like “12/04/2015 - 18/04/2015” based on current date when adding a new item in this list in the NewForm.aspx page:
    Here are two links about how to add code into page via Content Editor Web Part:
    http://blogs.msdn.com/b/sharepointdev/archive/2011/04/14/using-the-javascript-object-model-in-a-content-editor-web-part.aspx
    http://sharepointadam.com/2010/08/31/insert-javascript-into-a-content-editor-web-part-cewp/
    Thanks 
    Patrick Liang
    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]

  • Sum child list items and update parent total using javascript

    I have a SharePoint 2010 Parent/Child list setup using a lookup field to join both the lists, this is working well.
    The Parent list contains requisition requests and the child list contains related item details. Each of the related child list items has a 'Line Item Total' field. I need to aggregate the Line Item Totals in the child list and place the result in a 'Requisition
    Total' in the parent. So for any given parent record the sum of it's related child 'Line Item Totals' is reflected in the 'Requisition' total in the parent row.
    I am struggling with the JavaScript code below. I am trying to aggregate Line Item Totals for a given Requisition#? Could someone please review and advise?
    <script language="javascript" src="/Purchasing/Documents/jquery-1.8.2.js" type="text/javascript"></script>
    <script language="javascript" src="/Purchasing/Documents/jquery.SPServices-2014.01.min.js" type="text/javascript"></script>
    <script>
    $(document).ready(function()
     $('select[title=Requisition#]').children().attr('disabled',true);
     $("input[title='Old Amount']").attr("readonly","true").css('background-color','#F6F6F6');
       // Retrieve the name of the selected parent item.
       var strParent=$("select[title$='Requisition#'] :selected").text(); 
     splist li = web.lists["ReqDetails"]; // This is the child list
        spquery q = new spquery();
        q.Query= "<Where>" +
         "<And>" +
          "<Neq>" +
           "<FieldRef Name='ID'/><Value Type='Number'>0</Value>" +
          "</Neq>" +
          "<eq>" +
           "<FieldRef Name='LinkID'/><Value Type='Number'>ReqID</Value>" +
          "</eq>" +
         "<And>" +
        "</Where>" +
        "<OrderBy>" +
         "<FieldRef Name='LineItemTotal'/>" +
        "</OrderBy>"
        q.ViewFields = string.Concat("<FieldRef Name='LineItemTotal' />");
        q.ViewFieldsOnly = true; // Fetch only the data that we need
        splistitemcollection items = li.getitems(q);
        foreach(SPListItem item in items)
        sum += parseInt(item["LineItemTotal"], 10);
      alert(sum)
     </script>
    Rick Rofe

    I do something similar for a PO Header/PO Detail set of lists. I use SPServices to pull the data.
    I put this code in the child edit page - so any time any child is edited, the parent is updated. I get all children records and total them up (except for the item I'm displaying at the current time. I add that value in directly from the form itself.
    <script type="text/javascript" src="/Javascript/JQuery/JQueryMin-1.11.1.js"></script>
    <script src="/Javascript/JQuery/jquery.SPServices-2014.01.min.js"></script>
    <script>var poNumber = '';
    var poDetailID = '';
    $(document).ready(function() { var queryStringVals = $().SPServices.SPGetQueryString();
    poNumber = queryStringVals["PO"];
    poDetailID = queryStringVals["ID"];
    function PreSaveAction() {
    // update the PO header with the total of all items + shipping + adjustments
    var query = "<Query><Where><And><Eq><FieldRef Name='Title' /><Value Type='Text'>" + poNumber + "</Value></Eq><Neq><FieldRef Name='ID' /><Value Type='Counter'>" + poDetailID + "</Value></Neq></And></Where></Query>";
    var viewFields = '<ViewFields><FieldRef Name="Total" />';
    viewFields += '</ViewFields>';
    var poTotal = 0.00;
    $().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "PO Details",
    webURL: "/po",
    CAMLViewFields: viewFields,
    CAMLQuery: query,
    completefunc: function (xData, Status) {
    //alert(xData.responseText);
    $(xData.responseXML).SPFilterNode('z:row').each(function() {
    if($(this).attr("ows_Total")) {
    //alert($(this).attr("ows_Total"));
    poTotal += Number(parseFloat($(this).attr("ows_Total").split(";#")[1],2).toFixed(2));
    // add in this changed line (we skipped it above)
    var qty = $('input[title="Quantity Ordered"]').val();
    var price = $('input[title="Price"]').val().replace(',','');
    var extend = Number(qty)*Number(price);
    poTotal += extend;
    //alert(poTotal);
    // update the PO Header
    $().SPServices({
    operation: "UpdateListItems",
    async: false,
    listName: "Purchase Orders",
    webURL: "/po",
    ID: poID,
    valuepairs: [["Total", poTotal]],
    completefunc: function (xData, Status) {
    //alert(xData.responseText);
    $(xData.responseXML).SPFilterNode('z:row').each(function() {
    return true;
    Robin

  • SP Designer Workflow: How to Get Full URL Path to List Item and inserted same list ITem URL in another list

    Hi,
    I have requirement in Sp Designer 2010,Get List item URL and insert in another list as one column value.When open another list and click on same item  column entry url will show the parent item information.
    Here i have create work flow and insert item URL in another list but cant find appropriate item url information.I can easily make  item url link through String builder in mail body with using current id and predefine link,but
    when try to insert the same type of item link in another list where i cant find string builder for create custom url link,only get valur of Path,URL,Absolute URL and Relative server URL,all these links or not provide me exact
    item link dispaly information.
    So I opened SharePoint Designer and start creating the workflow associated to the list.
    As there is some Field from source related to current item URL I start using it
    Encoded Absolute URL – this one should be the one to use
    Server Relative URL
    URL Path
    Unfortunately, none of these options were providing the correct link. Indeed, these options are providing an incorrect path:
    Encoded Absolute URL
    http://wfe1/Lists/bpf/1_.000
    Server Relative URL
    /Lists/bpf/1_.000
    URL Path
    /Lists/bpf/1_.000
    As you can see, the item URL is composed by an ID while it should be http://wfe1/Lists/bpf/dispform.aspx?id=1
    Hasan Jamal Siddiqui(MCTS,MCPD,ITIL@V3),Share Point Application Developer,TCS

    Unfortunately, [%Current Item:URL%] doesn't seem to be available from a "Site Workflow" associated to a List.   I'm finding less advantages to doing a "Site Workflow" when I don't necessarily need to.  One problem is the workflow is initiating
    twice.   I'm thinking I should have just created the workflow as a a "List Workflow."  
    I am going to try "Association Columns" -- that may work.  Anyone have other suggestions?

  • How to read list item and display Title and on click hyperlink as value by javascript /jquery

    on newform.aspx just above the top of cancel button I want to put 1 hyperlink "Help"
    but I want to do this by script/jquery by reading my configuration list where 1 column is TITLE and other is- URL
    in TITLE column will write "Help" and in URL column  I will write
    http://portal1234/sites/sudha/MyHelppage.aspx
    so script should read Title and display Help--->1st part
    Script should read Value column and on click of help-(display link) the respective url should be open in new window.-->second part
    Please let me know reference code for adding anchor tag dynamically by reading from list
    I can see hyperlink near cancel button-
    $(document).ready(function(){
    var HelpLinkhtml ='<a href="#" text="Help">Help</a>';
    var position =$("input[value='Cancel']").parent("td").addClass('ms-separator').append(HelpLinkhtml);
    now for reading from list I am trying below script-
    $(document).ready(function() {
        GetHelpLinkFromConfigList();
    function GetHelpLinkFromConfigList()
     //The Web Service method we are calling, to read list items we use 'GetListItems'
     var method = "GetListItems";
     //The display name of the list we are reading data from
     var list = "configurationList";
     //We need to identify the fields we want to return. In this instance, we want the Title,Value fields
     //from the Configuration List. You can see here that we are using the internal field names.
     var fieldsToRead = "<ViewFields>"+"<FieldRef Name='Title' />"+"<FieldRef Name='Value' />"+"</ViewFields>";
     //comment
     var query = "<Query>" +
                            "<Where>" +
                                "<Neq>" +
                                    "<FieldRef Name='Title'/><Value Type='Text'>Help</Value>"
    +
                                "</Neq>" +
                            "</Where>" +
                            "<OrderBy>" +
                                "<FieldRef Name='Title'/>" +
                            "</OrderBy>" +
                        "</Query>";
     $().SPServices(
     operation: method,
        async: false,
        listName: list,
        CAMLViewFields: fieldsToRead,
        CAMLQuery: query,
        completefunc: function (xData, Status) {
        $(xData.responseXML).SPFilterNode("z:row").each(function() {
        var displayname = ($(this).attr("ows_Title"));
        var UrlValue = ($(this).attr("ows_Value")).split(",")[0];
        AddRowToSharepointTable(displayname,UrlValue)
    function AddRowToSharepointTable(displayname,UrlValue)
        $("#NDRTable").append("<tr align='Middle'>" +
                                    "<td><a href='" +UrlValue+ "'>+displayname+</a></td>"
    +
                                   "</tr>");
    <table id="NDRTable"></table>
    Thanks :)
    sudhanshu sharma Do good and cast it into river :)

    Hi,
    From your description, you want to add a help link(read data from other list) into new form page.
    The following code for your reference:
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    ExecuteOrDelayUntilScriptLoaded(AddHelpLink, "sp.js");
    function AddHelpLink() {
    var context = new SP.ClientContext.get_current();
    var list= context.get_web().get_lists().getByTitle("configurationList");
    var camlQuery= new SP.CamlQuery();
    camlQuery.set_viewXml("<View><Query><Where><Eq><FieldRef Name='Title'/><Value Type='Text'>Help</Value></Eq></Where></Query></View>");
    this.listItems = list.getItems(camlQuery);
    context.load(this.listItems,'Include(Title,URL)');
    context.executeQueryAsync(function(){
    var ListEnumerator = listItems.getEnumerator();
    while(ListEnumerator.moveNext())
    var currentItem = ListEnumerator.get_current();
    var title=currentItem.get_item("Title");
    var url=currentItem.get_item("URL").get_url();
    var HelpLinkhtml ='<a href="'+url+'">'+title+'</a>';
    $("input[value='Cancel']").parent("td").addClass('ms-separator').append(HelpLinkhtml);
    },function(sender,args){
    alert(args.get_message());
    </script>
    Result:
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Creating a form to Add List Item and to a Document Library

    Hi,  I'm super new to sharepoint , and have what is probably a newbie question.
    I have a list and a document library.  The documents are linked to the items in the list. (1 list item may have one or moe documents associated with it).
    I need to create a form to add new list items that will at the same time upload documents to the document library.
    Do I use infopath for that?
    Thanks

    Hi,
    According to your description, when adding a new item to the current list, you might want to upload the attachments of this item to other Document Library as well.
    As a workaround, you can create an Event Receiver to capture the event when there is “An item was added”. In the Event Receiver, we can write C# code to copy the attachments
    from a list item to a Document Library.
    About how to create a simple Event Receiver in SharePoint 2013:
    https://msdn.microsoft.com/en-us/library/ff398052.aspx
    Here is the related code I use in this scenario, you can use it as a reference:
    using System;
    using System.Security.Permissions;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Utilities;
    using Microsoft.SharePoint.Workflow;
    namespace SharePointProject13.EventReceiver1
    /// <summary>
    /// List Item Events
    /// </summary>
    public class EventReceiver1 : SPItemEventReceiver
    /// <summary>
    /// An item is being updated.
    /// </summary>
    public override void ItemUpdating(SPItemEventProperties properties)
    //base.ItemUpdating(properties);
    /// <summary>
    /// An item was added.
    /// </summary>
    public override void ItemAdded(SPItemEventProperties properties)
    // base.ItemAdded(properties);
    using (SPSite site = new SPSite("http://sp/"))
    SPList docDestination = site.RootWeb.Lists["Document"];
    SPList lstAttachment = site.RootWeb.Lists["List1"];
    SPFolder fldRoot = site.RootWeb.Folders[docDestination.Title];
    SPFileCollection flColl = null;
    if (properties.ListItem.Attachments != null && properties.ListItem.Attachments.Count > 0)
    foreach (String strName in properties.ListItem.Attachments)
    flColl = fldRoot.Files;
    SPListItem listtem = docDestination.Items.Add();
    SPFile FileCopy = properties.ListItem.ParentList.ParentWeb.GetFile(properties.ListItem.Attachments.UrlPrefix + strName);
    string destFile = flColl.Folder.Url + "/" + FileCopy.Name;
    byte[] fileData = FileCopy.OpenBinary();
    SPFile flAdded = flColl.Add(destFile, fileData, site.RootWeb.CurrentUser, site.RootWeb.CurrentUser, Convert.ToDateTime(properties.ListItem[SPBuiltInFieldId.Created]), Convert.ToDateTime(properties.ListItem[SPBuiltInFieldId.Modified]));
    SPListItem item = flAdded.Item;
    item[SPBuiltInFieldId.Created] = Convert.ToDateTime(properties.ListItem[SPBuiltInFieldId.Created]);
    item[SPBuiltInFieldId.Modified] = Convert.ToDateTime(properties.ListItem[SPBuiltInFieldId.Modified]);
    flAdded.Item.Update();
    How it works in my environment:
    Add an item with attachment in List1:
    In the Document Library, we can see the uploaded attachment there:
    Best regards
    Patrick Liang
    TechNet Community Support

  • Query list items and display in client webpart..

    I am using the code below to display list items in clientwebpart but getting errors.Below is the code written in js file..What is wrong with the code??
    Error:javaScript runtime error: Unable to set property 'innerText' of undefined or null reference 
    'use strict';
    var context = SP.ClientContext.get_current();
    var user = context.get_web().get_currentUser();
    var web;
    var spHostUrl;
    var parentcontext;
    spHostUrl = decodeURIComponent(getQueryStringParameter('SPHostUrl'));
    parentcontext = new SP.AppContextSite(context, spHostUrl);
    web = parentcontext.get_web();
    var list = web.get_lists().getByTitle("ListsTask");
    var camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml("");
    this.listItems = list.getItems(camlQuery);
    context.load(listItems);
    context.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded),
        Function.createDelegate(this, this.onQueryFailed));
    // This code runs when the DOM is ready and creates a context object which is needed to use the SharePoint object model
    $(document).ready(function () {
        getUserName();
    // This function prepares, loads, and then executes a SharePoint query to get the current users information
    function getUserName() {
        context.load(user);
        context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);
    // This function is executed if the above call is successful
    // It replaces the contents of the 'message' element with the user name
    function onGetUserNameSuccess() {
        $('#message').text('Hello ' + user.get_title());
    // This function is executed if the above call fails
    function onGetUserNameFail(sender, args) {
        alert('Failed to get user name. Error:' + args.get_message());
    function getQueryStringParameter(urlParameterKey) {
        var params = document.URL.split('?')[1].split('&');
        var strParams = '';
        for (var i = 0; i < params.length; i = i + 1) {
            var singleParam = params[i].split('=');
            if (singleParam[0] == urlParameterKey)
                return decodeURIComponent(singleParam[1]);
        function onQuerySucceeded() {
            $("#results").empty();
            var listInfo = '';
            var listEnumerator = listItems.getEnumerator();
            listInfo += "<table><tr><th>Id</th><th>Title</th></tr>";
            while (listEnumerator.moveNext()) {
                var listItem = listEnumerator.get_current();
                listInfo += '<tr><td>' + listItem.get_item('ID') + '</td>'
                    + '<td>' + listItem.get_item('Title') + '</td>'
                    + '</tr>\n';
            listInfo += '</table>';
            $("#results").html(listInfo);
        function onQueryFailed(sender, args) {
            $("#results").empty();
            $("#results").text('Request failed. ' + args.get_message() +
                '\n' + args.get_stackTrace());

    HI,
    I have modified your code.
    'use strict';
    var context = SP.ClientContext.get_current();
    var user = context.get_web().get_currentUser();
    var web;
    var spHostUrl;
    var parentcontext;
    spHostUrl = decodeURIComponent(getQueryStringParameter('SPHostUrl'));
    parentcontext = new SP.AppContextSite(context, spHostUrl);
    web = parentcontext.get_web();
    // This code runs when the DOM is ready and creates a context object which is needed to use the SharePoint object model
    $(document).ready(function () {
        getUserName();
        getitems();
    // This function prepares, loads, and then executes a SharePoint query to get the current users information
    function getUserName() {
        context.load(user);
        context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);
    function getitems()
        var list = web.get_lists().getByTitle("ListsTask");
        var camlQuery = new SP.CamlQuery();
        camlQuery.set_viewXml("");
        this.listItems = list.getItems(camlQuery);
        context.load(listItems);
        context.executeQueryAsync(onQuerySucceeded1, onQueryFailed1);
    // This function is executed if the above call is successful
    // It replaces the contents of the 'message' element with the user name
    function onGetUserNameSuccess() {
        $('#message').text('Hello ' + user.get_title());
    // This function is executed if the above call fails
    function onGetUserNameFail(sender, args) {
        alert('Failed to get user name. Error:' + args.get_message());
    function getQueryStringParameter(urlParameterKey) {
        var params = document.URL.split('?')[1].split('&');
        var strParams = '';
        for (var i = 0; i < params.length; i = i + 1) {
            var singleParam = params[i].split('=');
            if (singleParam[0] == urlParameterKey)
                return decodeURIComponent(singleParam[1]);
        function onQuerySucceeded1() {
            $("#results").empty();
            var listInfo = '';
            var listEnumerator = listItems.getEnumerator();
            listInfo += "<table><tr><th>Id</th><th>Title</th></tr>";
            while (listEnumerator.moveNext()) {
                var listItem = listEnumerator.get_current();
                listInfo += '<tr><td>' + listItem.get_item('ID') + '</td>'
                    + '<td>' + listItem.get_item('Title') + '</td>'
                    + '</tr>\n';
            listInfo += '</table>';
            $("#results").html(listInfo);
        function onQueryFailed1(sender, args) {
            $("#results").empty();
            $("#results").text('Request failed. ' + args.get_message() +
                '\n' + args.get_stackTrace());
    But still not able to get list items, i m finding soultion.
    Thanks
    varinder

  • Click list item and display the image

    I have a database table:
    + One column includes names of the employee
    + Another includes the path of the file of corresponding employee's images
    I have added all the names into a JList
    Now, what I want to do is that: When I click on the item in the list, the image of the employee corresponding to the item will display in the frame.
    Could any of you help me?
    Any help will be appreciated.
    Thanks.

    Hi Sunitha,
    According to your description, my understanding is that you want to change the list title to an image.
    I recommend to add the code below to the list page:
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script><script type="text/javascript">
    $(document).ready(function (){
    var s = "<img alt='SP' src='http://w2k81368:2116/SiteAssets/Test.jpg'>";
    var $t = $("#DeltaPlaceHolderPageTitleInTitleArea span span a");
    $t.html(s);
    </script>
    After that, the list title will change to the image and it will show allitems.aspx page when clicking the image.
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

Maybe you are looking for