Another CFInput and CFC Binding question.

I have been away from CF since version 5.  Now, I have a need to start back up
on CF, but at version 9.  I am kind of liking these cfc's.
Here is what I am having trouble with:
I have a cfform(html) that has a handful of elements in it.  The first element is a cfselect which is bound to cfc.getClientList(Done this way to allow the drop down to be reusable).  This piece of the puzzle works just fine.  What I am trying to do from this is when a user selects a client from the dropdown, the remaining five elements are bound to another function called getClientDetail which has a returntype of query.  I want to be able to bind the 5 columns returned in my query to the 5 cfinputs below my cfselect.  Any thoughts on this would be helpful as I have tried almost everything I can think of to make this work.

Copy the following 2 files into the same directory under your web root. The comments are self-explanatory.
selectEmployee.cfm
<!--- The cfajaxproxy tag creates a client-side proxy for the Employee CFC.
        View the generated page source to see the resulting JavaScript. 
        The Employee CFC is in the same directory as this page. --->
<cfajaxproxy cfc="Employee" jsclassname="emp">
<html>
    <head>
        <script type="text/javascript">
            /* Asynchronous call to get the employee details.
               The function is called when the user selects an employee. */
                var getEmployeeDetails = function(id){
                var e = new emp();
                e.setCallbackHandler(populateEmployeeDetails);
                e.setErrorHandler(myErrorHandler);
            /* Pass the employee name to the getEmployees CFC function. */
                e.getEmployeeDetails(id);
            /* Callback function: sets the results of getEmployeeDetails into input fields */
            var populateEmployeeDetails = function(employee)
                var first_name = employee.DATA[0][0];
                var email_name = employee.DATA[0][1];
                var department = employee.DATA[0][2];
                var phone      = employee.DATA[0][3];
                var location   = employee.DATA[0][4];
                document.empForm.fname.value = first_name;
                document.empForm.email.value = email_name;
                document.empForm.dept.value = department;
                document.empForm.tel.value = phone;
                document.empForm.loc.value = location;          
            /* Error handler */
            var myErrorHandler = function(statusCode, statusMsg)
                /* blank the field entries*/
                document.empForm.fname.value = '';
                document.empForm.email.value = '';
                document.empForm.dept.value = '';
                document.empForm.tel.value = '';
                document.empForm.loc.value = '';
                alert('Status: ' + statusCode + '. ' + statusMsg);
        </script>
</head>
<body>
<cfform name="empForm">
Employee: <cfselect  value="emp_id" display="name" name="employee" bind="cfc:Employee.getEmployee()" bindonload="true" onChange="getEmployeeDetails(this.value)">
</cfselect><br>
First name: <cfinput name="fname"><br>
E-mail name: <cfinput name="email"><br>
Department: <cfinput name="dept"><br>
Telephone: <cfinput name="tel"><br>
Location: <cfinput name="loc"><br>
<cfinput name="sbmt" type="submit" value="send" onclick="if(employee.value==''){alert('You must select an employee');return false;}">
</cfform>
</body>
</html>
Employee.cfc
<cfcomponent output="false">
<cffunction name="getEmployee" access="remote" output="false" returntype="any">
<cfset var getAllEmployees = queryNew("","")>
<cfset var arr = arrayNew(2)>
<cfquery name = "getAllEmployees" dataSource = "cfdocexamples">
    SELECT Emp_ID,  FirstName || ' ' || LastName as Name
    FROM Employees
</cfquery>
<cfset arr[1][1]="">
<cfset arr[1][2]="Select employee">
<cfloop query="GetAllEmployees">
<cfset arr[currentrow+1][1]=emp_id>
<cfset arr[currentrow+1][2]=name>
</cfloop>
<!--- Alternative, if you require no "Select employee" option --->
<!--- <cfloop query="GetAllEmployees">
<cfset arr[currentrow][1]=emp_id>
<cfset arr[currentrow][2]=name>
</cfloop> --->
<cfreturn arr>
</cffunction>
<cffunction name="getEmployeeDetails" access="remote" output="false" returntype="query">
<cfargument name="employee_id">
<cfset var employeeDetails = queryNew("","")>
<cfset var emp_id = arguments.employee_id>
<cfif isNumeric(emp_id)>
    <cfquery name = "employeeDetails" dataSource = "cfdocexamples">
        SELECT firstname, email as email_name, department, phone, location
        FROM Employees
        WHERE emp_id = <cfqueryparam cfsqltype="cf_sql_integer" value="#emp_id#">
    </cfquery>
</cfif>
<!--- Will activate error-handler in the caller --->
<cfif NOT isNumeric(emp_id) or employeeDetails.recordcount EQ 0>
    <cfthrow message="You selected no employee.">
</cfif>
<cfreturn employeeDetails>
</cffunction>
</cfcomponent>

Similar Messages

  • My sons dad bought him and ipod and my niece used her itunes library to add music and videos on it. They live in another state and we have questions because we don't want him to lose all of the music or any of the apps.

    My son's dad bought him an ipod and my niece used her itune library to put music and videos on his ipod. The problem we are haveing is that she lives in another state and we are not sure how to manange his account without losing some of the songs and all of his apps. There are some songs that are on his ipod that are duplicates, there are some songs that he doesn't like or listen to, and there are some songs on there that I do NOT want him to listen to because of the language and the lyrics. He is 10 there are just some things I feel that he is too young to listen to.

    Welcome to the Apple Community.
    You can use different ID's for iTunes and iCloud.
    Just delete the account in settings > iCloud and create them their own account.
    if the children are minors, you wiil need to create and be responsible for each account yourself.

  • Another bootcamp and external monitor question

    my external display works fine and looks good, however, while running xp pro with SP 2, i cannot tell windows to make my external monitor the primary display. is there a way around this? thanks.

    bootcamp drivers for the GPU unit lack that functionality. Instead you can use more recent drivers for your GPU. Before installing any, make sure you uninstall the current one.
    For ATI:
    Alternative 1: Go to http://www.omegadrivers.net/ and download ati driver.
    Alternative 2: Download latest ATI driver for your chipset from ATI but not mobility one. For instance if your GPU is ATI Mobility Radeon X1600, download Radeon X1600 driver from ati. Then mod it with modtool from http://www.driverheaven.net/modtool.php
    For NVIDIA:
    Download your driver from http://www.laptopvideo2go.com/

  • I need to know all the questions below.  I had to restore my computer to original state and now even if I sign on it won't let me sync my ipad or iphone.  the message is that it is synced to another library and it could wipe out my data on the ipad.

    I need to know all the questions below.  I had to restore my computer to original state and now even if I sign on it won't let me sync my ipad or iphone.  the message is that it is synced to another library and it could wipe out my data on the ipad.  Am I understanding correctly? I am running Windows 7 but have never had any problems.  Thanks

    You need iTunes on the computer. There is no iTunes for your phone. See:
    Locked Out, Forgot Lock or Restrictions Passcode, or Need to Restore Your Device: Several Alternative Solutions
    1. iOS- Forgotten passcode or device disabled after entering wrong passcode
    2. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
    3. Restoring iPod touch after forgotten passcode
    4. What to Do If You've Forgotten Your iPhone's Passcode
    5. iOS- Understanding passcodes
    6. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
    Forgotten Restrictions Passcode Help
    You will need to restore your device as New to remove a Restrictions passcode. Go through the normal process to restore your device, but when you see the options to restore as New or from a backup, be sure to choose New.
    Also, see iTunes- Restoring iOS software.

  • HT5699 Im from another country and ive lost the answers to my security questions. Help required

    Hi
    Im from another country and ive lost the answers to my security questions. Help required
    Thanks

    You need to contact Apple, either as described in that article or by filling out and submitting this form.
    (90034)

  • Question on Creating table from another table and copying the partition str

    Dear All,
    I want to know whether is there any way where we can create a table using another table and have the partitions of the new table to be exactly like the used table.
    Like
    CREATE TABLE TEST AS SELECT * FROM TEMP;
    The table TEMP is having range and hash partitions.
    Is there any way when we use the above command, we get the table partitions of TEMP to be copied to the new table TEST.
    Appreciate your suggestions on this one.
    Thanks,
    Madhu K.

    may this answer your question...
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:595568200346856483
    Ravi Kumar

  • I have another account and my ipad with this account and the password i forget it and the reset question i need help my ipad need active to open thank

    my password

    i have another account and my ipad with this account and the password i forget it and the reset question help me my ipad need active to open and i know my account name

  • I have an existing new belkin modem router which works fine with quite a few wired and wireless products in my house. My question is if i buy a time capsule can i put it in another room and wirelessly connect it to the belkin modem router, I would then ju

    I have an existing new belkin modem router which works fine with quiet a few wired and wireless products in my house. My question is if i buy a time capsule can i put it in another room and wirelessly connect it to the belkin modem router, I would then just like my macbook pro and (imac future purchase) to wirelessly back up to it???????????

    Your will need to perform a Factory Default Reset on the TIme Capsule to clear out the current network settings and then reconfigure it to "join" your wireless network using the AirPort Utility setup application.
    To perform the Factory Default Reset on the Time Capsule....
    Pull the power cord from the back of the device
    Wait a few moments
    Hold in the reset button on the back of the Time Capsule and keep holding it an additional 8-10 seconds while you simultaneously plug the power cord back in to the Time Capsule
    Release the reset button after the hold period and allow 25-30 seconds for the Time Capsule to restart to a slow, blinking amber light
    On your Mac.....
    Open Macintosh HD > Applications > Utilities > AirPort Utility
    Click Continue
    Follow the guided setup and choose the "join" option when it appears duriing the setup
    You will need to know the exact type of wireless security that the Belkin router is using to enter this information during the setup of the Belkin. Otherwise, the Time Capsule cannot join the network, and you will receive an error message after the configuration process.

  • Hello I told you before that my ipad stolen and i dont have icloud , now i pay another ipad and i'm surprise becouse i found my notes that in my stolen ipad in my new one but i don't find anything else no bookmarkets no photos .. My question how did this

    Hello
    I told you before that my ipad stolen and i dont have icloud , now i pay another ipad and i'm surprise becouse i found my notes that in my stolen ipad in my new one but i don't find anything else no bookmarkets no photos .. My question how did this happen ??

    Your documents were synched with iCloud when you logged in with your AppleID.   If you had a photostream before, you could access some photos using the stream.

  • JNDI bind/rebind and object state question

    Hi,
    I have an object that is part of an EAR application that is deployed into an app server. I load a Webapp that initializes an object and then binds it to an initial context under java:comp/env setting some initial state.
    However, when I access the object from an MDB as part of the EAR application, the state, when retrieved from the same context, was not retained. Here is the code I am using to bind the object to the context:
    if (!object.isRunning()) {
           System.out.println("Starting App...");
           object.start();
           try {
               getNamingContext().bind(object);
           } catch (Exception e) {
               System.out.println("Name bound already, rebinding...");
               try {
                   getNamingContext().rebind(object);
                   e.printStackTrace();
               } catch (Exception e1) {
                   e1.printStackTrace();
           System.out.println("Broker started...");
       }When I retrieve the object from the initial context as part of a message received within an MDB, the state is such that the object is always failing the .isRunning method test and subsequently throws an exception.
    What am I doing wrong? Is this related to the fact that possibly the WAR and the MDB create duplicate contexts when I expect there to be only one?
    Any insight is greatly appreciated.
    Thanks,
    John

    following procedure works fine for now, if there is any straight forward solutions,
    that will be helpful.
    1) Create the Subcontexts for each of the sub entries in the jndi name tree
    2) bind the object to the last entry in the tree.
    i.e if the jndi tree name is "one.two.three", and the bind object is Obj
    ctx = ctx.createSubcontext("one");
    ctx = ctx.createSubcontext("two");
    ctx = ctx.bind("three", obj);
    Thanks,
    Gangs.
    "Gangadhar" <[email protected]> wrote:
    >
    Hi,
    I am trying to bind the local object to the Weblogic JNDI, using the
    code below.
    It works fine if the bind name is a straight forward String(not a tree).
    It is
    throwing naming Exception when i am trying to bind into a new tree.
    Thanks,
    Gangs.
    //GETTING THE INITIAL CONTEXT:
    private Context getInitialContext() throws NamingException {
    Properties h = new Properties();
    h.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    h.put(Context.SECURITY_PRINCIPAL, "user");
    h.put(Context.SECURITY_CREDENTIALS, "password");
    h.put(Context.PROVIDER_URL, url);
    return new InitialContext(h);
    } catch (NamingException ne) {
    log("We were unable to get a connection to the WebLogic server
    at "+url);
    log("Please make sure that the server is running.");
    throw ne;
    private registerObject()
    throws NamingException
    // Lookup the beans home using JNDI
    Context ctx = getInitialContext();
    try{
    //This binding works fine.
    String bname = "Ganga";
    ctx.bind("plainname", bname);
    //This one throws an Naming Exception..
    ctx.rebind("one.two.three", bname);
    } catch(javax.naming.NameAlreadyBoundException nlb){
    System.out.print(nlb.getMessage());
    System.exit(0);
    }catch(javax.naming.directory.InvalidAttributesException iae){
    System.out.print(iae.getMessage());
    System.exit(0);
    }catch(NamingException ne){
    System.out.print(ne.getMessage());
    System.exit(0);
    Exception msg is : Unable to resolve 'one.two.three' Resolved: '' Unresolved:'one'

  • -newBee-Im tring to use Creator 2 EA 2 and have several questions -

    Hi
    Im tring to use Creator 2 EA 2 and have several questions - i will be thankful for reciving answers.
    0-It take 300 meg of my memory in small 10 page sample project / is it normal ? (memory shown in task manager windows XP)
    0-Where i can find documents about Creator way of using RowSet technology ?
    I have several question which i could not find answers in documents or online tutorials my questions are :
    1-for example i have a table in a data source ? how i can access my table ?
    2-i bind fields of jsftest table to texteditors i can save changes to current field
    by using : jsftestDataProvider.commitChanges();
    Now how i can insert a new ROW ?
    i tried jsftestDataProvider.appendRow(); in another button action but it insert null items
    into database / how i can add a row to my table
    3-how i can delete a field based on a field value ? or even primary key value ?
    should i write the sql Script in Session bean method and use that in my jsf pages ? or maybe RowSet technology has some
    solution for this ?
    4-How i can use HTML tags (not jsf tags)inside a jsf file ?
    is it possible to use them or not ? for example to generate a table with some dynamic column number?
    5-is it possible to use JSP tag libraries like DisplayTag in jsf ?
    6-does Creator 2 EA 2 support Myface ?
    7-can i add html tags to result page in java source file ? for example in Action on a button add some HTML tag to result page ?
    8-how i can pass url parameter between pages ? if i do not like to use request bean.
    Its my question for Now ;)
    Thank you for answering

    Haha.... thats normal.
    I've 768mb of ram, and i can still feel the lag, especially when the server and pointbase is one,
    worst still.... i having JSC and Netbean running together -_-"
    i think 1.5GB of ram wld be gd
    Regarding the tutorial part, there are api in the "Dynamic Help" box,
    What i did was extracting the java doc into my desktop for easy reference. JSC's screen is too small.
    U can find these references under "C:\Sun\Creator2\rave2.0\docs". Just unzip them

  • I've installed the Adobe Reader Plug In. Yet every time I click to see a PDF, it opens another browser and it is blank. The Browser reads about:blank. How can I fix this so that PDF's open in the browser?

    I've installed the Adobe Reader Plug In. Yet every time I click to see a PDF, it opens another browser and it is blank. The Browser reads about:blank. How can I fix this so that PDF's open in the browser?

    Check your settings in Options > Applications: https://support.mozilla.com/en-US/kb/Opening%20PDF%20files%20within%20Firefox#w_check-firefox-settings
    Also see:
    *https://support.mozilla.com/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox
    *http://kb.mozillazine.org/File_types_and_download_actions
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You need to update some plug-ins:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Shockwave Flash (Adobe Flash or Flash): [https://support.mozilla.com/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]

  • How Do i create a list that will show in a dropdown box with the list being pulled from another tab and not the cell data format junk?

    How Do i create a list that will show in a dropdown box with the list being pulled from another tab and not the cell data format junk?
    I currently run OS X 10.10.1
    Now i have been trying to work on this for a while now and what i want to do should be simple but its apparently not.
    Here is an example of what i want to happen.
    I will have 2 tabs: Contact | Sales
    Now Contacts will have the list of names and various information about a customer, While Sales will have one drop-down box for each Cell Row that will show the names of the person in tab contacts
    for what i am wanting to do i cant use the data format pop-up menu because the list is edited everyday several times a day.
    Now how do i do this, Excel can do this so how can numbers do it?

    Hi Shegra,
    Paste this into a applescript editor window and run it from there. In the script you may need to adjust the four properties to agree with your spreadsheet. Let me know if you have any questions.
    quinn
    Script starts:
    -- This script converts column A in one table into an alphabetized list of popups. It copies the last cell in that column. Then reverts the column to text. It then refreshes popups in column A of a data table starting with a user defined row.
    property DataEntrySheet : "Sheet 1" --name of sheet with popups to be refreshed
    property DataEntryTable : "Sales" --name of table with popups to be refreshed
    set copyRange to {}
    property PopValueSheet : "Sheet 1" --name of sheet with popup values table
    property PopValueTable : "Contacts" --name of table with popup values
    set PopStartRow to {}
    tell application "Numbers"
      set d to front document
      set ps to d's sheet PopValueSheet
      set pt to ps's table PopValueTable
      set s to d's sheet DataEntrySheet
      set t to s's table DataEntryTable
      set tf to t's filtered --this records filter setting on data Entry Table
      display dialog "Start from row #..." default answer "" with icon 1 -- with icon file "Path:to:my.icon.icns" --a Week # row
      set PopStartRow to {text returned of result}
      tell pt --convert list to alphabetized popups
      set ptRows to count rows
      set copyRange to ("A2:" & name of cell ptRows of column "A")
      set selection range to range copyRange
      set selection range's format to text
      sort by column 1 direction ascending
      set selection range's format to pop up menu
      -- popupsmade
      set selection range to cell ptRows of column 1 of pt
      set v to value of cell ptRows of pt
      end tell
      activate application "Numbers"
      tell application "System Events" to keystroke "c" using command down
      tell pt
      set selection range to range copyRange
      set selection range's format to text
      end tell
      tell t
      set filtered to false
      set tRows to count rows
      set pasteRange to ((name of cell PopStartRow of column "A") & ":" & (name of cell tRows of column "A"))
      set selection range to range pasteRange
      tell application "System Events" to keystroke "v" using command down
      set filtered to tf
      end tell
    end tell

  • Help - "Acrobat is being used by another application and cannot open PDF files until the other application is closed."

    Hello,
    I searched this site and google for this error terminology and come up dry.  I support a user who has been for years using Acrobat 5 (yes, I know...) to read files in a client DB program, as well as other PDF files on their PC.  In the last week or so, they have started gatting this error "Acrobat is being used by another application and cannot open PDF files until the other application is closed." any time they attempt to open a PDF file attached to an email (via Outlook).
    It is my understanding that they cannot upgrade to a newer version of Acrobat because of limitations of their client software, but had not previously had any issues viewing PDF notes from the DB, and PDF attachments in their email.
    I have tried uninstalling and re-installing, as well as tried using Adobe Reader 7 & 9 in conjunction with Acrobat to try to get around this issue, but have not been successful.
    Any ideas?
    Thanks,
    Jesse

    I don't have an answer to your technical problem. The product I assume is Acrobat that you are talking about (based on the post title), Adobe is the company name. This is a good place to ask questions on Acrobat if folks can figure out what you are talking about. They will ask for the product version number (like AA9.3.3), operating system, and other applications if appropriate. Also, just what you are doing that generates the message.
    As for Adobe, you are not likely to get an answer from them here in the user forum. You will be lucky if you can get an answer if you can contact them and not be on hold for more than an hour (sorry, this is why a lot of folks end up in the forum).
    So, to help others try to answer your question, what are the products and versions involved? What OS? What are you doing when the message comes up.

  • External Hard Drive and Time Machine questions

    Hello, I am new here to the forums and I have looked all over for the answers to two questions that I have regarding external hard drives and the time machine feature.
    For some background, I recently had a scare (water spill but luckily I had a keyboard cover on and the entire spill landed on the cover) with my Mid-2012 13" Macbook Pro (2.5Ghz) and due to almost losing all my data I've decided to invest in an external hard drive. However, rather than just purchasing a 500GB HDD to use as an external hard drive, I decided to kill two birds with one stone and upgrade my Macbook Pro as well by investing in the 480GB OCW Mercury Extreme Pro SSD. I'll be using the SSD as my internal drive so the original hard drive that came with my Macbook will serve as my backup external drive. Lastly, I plan to use the external drive solely for the purpose of backing up my MacBook in case something ever happens to my Macbook.
    I am using this guide to help me with this whole process: http://circuitremix.com/?q=content/macbook-pro-solid-state-drive-upgrade-guide-a nd-performance-testing.
    My two questions are:
    1) When following the guide, it never mentions anything about the Partition Map Scheme. After being alerted to this and doing some additional research, is it better to go with the GUID Partition Table rather than the Master Boot Record?
    2) After I have cloned everything onto my new SSD and replaced the HDD in my MacBook with it, should I erase everything on my HDD before setting it up with time machine?  I was thinking about keeping the original data on the original hard drive (which would now be my external drive) just in case something goes wrong with time machine but I have read that people recommend solely dedicating the entire external hard drive for time machine backups.
    Thanks in advance!

    Format the new SSD in Disk Utility to Mac OS Extended (Journaled) and that will solve question No. 1.
    After formatting, clone the new SSD using Disk Utility>Restore or Carbon Copy Cloner (down load from the Internet).  Test the new SSD and if it performs as expected, do the physical swap.
    Question No. 2.  Erase the Time Machine HDD using Disk Utility and then install Time Machine.  See this excellent website regarding Time Machine.
    http://pondini.org/OSX/Home.html
    If you want an external boot HHD, get another one and use Carbon Copy Cloner.  This will give you redundancy in backups as well which is a good strategy.  CCC also can update the contents in an incremental manner similar to Time Machine.
    Ciao.

Maybe you are looking for

  • My calendar is gone...HELP!!

    I thought I was setting my iPad to backup to the Cloud. I must have done something wrong,since the next day I turned the iPad on and the entire calendar was blank. Before I do anything else stupid, I need to know how to recover my calendar. I rarely

  • BPC 7.0 MS-Transformation File Error Duplicated Signeddata

    Hi, I tested this transformation file on BPC 5.1, and it was able to load data with out error.  When the client moved to 7.0.  I received the following error:  Convert Data Success Record Count : 11212 Accept Count : 11212 Reject Count : 0 Skip Count

  • Screen shots and full list of 2.0 features

    I just learned on internal board that you can now do screen shots of your window (hit power and home button at the same time - clip is saved in camera roll). Is there a full list somewhere of all new features? This was news to me and is a very cool f

  • Purchasing Org from Purchasing Group

    Hi, I have a requirement where I need to read the Purchasing Org to which a particular Purchasing group is assigned. I get the purchasing group as input. I tried to find any FM which would give me this data but didn't find any. Could someone please p

  • How to test T61 backup battery?

    Hello, am taking apart a T61 for cleaning, OS reload etc and am thinking of testing the backup battery while I am in the maintenance mode. The maintenance manual indicates to remove the battery and measure the voltage, but doesn't indicate how to do