Using a Dropdown Value to Set Criteria for Queries

Hey,
I am first trying to create a Dropdown box, should I just use HTML or should using APEX components... The values are stored in a table.
I want to have the users have the ability to select a value from the drop down, and depending on what value they picked, it would display reports for that value selected either on a seperate tab or the same tab.
Could you guys help me figure this one out?
Basically I don't want to change my queries everymonth, since the value that users would select is a month value. Any ideas?
Any help is appreciated... Thank you.

Hi Max,
First, if you are using an APEX development environment, by all means, use the APEX components. They make life a lot easier compared to hand coded HTML.
Next, the ability to configure an SQL WHERE clause with the selection from a drop down list is a "bread and butter" APEX function. For example, if you have an LOV with the months in it (P10_MONTH), then you could put the following line in your report's WHERE clause:
AND :P10_MONTH = EXTRACT (MONTH FROM YOUR_DATE_COLUMN)
This assumes that the LOV that is bound to P10_MONTH has an ID and a DESCRIPTION where the ID is configured to be the month's number (1 for Jan, 2 for Feb etc).
Note that for production code you would also have to handle the year as well.
It sounds like you are new to APEX. If so, take some time to work through the two day developer document. This is a very quick (couple of days) way to get up and running with APEX. In general, the learning curve with APEX is much much easier that with environments like J2EE and .NET.
For your immediate project, look explicitly for the terms "bind variable" and List of Values (LOV).
Hope this helps,
Cheers,
Patrick Cimolini

