Dynamic query with drop down lists

I have two select queries in my program.
The first query is to obtain and then display the list of
clients.
The second query I want to display only projects which are
linked to a specific client.
<cfquery name="getClient" datasource="#request.DSN#">
Select tblClients.ClientID, tblClients.ClientName
From tblClients
Order by tblClients.ClientName</cfquery>
<cfquery name="getProjects" datasource="#Request.DSN#">
Select tblprojects.ProjectID, tblProject.Project,
tblProject.ProjectID
From tblProject, tblClients
WHERE tblClients.ClientID = tblProject.ClientID AND
tblClients.ClientID = #getClient.ClientID# </cfquery>
I am displaying the first select box ok and it is populated
with the correct information.
The second select box is ot quite correct. It is only
displaying one record - the first record in the file.
<select name="Client">
<cfoutput query="getclient">
<option
value="#getclient.ClientID#">#getclient.ClientName#</option>
</cfoutput>
</select>
<select name="Project">
<cfoutput query="getProject">
<option
value="#getProject.ProjectID#">#getProject.Project#</option>
</cfoutput>
</select>
Any ideas on how to correct this would be greatly
appreciated.
Kind regards

In your second query you are using the variable
#getClient.ClientID#
Outside of a <cfloop query=""> or a <cfoutput
query=""> CF assumes you meant
: #getClient.ClientID[1]# (which is the first record of the
getClient Query.
If you are trying to pull up a list of projects that are for
the getClient list, then try this instead
<cfquery name="getProjects" datasource="#Request.DSN#">
Select tblprojects.ProjectID, tblProject.Project,
tblProject.ProjectID
From tblProject, tblClients
WHERE tblClients.ClientID = tblProject.ClientID AND
tblClients.ClientID IN (#valuelist(getClient.ClientID)#)
</cfquery>
Valuelist changes any 'column' from a query into a list.
Hope this helps

Similar Messages

  • Dynamic table with drop down lists

    I have a Dynamic table with a header row, Section and footer row.
    Section has the following cells(columns): Cell1 (drop down with locations), button (to remove row), CCode (Color Code RAL), CName (color name).
    I'm starting with 1 row.
    now what I want to do is, when they select in CCode e.g. RAL 1003 (rawValue "1") then in CName the name "signal yellow" (rawValue "1") should appear.
    I'm using javascript
    My first problem is how do I know which value is chosen, because this isn't working:
    if  (this.rawValue == 1)
    xfa.host.messageBox('Today')
    and second how do I set the value in CName
    because this only sets it in the first CName cell:
    xfa.form.DataSheet.TechnicalInformation.Markings.THatchPatterns.Section.CName.rawValue = '1';
    Please help me, I'm totally lost

    solved the problem, instead on change event put script on exit event.
    and the following line does the trick:
    xfa.resolveNode("THatchPatterns.Section[" + this.parent.index + "]").CCode.rawValue = this.rawValue

  • Problems with drop-down list: old references still in the model

    Hi,
    I am getting in troubles with a drop-down list. I configured it as dynamic list and I specified a RFC to get the values. Sometimes when I edit the field  I get that the configuration for the dynamic list is lost and I have to specify again the call to the MF. I did this for a couple of times and my surprise is that the old references are still in the source code. I realized of that when I used the alias manager. The old reference were there with ENUM....To check if the old references are called I switched on the flash debug console and I show that the MF is called a lot of times...
    Anybody knows how to eliminate these old reference???'  One the collateral effects is that the first value of the list is always shown.
    Antonio

    Hi Antonio, hi Marcel,
    the OSS-ID is 0000337147/2007 and the final given answer from SAP was:
    <i>Dear Customer,
    finally I managed to repreduce your problem,
    and it's a bug.
    we will aim to fix it in next releases, and the new Flex 2.0 runtime
    should handle this case, once it will be availible.
    Regards,</i>
    So it might be fixed with the actual SP, but I don't know that for sure (I rather doubt it, to be honest).
    Best Regards,
       Benni
    PS: You might avoid the problem of re-defining the entry list, by defining it as a global entry list, not a dynamic. However, the top-most entry will still be shown!

  • Need help with drop down list in parameters

    Hi All,
    I have the following data set:
    DEPT1     DEPT2     DEPT3 DEPT4
    Commissioner's Office     Finance     Accounting     Accounts Payable
    Commissioner's Office     Finance     Accounting     Fiscal Analysis & Repo
    Commissioner's Office     Finance     Accounting     
    Commissioner's Office     Planning,Asset Mgt     Asset Management     Inventory & Tracking
    Commissioner's Office     Planning,Asset Mgt     Asset Management     Mobility & Congestion
    Commissioner's Office     Planning,Asset Mgt     Asset Management     Roadway Safety
    Commissioner's Office     Planning,Asset Mgt     Asset Management     
    Commissioner's Office     DesignProj Mgt & Tec     Bridge Dsgn Insp Hyd     
    In plus i have four parameters with searchlight options, the problem is when i select "Finance" from DEPT2 and in the next selection level i'm seeing all the departments "Accounting,Asset Management and Bridge Dsgn Insp Hyd" insted of just "Accounting". What i want is if i select a department in DEPT2, in the next drop down list(DEPT3) i want to see only the departement corresponding to the one i selected in dept2. Please need help.
    Thanks

    Hi
    First of all you need to be using Discoverer 10g or 11g Plus not 9.0.4. Assuming you have the right version you need to present the parameters in the correct order. You can change the order on the parameters screen by selecting Tools | Parameters from the toolbar. You then use the Move Up and Move Down buttons to place them in the right order so that DEPT1 is offered first, followed by DEPT2, then DEPT3 and then DEPT4.
    Next, you need to check the radion button on the bottom of the right-hand side that allows linking of parameters then you make DEPT2 dependent upon DEPT1, with DEPT3 dependent upon DEPT2 and so on.
    While this works without hierarchies it works best when you have a hierarchy in place and even better when there is a composite index on the 4 items.
    Best wishes
    Michael

  • Datatable with drop down list in a cell

    Does anyone know the existing example of datatable against certain memory structure with possibility to have drop down list in a cell ( I mean after switching to editing mode some columns become drop down lists , otherwise just value ).
    TIA
    Michael

    Not possible. InDesign isn't designed to be form-filling software. At best, it can create fields which can be passed on to a PDF file, which usually further has to be edited in Acrobat Pro.

  • Adding field with drop down list to Opportunity transaction

    Hi All,
    I want to add a field from one of the Z table to the opportunity transaction Using EEWB. I have added the field but my problem is that the field should be drop down list with values coming from the Z table.
    Please help me if in case if you have idea or any relevant note or document.
    Thanks in Advance
    Gaurav

    Hi Gaurav,
      Go to your development package with your EEWB extension, look at function group like ZCRM_BTX_EEW_UI* and here you have you screen, your pbo, your pai.
      Modify with the same logic of program demo in your field.
    Regards.
    Manuel

  • Prob with drop down lists jiggling

    Hi all
    This is a little different than the last posted problem. When I click on a drop down list..for example a list of states, I can only scroll so far down. The list jiggles up and down, when you get only about 1/2 way down it suddenly shifts back to the top of the list. There is no way to capture for example Pa or Va.
    Could it be the mouse?
    Thx

    Prb. solved by call the same FM with emply list in exporting.

  • I need help with drop down lists

    I have a form that does not have lots of space and I want to use drop down lists to fill in specific information that describes site conditions.  The problem I have is that the drop down list is only set up for a single line and that is not enough space for what I want in the drop down list.  In other words, I have items that are several sentences.   I have seen some descriptions of creating a drop down list that then fills in a text box that has multiple lines.  Unfortunately, that is not an ideal solution for me.  I just want the drop down list to select a single phrase.  Here is an example of what I want to be able to select in the drop down.
    The water heater spilled flue gases in excess of 5 minutes under worst case conditions.  The combusiton testing was completed with in 30 days of the invoice submittal. 
    The form does not allow me to create a field that goes all the way across the page so it needs to look something like this:
    The water heater spilled flue gases in excess of 5 minutes
    under worst case conditions.  The combusiton testing was
    completed with in 30 days of the invoice submittal.
    Any help is greatly appriciated.

    Thanks for responding.
    I have three items that are very similar in length and text for each drop down.  There are 9 drop downs right now.  I am using the drop downs to fill in a form that is used by several people and I want to keep things as simple as possible.  Associated with the drop down already is a check box.  When the check box is checked, it fills in a text box with a score (1 point, 5 points, etc).  That score then tallys for a total with all the other scores in another text box.  Using a drop box to fill in a text box is just getting to busy and than I have to distinguish each drop down item so it is clear which text you are selecting.

  • Web Service with Drop Down Lists for database selections

    Hello,
    I want to define a Web Service with the JDeveloper which can do the following.
    I´ve got a database table with several columns which represents a customer adress and name.
    On a WebSite I like to have three Drop Down Lists to search in that table. The first list should include the field "name". When I select a name there the second list should show all streets (field "street") where people with the selected name live. When I select the street the third list should show me the house numbers (field "hn") of the customers with the selected name and street.
    What have I to do to define a application, a project and so on?
    Many Thanks!

    Hello,
    This question is not directly related to Web Services, since in this case you can consider that the Web Service is your "model" providing data to your view (JSP). One of the question I would like to ask you is: why do you want to use a Web Service to do that? and how you want to deploy this?
    In a general manner, if you use Web Service it is to be able to reuse the business logic in other projects, so based on this statement I would create a specific project that will contain you "model" so all your services.
    The to consume it from your JSP you have different ways:
    - create a Java proxy, or use @WebServiceRef to call the client
    - use Javascript to call the service directly from the HTML page, take a look to the Oracle Web Service endpoint page, where you can see some Javascript stub links.
    Please give more details about your project and needs and I will try to give you a proper answer.
    Regards
    Tugdual Grall

  • Dynamically manipulating two drop down lists

    Dear All,
    I am working with one form which has two drop down lists. Name of first drop down is State Name which is having all state names from database.Another drop down name is City Name and the values has to be populated from data base according to the first drop down value.
    Now I am able to generate first drop down from database . But I am unable to manipulate second drop down.
    Please anybody can help me to resolve this problem. Your suggestions are appreciated.
    Thanks

    Dear All,
    I am working with one form which has two drop down lists. Name of first drop down is State Name which is having all state names from database.Another drop down name is City Name and the values has to be populated from data base according to the first drop down value.
    Now I am able to generate first drop down from database . But I am unable to manipulate second drop down.
    Please anybody can help me to resolve this problem. Your suggestions are appreciated.
    Thanks

  • Problem with drop down list: on Windows it works, on Mac doesn't

    Dear forum,
    I am reworking the MultiPageImporter2.5 script by Scott Zanelli; going to add some new features.
    So far I added a drop down list so the user could choose on which pages to place a pdf/indd file: odd/even/both.
    However I encountered a strange problem: on Windows it works as expected, but on Mac nothing happens when I click the popup. When I write a dialog, I almost always use automatic layout and never encountered such a problem before. But in this script the author uses fixed position for the controls so I followed his coding style:
    dLog.pageSideMode = dLog.pan4.add('dropdownlist', [10,110,180,40], ["Odd and Even Pages", "Only Odd Pages", "Only Even Pages"]);
    dLog.pageSideMode.selection = pageSideMode;
    The drop down list is visible both on Windows and Mac, but on Mac it’s not clickable. What am I doing wrong?
    Another question: in the script, the author created three popups. In the code, each popup has a different height (the last element of the “bounds” array) – 60, 88, 33. Does it make sense to make them different if on the screen they look exactly the same (I mean height).
    Here’s my version of the script.
    I think the easiest solution for me here is to rework the dialog part from fixed to automatic layout.
    Thanks in advance.
    Kasyan

    Hi johniko,
    In my version of the script, the user will have to choose a file to be placed directly in the dialog box. The selected file can be saved into a preset. I'm reworking it for another person (not for myself) and that's what he wants.
    Regards,
    Kasyan
    P.S. By the way, you can simply merge all your pdf-files into a single document in Acrobat.

  • Dynamically Populating Drop Down Lists

    Hi,
    I am trying to dynamically populate a drop down list on a form based on a selection in another drop down list. I have read the help file "To dynamically populate a second field after populating the first" which goes through an example, however I cannot get this example to work for me.
    I know that the best way to do it is to create an xml file and connect the form to this file. I am new to programming in xml but have had some experience in other forms. The code that I have (from the help page) looks like this;
    <?xml version="1.0" encoding="UTF-8"?>
    <MyData>
       <country/>
       <countries>
          <item uiname="United States" token="US"/>
          <item uiname="Vietnam" token="SRV"/>
       </countries>
       <state/>
       <US>
          <item>California</item>
          <item>New York</item>
          <item>Texas</item>
       </US>
       <SRV>
          <item>An Giang</item>
          <item>Bac Giang</item>
          <item>Bac Kan</item>
       </SRV>
    </MyData>
    I have then followed the instructions on the page, and am unable to populate either field on my form. Perhaps there is something wrong with my code? Or any other suggestions would be greatly appreciated! 
    Thanks

    Hi Paul,
    I have another question,
    I would now like to populate a third drop down menu based on the selection in the second one, however my code is going wrong somewhere as now when I put in the first 2 drop down lists, nothing appears in the second one. ie, the first drop down list I link to countries, and the second to state, as I did with the previous file, but now, when I preview it, I can choose a country, but nothing comes up in state. When I set the first drop down box to countries, I have to specify that I want it to show the uiname, but I can't do that with the second one when I select state using the XML file below, nothing is shown. Where am I going wrong?
    <MyData>
       <Country/>
       <countries>
          <item uiname="United States" token="US"/>
          <item uiname="Vietnam" token="SRV"/>
       </countries>  
       <state/>
       <US>
          <item uiname="California" token="CA"/>     
          <item uiname="New York" token="NY"/>   
          <item uiname="Texas" token="TEX"/>
       </US>
       <SRV>
          <item uiname="An Giang" token="AG"/>
          <item uiname="Ban Giang" token="BG"/>
          <item uiname="Bac Kan" token="BK"/>
       </SRV>
       <time/>
       <CA>
          <item>6</item>
          <item>7</item>
       </CA>
       <NY>
          <item>5</item>
          <item>4</item>
       </NY>
       <TEX>
          <item>3</item>
          <item>8</item>
       </TEX>
       <AG>
          <item>2</item>
       </AG>
       <BG>
          <item>1</item>
       </BG>
       <BK>
          <item>9</item>
       </BK>
    </MyData>
    Thank you for your help!

  • Drop-down list in Interactive forms

    Hi All,
    I am creating an interactive form in webdynpro abap. I would like to include a drop-down list in the interactive form. Data in the drop-down list should come from a database table.
    Can anyone give a sample program to do it? It would be of great use.
    Thanks & Regards,
    Vinod

    hi Vinod,
    You may get many threads with  similar query as yours if you use the search functionality.
    But you may refer these two threads which are close to your query.
      Drop Down List population - Abap dynpro adobe form - type ZCI
      Re: Dynamic Drop Down in Interactive Form not populating values
    Regards,
    Runal

  • Drop-down list won't work at the bottom of a page

    I'm having a problem in my forms with drop-down lists that are situated at the bottom of a page. When the list drops down, only the first few values can be chosen. Any that fall too far down the list, and thus hover over top of the next page, cannot be selected. In this situation, the scroll bar for the list actually scrolls the entire document. Very weird. Has anyone expreienced this before? Perhaps I'm making a simple mistake.

    Does it help if you disable hardware acceleration ?
    *Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available"
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    *https://hacks.mozilla.org/2010/09/hardware-acceleration/

  • Drop Down list issues in jsp

    Hi,
    I am facing an issue with drop down list in jsp pages on page postback. Let me explain in detail. I have a client.jsp page which has a drop down list and a text box. The drop down list is populated from an Action class (lets say testAction.java). In the client action form class there is a validation which requires the user to enter some value in the text box.
    So here is the problem, when the client.jsp page loads, the drop down list is populated perfectly, but then the user clicks submit button without entering anything in the textbox, the page loads again with an error message ("Please enter some value in the textbox"). At this point the drop down list does not contain any value. Any ideas what could I do?
    I am posting the code here for individual pieces,
    Struts-config.xml_
    <action path="/client" type="com.myapp.struts.testAction" scope="session">
    <forward name="success" path="/createClient.jsp"/>
    </action>
    <action input="/createClient.jsp" name="ClientActionForm" path="/createClient" scope="session" type="com.myapp.struts.ClientAction">
    <set-property property="cancellable" value="true" />
    <forward name="success" path="/loginSuccessful.jsp"/>
    <forward name="cancel" path="/Welcome.do"/>
    </action>
    index.jsp_
    <h5><html:link action="/client" styleClass="purplelink">Create a new client</html:link></h5>
    testAction.java_
    public ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response)
    throws Exception {
    ArrayList<String> arrList = new ArrayList<String>();
    arrList.add("sports");
    arrList.add("music");
    arrList.add("test 1");
    arrList.add("test2");
    request.setAttribute("mylist", arrList);
    return mapping.findForward(SUCCESS);
    createClient.jsp_
    <select name="droplist">
    <c:forEach var="itemName" items="${mylist}">
    <option><c:out value="${itemName}" /></option>
    </c:forEach>
    </select>
    <html:text property="clientName" />
    ClientActionForm_
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request)
    ActionErrors errors = new ActionErrors();
    if (getclientName() == null || getclientName().length() < 1) {
    errors.add("name", new ActionMessage("error.name.required"));
    return errors;
    Here is the process/page flow.
    index.jsp is the first page which is loaded.
    Link on index.jsp calls action="/client"
    This pulls mapping from struts-config and calls testAction.java
    This populates the arraylist and returns to the createClient.jsp page (mapping from struts-config.xml)
    Now createClient.jsp page has two fields (dropdown list and textfield=clientName) and a submit button
    if user clicks submit, clientActionForm is called and does not enter anything into clientName text field, error message is returned.
    At this point, the drop down list in createClient.jsp is not populated and is returned as empty, even though the scope=session in struts-config.xml
    Please provide some inputs on how can I handle this issue.
    Thanks
    Ashish

    I think one solution would be instead of putting the list in the request, but it in your ActionForm.
    Add a field to the ClientActionForm with getters and setters.
    Then change your action.
    ArrayList<String> arrList = new ArrayList<String>();
    arrList.add("sports");
    arrList.add("music");
    arrList.add("test 1");
    arrList.add("test2");
    ClientActionForm frm = (ClientActionForm)form;
    frm.setMyList(arrList);
    return mapping.findForward(SUCCESS);

Maybe you are looking for

  • How to use viewslifetime managed property to get the list of sites which are least accessed?

    Hi,<o:p></o:p> I am trying to get the subsites of a site collection which are least accessed. I am using ViewsLifeTime managed property in a content search web part with a condition like this: ViewsLifeTime < 0 OR ViewsLifeTime = 0. However, It is no

  • Speed within Cash and Bank Statement

    One of our customers criticizes the speed at the booking of Cash and Bank Statements in SBO 2005A. The more rows are added all the more slower becomes the processing of the current row. This behavior appears extremely if the customer finalizes or sav

  • Intermittent Flashing Question Mark Folder

    I've got a iBook g4 that seems to be having an intermittent problem booting. A few months back on boot it came up with a flashing question mark folder. After trying a few things it finally booted OK. For months all was good; until yesterday. The same

  • Where are my old events in Cal?

    I can no longer see my old events from 2010 and 2011 in iCal? Where are they? I have not deleted them. Any help would be appreciated. Many thanks

  • Steps in XI inst allation

    Hi all I am new to XI . ihave installed XI System . the problem is that i am not able to c SDM server  in MMC. i have installed SAp NW04 with ABAP system and also installed JAVA AddOn for ABAB system  on  Same HOST .  I have insttalled XI component .