Changing Selected list item

Hello, I've been killing myself looking for a solution to
this problem:
I have a master/detail setup, with the detail being a form.
The initial values of the form come from the dataset.
This form includes a dropdown list/menu.
I need that menu to show the current value as selected.
I have extensively googled the issue, but all of the
solutions I have come across do it via PHP.
Unless there is something you're not telling me, I can't use
PHP in this situation.
Is there an if/else function in spry that allows me to write
an attribute like that?
Please, I really need to get this problem out of the way.
Thanks

No, the list is not supposed to set off any spry actions.
It is simply a list generated by php from a database. What I
would like to know is how to set a specific item in that list as
"SELECTED" so that if the user changes something in the form and
submits it, that doesn't always reset back to the first one.
The form is as follows right now:
<select name="status">
<option value="1">New</option>
<option value="2">Viewed</option>
<option value="3">Pending</option>
<option value="4">Discarded</option>
<option value="5">Done</option>
</select>
In the dataset is a field that is one of those number (1-5).
What I want to do is have ' selected="selected" on the option
that corresponds to that data.
Would it be possible to do this with javascript using
something like "document.someform.status.option[3].selected"?
or is there some kind of spry option to do:
if (dsData::status=this.value) output "selected="selected"

Similar Messages

  • 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

  • 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

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

  • 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

  • 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

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

  • 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

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

  • Dynamically changing the list item based on another list item

    Hi all,
    I have two fields that are list items.
    First list item contain two list values: Regular and One-time
    In second list item if user select the Regular then below values should appear:
    Daily wages
    Activity Linked
    Fixed Contracts.
    Contract Staff
    Outsourced
    if user select the one-time then below values should appear:
    Projects
    Repairs & Maint.
    Please do the needful.

    First list item contain two list values: Regular and One-timeYou simply need to add a conditional check to the When-List-Changed (WLC) trigger to see which value was selected. Then, as Manu suggests, you will populate the Poplist based on the selected value.
    For an example of how to dynamically populate a Poplist item, take a look at: Forms: How to Dynamically Populate a Poplist.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

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

  • How do I change multiple list items at once in a SharePoint list with ribbon button

    Hi
    I have a sharepoint list and a ribbon button that open a dialog box with buttons to set color on a row
    The problem is that i can only selecet one item at once to set the color. 
    How can i do so it could set all or a couple items att once to the color i want 
    I want to do this with javascript
    here is the code i use to get the item id and the color code is in a seperate js file
    'use strict';
    var clientContext, hostweburl, parentContext, parentWeb, selectedItem, itemId, listId;
    clientContext = new SP.ClientContext.get_current();
    hostweburl = decodeURIComponent(getQueryStringParameter("SPHostUrl"));
    listId = decodeURIComponent(getQueryStringParameter("SPListId"));
    itemId = decodeURIComponent(getQueryStringParameter("SPListItemId"));
    parentContext = new SP.AppContextSite(clientContext, hostweburl);
    parentWeb = parentContext.get_web();
    selectedItem = parentWeb.get_lists().getById(listId).getItemById(itemId);
    $(document).ready(function () {
    clientContext.load(selectedItem);
    clientContext.executeQueryAsync(OnSuccess, OnFail);
    function OnSuccess() {
    $("#Blue").click(function () {
    selectedItem.set_item('Color', 'Blue');
    selectedItem.update();
    clientContext.load(selectedItem);
    clientContext.executeQueryAsync(function () { window.parent.postMessage('CloseCustomActionDialogRefresh', '*'); }, function (sender, args) { alert('Error:' + args.get_message()); });
    $("#Green").click(function () {
    selectedItem.set_item('Color', 'Green');
    selectedItem.update();
    clientContext.load(selectedItem);
    clientContext.executeQueryAsync(function () { window.parent.postMessage('CloseCustomActionDialogRefresh', '*'); }, function (sender, args) { alert('Error:' + args.get_message()); });
    $("#Red").click(function () {
    selectedItem.set_item('Color', 'Red');
    selectedItem.update();
    clientContext.load(selectedItem);
    clientContext.executeQueryAsync(function () { window.parent.postMessage('CloseCustomActionDialogRefresh', '*'); }, function (sender, args) { alert('Error:' + args.get_message()); });
    $("#Transparent").click(function () {
    selectedItem.set_item('Color', 'No Color');
    selectedItem.update();
    clientContext.load(selectedItem);
    clientContext.executeQueryAsync(function () { window.parent.postMessage('CloseCustomActionDialogRefresh', '*'); }, function (sender, args) { alert('Error:' + args.get_message()); });

    Check if below can help you
    http://sp2010batchedit.codeplex.com/
    http://sharepoint.stackexchange.com/questions/35935/use-view-ribbon-custom-action-on-multiple-list-items
    http://webcache.googleusercontent.com/search?q=cache:XqMO-PRLHQIJ:dannyjessee.com/blog/index.php/2014/06/enabling-custom-ribbon-buttons-dynamically-based-on-multiple-selected-item-values-using-refreshcommandui-and-jsom/+&cd=1&hl=en&ct=clnk&gl=in
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction Id="DannyJessee.TestCustomAction"
    Location="CommandUI.Ribbon"
    RegistrationId="100"
    RegistrationType="List">
    <CommandUIExtension>
    <CommandUIDefinitions>
    <CommandUIDefinition
    Location="Ribbon.ListItem.Actions.Controls._children">
    <Button Id="DannyJessee.MarkItemsFinishedButton"
    Command="cmdMarkItemsFinished"
    Image16by16="/_layouts/images/kpinormallarge-0.gif"
    Image32by32="/_layouts/images/kpinormallarge-0.gif"
    LabelText="Mark as Finished"
    TemplateAlias="o2" />
    </CommandUIDefinition>
    </CommandUIDefinitions>
    <CommandUIHandlers>
    <CommandUIHandler Command="cmdMarkItemsFinished"
    CommandAction="javascript:MarkItemsFinished();"
    EnabledScript="javascript:EnableFinishedButton();">
    </CommandUIHandler>
    </CommandUIHandlers>
    </CommandUIExtension>
    </CustomAction>
    <CustomAction Id="DannyJessee.TestScript"
    Location="ScriptLink"
    ScriptSrc="/_layouts/15/CustomRibbonButton/CustomAction.js" />
    </Elements>
    If this helped you resolve your issue, please mark it Answered

Maybe you are looking for

  • Communication channel error

    Hi All, I am getting an error in my communication channel such that ...          Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSource

  • Cant rotate a page in acrobat x

    Hi, In a 10 page document for example, 1 page happens to be oriented the wrong way. I want to rotate it. I highlight the page and using panel on the right hand side click rotate then select page or pages and then ok. But it does not rotate the page a

  • Remove leading with negative values

    Hello Expert, I have requirement in mapping where the QuantityShipped field values coming from the file and after transfomation the below output need to be mapped in the Idoc target filed MENGE. QuantityShipped filed defined as a sting in the datatyp

  • A single OBIEE report firing Multiple Queries

    HI All, I tried the search option and did not find any questions which gives me what I am looking for. If I missed it and the question is already asked, please redirect me to the thread. I had a report which had a data issues. When i checked the log,

  • Lib32 R300 DRI users: lib32-ati-dri needed?

    Hi, I made a PKGBUILD for lib32-ati-dri but I wanted check if it's really needed or is it just something funny with my system. Could R300 DRI users report that do they get direct rendering in 32bit without it. The thing is when I run: LIBGL_DEBUG=1 /