Similar Messages

  • Add new dropdown value in search criteria for Invoices

    Hello,
    I want to add one more value in Drop-Down box of the search criteria of invoices.
    As on now there are 2 DropDown boxes
    in Your Referance No
    in Transaction No
    (New)
    in Order No (This will have search value as "Sales Order No")
    Can anyone tell how to add this inw value?
    I have created YDocumentListSelectorForm.java extending DocumentListSelectorForm.
    public static final String INORDERNO = "inorderno";
    if("inorderno".equals(attribute))
              documentListFilter.setId(attributeValue);
    YBillingStatusCRM.java is created which extends BillingStatusCRM.class
    com.sap.mw.jco.JCO.Function billingListJCO = connection.getJCoFunction("YCRM_ISA_INVOICE_LIST_GET");
    if(billingList.getFilter().getExternalRefNo() != null && !billingList.getFilter().getExternalRefNo().equals(""))
              importParams.setValue(billingList.getFilter().getExternalRefNo(), "ORDERNO_FROM");
    Accessing it in JSP organizer-content-doc-search.jsp
    YDocumentListSelectorForm yform =
        (YDocumentListSelectorForm)pageContext.findAttribute("YDocumentListSelectorForm");
    <option value="<%=YDocumentListSelectorForm.INORDERNO%>" <%=form.isAttribute(form.INORDERNO) ? "selected" : ""%>> New Value</option>
    Regards,
    Shaun
    Edited by: Shaun07 on Aug 5, 2010 7:29 AM

    Hello,
    I want to add one more value in Drop-Down box of the search criteria of invoices.
    As on now there are 2 DropDown boxes
    in Your Referance No
    in Transaction No
    (New)
    in Order No (This will have search value as "Sales Order No")
    Can anyone tell how to add this inw value?
    I have created YDocumentListSelectorForm.java extending DocumentListSelectorForm.
    public static final String INORDERNO = "inorderno";
    if("inorderno".equals(attribute))
              documentListFilter.setId(attributeValue);
    YBillingStatusCRM.java is created which extends BillingStatusCRM.class
    com.sap.mw.jco.JCO.Function billingListJCO = connection.getJCoFunction("YCRM_ISA_INVOICE_LIST_GET");
    if(billingList.getFilter().getExternalRefNo() != null && !billingList.getFilter().getExternalRefNo().equals(""))
              importParams.setValue(billingList.getFilter().getExternalRefNo(), "ORDERNO_FROM");
    Accessing it in JSP organizer-content-doc-search.jsp
    YDocumentListSelectorForm yform =
        (YDocumentListSelectorForm)pageContext.findAttribute("YDocumentListSelectorForm");
    <option value="<%=YDocumentListSelectorForm.INORDERNO%>" <%=form.isAttribute(form.INORDERNO) ? "selected" : ""%>> New Value</option>
    Regards,
    Shaun
    Edited by: Shaun07 on Aug 5, 2010 7:29 AM

  • Setting Default Values in Search Criteria for COSTCENTER

    Hi ALL,
    I need Help for setting default values in search criteria for COST CENTER.
    Basically the issue is when creating a Shopping Cart, i need to assign a COST CENTER at Item level under COST ASSIGNMENT Tab.
    While searching the cost center i need to default the following fields in my search criteria based on the Login User :
    1. Controlling Area,
    2. Language Key.
    Please suggest some solution.
    Thanks & Best Regards,
    Surya

    Hi Vani,
    Sorry for the delay reply and Thanks a Lot for your timely support......I would like confirm once again is the name of the BADI is <b>bbp_f4_read_on_exit</b> or <b>bbp_f4_read_on_entry</b>. In this BADI i've not found a method to default Controlling Area. Can you please suggest me which method i can use.
    Thanks & Regards,
    Surya

  • How to use this CF - BAPI_SALESORDER_CHANGE to set reason for rejec in VA02

    Hi gurus,
    Can anybody guide me how can i use this Call function in the program to change sales order item data.
    Requirement:
    I want to set an Reason for Rejection in Open sales orders .
    how should i use this call function in program so that i can set - Reason for Rejection in Sales Orders.
    Guru's please give in detail like what parameters should i pass and where should i pass.
    Regards.
    S.Saravanan

    Hi,
    Use field REASON_REJ ad pass the reason code to item structure and set the flag for the item in ITEMX table.
    For more info, look for the where used list of the BAPI 'BAPI_SALESORDER_CHANGE' or search the forum.
    Regards
    Shiva

  • How to use a subreport field as selection criteria for the main report

    Dear All,
       I created a report with one subreport and im comparing information from both reports but i need to apply selection criteria in the main report using one of the fields in the subreport, the problem is that the subreport field doesnt appear in the select expert screen. By any chance, someone knows how make a subreport field be used by the select expert.
    Thanks,
    Martha Medrano

    Dear Dom,
       I created the subreport table called IIM (748 items) in sql in the main report as you suggested with the below code:
    SELECT "IIM"."IPROD", "IIM"."IDESC", "IIM"."IID"
    FROM   "S102F360"."BPCS405CDF"."IIM" "IIM"
    WHERE   NOT ("IIM"."IDESC" LIKE 'GEN%' OR "IIM"."IDESC" LIKE 'OBS%') AND "IIM"."IID"<>'IZ' AND "IIM"."IPROD" LIKE '3%'
    and i have another table called ITEM_MASTER (3221 items):
    SELECT "ITEM_MASTER"."ITEM_ID", "ITEM_MASTER"."DESCRIPTION"
    FROM   "WHSPRO"."dbo"."ITEM_MASTER" "ITEM_MASTER"
    ORDER BY "ITEM_MASTER"."ITEM_ID"
    and im trying to display all items in the ITEM_MASTER table that are not in the IIM file but i haven't been able to accomplish this, i am using as primary the ITEM_MASTER table with 'Inner Join' as Join Type,  and '!=" as Link Type. Do you have any ideas on how can i display the requested items.
    Thanks for your help

  • Use session state values to set column value during insert/update

    I am building an APEX 4.2 application that uses the canned Data Loading control to upload csv data to a table.  I have modified the 'Select Data Source' page of the workflow and it now contains three LOV's that the user selects values from.  The selected values are stored in Session State.  As I'm new to APEX, I do not know how to reference Session State objects in the context of the Data Loading workflow so that the appropriate columns are set with the correct values.  My assumption is that the columns that are apart of the insert statement reside in a collection somewhere.  I just don't know how to loop through the collection, determine the correct column, and then set that column's value equal to the corresponding LOV value in Session State.

    Scott,
    This is in version 2.2.1 and there are no caching features available.
    The application does require login.
    I'm playing around with the APP_UNIQUE_PAGE_ID right now but I am finding that even in the builder if I edit the attributes of a report column and then try to edit another column it will bring up the last column I edited. Even if I use the record navigation buttons next to the Apply Changes button it will keep bringing me the same page over and over unless I constantly refresh the pages.
    Greg

  • SDK service using domain user trying to set SPN for computer account

    I have a SDK service running under a domain user account, but it tries to register the SPN for the computer account of the machine?!
    Therefore I get the following alert: 
    The System Center Data Access service failed to register an SPN. A domain admin needs to add MSOMSdkSvc/WIN-9IAJC0HS9RJ and MSOMSdkSvc/WIN-9IAJC0HS9RJ.domainxx.local to the servicePrincipalName of CN=WIN-9IAJC0HS9RJ,CN=Computers,DC=domainxx,DC=local
    Which makes sense because it has not the permissions to do that.
    When I make the domain user account member of domain admins it has the concerning permissions and it indeed registers that SPN to the computer account. But why?? The SPN should be registered to the domain user account instead (and therefore I had given the
    domain user account the read/write permissions to itself to do that).
    I have the following SPN registered now for the computer and domain user account:
    setspn -l WIN-9IAJC0HS9RJ
    Registered ServicePrincipalNames for CN=WIN-9IAJC0HS9RJ,CN=Computers,DC=domainxx
    DC=local:
            MSOMSdkSvc/WIN-9IAJC0HS9RJ
            MSOMSdkSvc/WIN-9IAJC0HS9RJ.domainxx.local
            MSOMHSvc/WIN-9IAJC0HS9RJ
            MSOMHSvc/WIN-9IAJC0HS9RJ.domainxx.local
            TERMSRV/WIN-9IAJC0HS9RJ
            TERMSRV/WIN-9IAJC0HS9RJ.domainxx.local
            WSMAN/WIN-9IAJC0HS9RJ
            WSMAN/WIN-9IAJC0HS9RJ.domainxx.local
            RestrictedKrbHost/WIN-9IAJC0HS9RJ
            HOST/WIN-9IAJC0HS9RJ
            RestrictedKrbHost/WIN-9IAJC0HS9RJ.domainxx.local
            HOST/WIN-9IAJC0HS9RJ.domainxx.local
    setspn -l domainxx\omdas
    Registered ServicePrincipalNames for CN=OMDAS,CN=Users,DC=domainxx,DC=local:
    none for this account
    I don't get it. Anyone?
    I am using SCOM 2012 R2
    Pls help.
    Thanx in advance.
    Regards
    Chris

    SCOM SDK service really tries to set its SPN to the computer account (although the SDK service is running using a domain user account). The alert is no bug!
    I know this for sure because I gave the SDK service permission to do it - by making the domain user account member of the domain admins security group - and it indeed sets the SPN on the computer account.
    The latter is the actual bug I would say! It should try to set the SPN for the domain user account the sdk service is running with.
    Then again, nog having the SPN been set correctly to this domain user account, does not seem to bother SCOM at all indeed. Perhaps it uses NTLM instead in this scenario.
    Can anyone comfirm?

  • What settings do I use to back button focus set up for the d5 mark 3? TIA

    5D Mark 3
    Solved!
    Go to Solution.

    When you activate the menu, scroll over (using the dial on the front of the camera) to the orange "C.Fn2: Disp./Operation" menu. (that's the icon of a camera that has a index marks for a light meter below it -- right of the wrench icon, left of the star icon.)
    Each of those menu's on the 5D III have multiple pages.  It's the 2nd page (the 2nd dot from the left) that has the category for "Custom Controls".  Highlight that (using the dial on the back this time) and click the 'set' button.
    That brings up a menu showing each of the major controls on the back of the camera and what they do.  Highlight the icon for the shutter button (this only changes the behavior of a half-press) and change it from "Metering and AF start" to just "Metering start".
    The "AF-ON" button (on the back of your camera) is likely already set to "Metering and AF start" (I believe that's the factory default.)  
    So you're not so much enable back-button focus (which is already probably active)... you're more "disabling" the focus when  the shutter button is pressed half-way.
    Good luck
    Tim Campbell
    5D II, 5D III, 60Da

  • Setting criteria for pc sync with ipad

    i dont want all my music to sync with my ipad.  is there an easy way (such as rating) to restrict a lot of my music filling my ipad unnecessarily.  or is there a way that is even more easy and less time consuming

    Create playlist(s) and sync only those.
    For Ratings, create a smart playlist;
    Match rule;
    Rating is greater than 3 stars (or whatever you want)

  • Using unbounded item value for rendering expression in a region

    Hi there,
    I use jheadstart 11g tp2.
    I have a question about a group in application definition module which all of the items are unbounded.
    For 3 of them I use text input lov which related to lov that is bounded to a view.
    I use the return value of the lov for filling unbounded items and I want to use that filled unbounded item for rendering expression of a region.
    my problem is after using lov I can't use the binding value of the unbound item (which filled by returning value from lov) for another part of the the group
    I have a region that should be visible and invisible based on that item
    Please let me know is there anyway for doing this or not?
    Thanks for your help
    Setareh Rajaei

    the unbound item has a variable binding in the page def, so you can refer to the value of the unbound item using the expression
    #{bindings.[groupName][itemName].inputValue}
    Steven Davelaar,
    Jheadstart Team.

  • SLED for selection criteria for batch search

    good day gurus,
    Is it possible to use SLED (LOBM_VFDAT) as a selection criteria for my batch search? how do i set this up?
    Thanks in advance
    Edited by: obie villamosa on Jun 30, 2008 11:06 AM

    hi
    maintained class in t-code CL01 for you characteristics then sort sequence CU70 as per shelf life, setting expiration date check by OMJE for your plamt and movment type,
    maintained strategy type in spro in production
    Define Batch search procedure and assign your strategy there.
    then allocate your search procedure to your plant in spro
    and then maintained condition type in t -code COB1 for your plant.
    also maintained your class in material master in classification view for batch class
    Regards
    Pravin
    Edited by: pravin dhokey on Jun 30, 2008 8:07 AM

  • Getter/setter methods -- how do I use the return values

    I'm just learning Java, and I haven't been to this site since the end of July, I think. I have a question regarding getter and setter methods. I switched to the book Head First Java after a poster here recommended it. I'm only about a hundred pages into the book, so the code I'm submitting here reflects that. It's the beginnings of a program I'd eventually like to complete that will take the entered information of my CD's and alphabetize them according to whatever criteria I (or any user for that matter) choose. I realize that this is just the very beginning, and I don't expect to have the complete program completed any time soon -- it's my long term goal, but I thought I could take what I'm learning in the book and put it to practical use as I go along (or at lest try to).
    Yes I could have this already done it Excel, but where's the fun and challenge in that? :) Here's the code:
    // This program allows the user to enter CD information - Artist name, album title, and year of release -- and then organizes it according the the user's choice according to the user's criteria -- either by artist name, then title, then year of release, or by any other order according to the user's choice.
    //First, the class CDList is created, along with the necessary variables.
    class CDList{
         private String artistName;//only one string for the artist name -- including spaces.
         private String albumTitle;//only one string the title name -- including spaces.
         private int yearOfRelease;
         private String recordLabel;
         public void setArtistName(String artist){
         artistName = artist;
         public void setAlbumTitle(String album){
         albumTitle = album;
         public void setYearOfRelease(int yor){
         yearOfRelease = yor;
         public void setLabel(String label){
         recordLabel = label;
         public String getArtistName(){
         return artistName;
         public String getAlbumTitle(){
         return albumTitle;
         public int getYearOfRelease(){
         return yearOfRelease;
        public String getLabel(){
        return recordLabel;
    void printout () {
           System.out.println ("Artist Name: " + getArtistName());
           System.out.println ("Album Title: " + getAlbumTitle());
           System.out.println ("Year of Release: " + getYearOfRelease());
           System.out.println ("Record Label: " + getLabel());
           System.out.println ();
    import static java.lang.System.out;
    import java.util.Scanner;
    class CDListTestDrive {
         public static void main( String[] args ) {
              Scanner s=new Scanner(System.in);
              CDList[] Record = new CDList[4];
              int x=0;     
              while (x<4) {
              Record[x]=new CDList();
              out.println ("Artist Name: ");
              String artist = s.nextLine();
              Record[x].setArtistName(artist);
              out.println ("Album Title: ");
              String album = s.nextLine();
              Record[x].setAlbumTitle(album);
              out.println ("Year of Release: ");
              int yor= s.nextInt();
                    s.nextLine();
              Record[x].setYearOfRelease(yor);
              out.println ("Record Label: ");
              String label = s.nextLine();
              Record[x].setLabel(label);
              System.out.println();
              x=x+1;//moves to next CDList object;
              x=0;
              while (x<4) {
              Record[x].getArtistName();
              Record[x].getAlbumTitle();
              Record[x].getYearOfRelease();
              Record[x].getLabel();
              Record[x].printout();
              x=x+1;
                   out.println("Enter a Record Number: ");
                   x=s.nextInt();
                   x=x-1;
                   Record[x].getArtistName();
                Record[x].getAlbumTitle();
                Record[x].getYearOfRelease();
                Record[x].getLabel();
                Record[x].printout();
         }//end main
    }//end class          First, I'd like to ask anyone out there to see if I could have written this any more efficiently, with the understanding that I'm only one hundred pages into the book, and I've only gotten as far as getter and setter methods, instance variables, objects and methods. The scanner feature I got from another book, but I abandoned it in favor of HFJ.
    Secondly --
    I'm confused about getter and setter methods -- I'd like someone to explain to me what they are used for exactly and the difference between the two. I have a general idea, that getters get a result from the method and setters set or maybe assign a value to variable. I submitted this code on another site, and one of the responders told me I wasn't using the returned values from the getter methods (he also told me about using a constructor method, but I haven't got that far in the book yet.). The program compiles and runs fine, but I can't seem to figure out how I'm not using the returned values from the getter methods. Please help and if you can explain in 'beginners terms,' with any code examples you think are appropriate. It will be greatly appreciated.
    By the way, I'm not a professional programmer -- I'm learning Java because of the intellectual exercise and the fun of it. So please keep that in mind as well.
    Edited by: Straitsfan on Sep 29, 2009 2:03 PM

    Straitsfan wrote:
    First, I'd like to ask anyone out there to see if I could have written this any more efficiently, with the understanding that I'm only one hundred pages into the book, and I've only gotten as far as getter and setter methods, instance variables, objects and methods. The scanner feature I got from another book, but I abandoned it in favor of HFJ.Yes, there is tons you could have done more efficiently. But this is something every new programmer goes through, and I will not spoil the fun. You see, in 3 to 6 months when you have learned much more Java, assuming you stick with it, you will look back at this and be like "what the hell was I thinking" and then realize just haw far you have come. So enjoy that moment and don't spoil it now by asking for what could have been better/ more efficient. If it works it works, just be happy it works.
    Straitsfan wrote:
    Secondly --
    I'm confused about getter and setter methods -- I'd like someone to explain to me what they are used for exactly and the difference between the two. I have a general idea, that getters get a result from the method and setters set or maybe assign a value to variable. I submitted this code on another site, and one of the responders told me I wasn't using the returned values from the getter methods (he also told me about using a constructor method, but I haven't got that far in the book yet.). The program compiles and runs fine, but I can't seem to figure out how I'm not using the returned values from the getter methods. Please help and if you can explain in 'beginners terms,' with any code examples you think are appropriate. It will be greatly appreciated.
    By the way, I'm not a professional programmer -- I'm learning Java because of the intellectual exercise and the fun of it. So please keep that in mind as well.First, if you posted this somewhere else you should link to that post, it is good you at least said you did, but doubleposting is considered very rude because what inevitably happens in many cases is the responses are weighed against each other. So you are basically setting anyone up who responds to the post for a trap that could make them look bad when you double post.
    You are setting you getters and setters up right as far as I can tell. Which tells me that I think you grasp that a getter lets another class get the variables data, and a setter lets another class set the data. One thing, be sure to use the full variable name so you should have setRecordLabel() and getRecodLabel() as opposed to setLabel() and getLabel(). Think about what happens if you go back and add a label field to the CDList class, bad things the way you have it currently. Sometimes shortcuts are not your friend.
    And yes, you are using the getters all wrong since you are not saving off what they return, frankly I am suprised it compiles. It works because you don't really need to use the getters where you have them since the CDList Record (should be lowercase R by the way) object already knows the data and uses it in the printout() method. Basically what you are doing in lines like:
    Record[x].getArtistName();is asking for the ArtistName in Record[x] and then getting the name and just dropping it on the floor. You need to store it in something if you want to keep it, like:
    String artistName = Record[x].getArtistName();See how that works?
    Hope this helped, keep up the good learning and good luck.
    JSG

  • How to use bind variable value of one VO as initial value for other VO row?

    JDeveloper 10.1.3.3, ADF Faces, ADF BC
    Hi,
    I have two View Objects: one read only with several bound variables and another editable entity based. Correspondingly there are two ADF Faces pages: first contains search form based on the read-only VO and second create form based on the editable VO. The search form has several hidden fields for some of bound variables because they aren't edited directly by user. These fields are updated with PPR when user selects other search criteria from LOV.
    There is a command button in the first page that navigates to the second form. Is there any way to transfer values of bound variables from the first VO to the second VO as initial values of the new row?
    I tried to set custom controller for the second page and retrieve search criteria values from request parameter map but values from hidden fields are missing. I think because that these fields are updated by PPR. Of course I can add custom action method to the navigation button and in the method put these values to request parameter map but I hope there is better solution.
    Thanks,
    Marius

    To summarize, given a bind variable value for one VO, on creating a row in a second VO, for 1 of the attributes of the second VO, you want to use the first VO's bind variable value. Correct?
    A potential solution ADF BC driven:
    1) Ensure you have an AppModuleImpl for your AM
    2) Ensure you have a ViewImpl for your 1st VO (where the bind variable will exist) - lets refer to that VO as "Alpha"
    3) Ensure you have a ViewRowImpl for your 2nd VO (the one you want to default the value in) - lets refer to that VO as "Beta"
    4) For your first VO "Alpha" create the bind variable (say pValue)
    5) In your second VO "Beta" ViewRomImpl add following code:
    @Override
    protected void create(AttributeList attributeList) {
      super.create(attributeList);
      AppModuleImpl am = (AppModuleImpl)this.getApplicationModule();
      String someValue = am.getAlphaView1().getpValue();
      setSecondVOAttr(someValue); // change this code to whatever your setter is for the field you want to initialize.
    }Hope this helps. Let us know how you go.
    Regards,
    CM.

  • Using a dropdown to set a radio button

    I've been searching and searching in vain, trying many different things can I cannot seem to find an answer already or stumble on similar code to help.
    I've got a dropdown, then when you select different values set different fields on the form. That part works fine stuff like this in the custom validate:
    if (event.value == "Thing1") {
      this.getField("DESC01").value = "Words that fill in a desciption box.";
      this.getField("DESC02").value = "More words that fill in another descrption box";
      this.getField("F_SKILL1").value = "1";
      this.getField("RB_SKILL1").isBoxChecked(1);
      this.getField("F_SKILL2").value = "1";
      this.getField("F_SKILL3").value = "1";
    } else if (event.value == "Thing2") {
      this.getField("DESC01").value = "Different words that fill in a desciption box.";
      this.getField("DESC02").value = "More different words that fill in another descrption box";
      this.getField("F_SKILL4").value = "1";
      this.getField("RB_SKILL1").isBoxChecked(0);
      this.getField("F_SKILL5").value = "1";
      this.getField("F_SKILL6").value = "1";
    etc, etc. I've got a few different else ifs but they all follow this kind of format. There is are also radio button next to the skills on the sheet to visually display that skill is known. So I'd like to turn that radio button on. My isBoxChecked isn't working, and I expect that's because it doesn't work that way. I have a lot of radio buttons on the form, but they all have 1 choice in them none are groups. Again, I'm using this as a visual display that SKILLX is known. The area I've dropped the radio button onto the sheet is a very small circle which is why I am trying to use a radio button as it's visually similar.
    If there is a better solution to what I'm trying to do I'm happy to try that, or if someone can tell me what I'm doing wrong that'd be super
    Thanks!

    Not quite sure I'm getting what you are laying down...
    So in the dropbox, under options I should set the export value of Thing1 choice to RB_SKILL1 and then in my validate I should include this.getField("RB_SKILL1").value = 'Yes' ?
    Or I should just set the export value of Thing1 to this.getField?
    Thanks
    Oh, using a check box I was able to get this working using the export values set for Thing1 option, most excellent! Thank you very much!

  • CAML Query to get specific item in folder based on dropdown value using Javascript client object model

    Hi,
    I am using the Javascript Client object model.
    I have a custom list and a custom document library.
    Custom list contains 2 columns - dlName , dlValue
    The document library contains 2 folders - "folder1" ,  "folder2" and contains some images.
    The image name starts with the "dlValue" available in the custom list
    I am using a visual webpart and using javascript client object model.
    I am trying to achieve the below functionality:
    1) Load a dropdown with the custom list.
    2) set the image based on the value in dropdown.
    I have achieved the first option, I have set the dropdown, but not sure how to query the folder and set the image.
    Below is the code i have used so far:
    //In Visual webpart
    <select id="ddlTest" >
    </select>
    <br/>
    <div id="PreviewLayer">
    <img id="imgPlaceHolder" runat="server" alt="Image" title="imgPlaceHolder" src=" " />
    </div>
    // In Javascript file
    function RenderHtmlOnSuccess() {
    var ddlTest = this.document.getElementById("ddlTest");
    ddlTest.options.length = 0;
    var enumerator = this.customListItems.getEnumerator();
    while (enumerator.moveNext()) {
    var currentItem = enumerator.get_current();
    var dropdownValue = currentItem.get_item("dlValue");
    ddlTest.options[ddlTest.options.length] = new Option(currentItem.get_item("dlName"), dropdownValue);
    setImage(dropdownValue); // Not sure how to query the folder and set the image based on value.
    // Also if dropdown value is changed, corresponding image should be shown
    How to query the folder and based on dropdown value, show the image? Also, how to handle the dropdown value change?
    Thanks

    Hi,
    Here are two links for your reference:
    Example of how to Get Files from a Folder using Ecmascript \ Javascript client object model in SharePoint 2010
    http://sharepointmantra.wordpress.com/2013/10/19/example-of-how-to-get-files-from-a-folder-using-ecmascript-javascript-client-object-model-in-sharepoint-2010/
    SP2010 JSOM Client Object Model: How to get all documents in libraries including all folders recursively
    http://sharepoint.stackexchange.com/questions/70185/sp2010-jsom-client-object-model-how-to-get-all-documents-in-libraries-including
    In SharePoint 2013, we can also use REST API to achieve it.
    http://msdn.microsoft.com/en-us/magazine/dn198245.aspx
    Thanks,
    Dennis Guo
    TechNet Community 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]
    Dennis Guo
    TechNet Community Support

Maybe you are looking for

  • IPoc Classic 160GB will no longer sync

    Hi Guys, Another one to add to the list of bugs, or a faulty iPod? Got my iPod on Weds and synced over 120GB of music and videos, all fine. Synced it a couple of times since then and new content made it onto the iPod. Yesterday, went to sync it and a

  • Microsoft Office 2011 fails to work on new iMac

    I received my new iMac in mid December, and I used the Migration Assistant to move everything. Unsurprisingly, MS Office failed to work. I paid MS another $12 so I could download a new copy of MS Office 2011 and tried installing it. Installation succ

  • I can't find the Reset Security link under my security questions!

    Trying to purchase an app, I forgot my security questions when asked, so I searched high and low for a solution. I stumbled upon the FAQ and it told me there should be a Reset Security link somewhere there, but I can't find it! Keep in mind, I do hav

  • I updated to OsX mountain lion in August and since then my lines are overlapping on some things.

    I upgraded to osx mountain lion in August 2012 and since then I have had trouble with lines overlapping in some things.  To the point where I can't read the type. 

  • Database logical segment details..

    db: 11g OS: unix friends & gurus, I am trying to get database logical segment details along with datafile id and tablespace name... just want to confirm I'm progressing in right direction... trying to get following 1. owner, 2. segment_name, 3. parti