Urgent CFGrid-Combo-DataProvider Question

Dear all,
I have this code to create combos in cfgrid. My question now
is .. how to replace the hardcoded countries with query? The code
is saved in AS file (.as). The full codes can be found at
http://cfpim.blogspot.com/2005_08_01_cfpim_archive.html
See
Grid cellRenderer in Flash forms topic.
function createChildren(Void) : Void{
combo = createClassObject( ComboBox, "combo", 1,
{owner:this});
combo.dataProvider = [{data:'SGP',label:'Singapore'},
{data:'JPN',label:'Japan'}, {data:'USA',label:'United States of
America'}, {data:'AUS',label:'Australia'},
{data:'IND',label:'India'}];
combo.addEventListener("change", this);
Thanks in advance
Keiko

Dan,
I wanted to try your method, but I got another error (if I
take the content of .AS file and put it inside cfsavecontent).
Below is my code ...
Seems that I cannot place import or createChild inside
CFSaveContent. Any help will be very much appreciated.
Keiko
<cfform format="Flash" skin="haloSilver">
<cfsaveContent variable="onLoad">
import mx.controls.ComboBox;
class GridRenderer extends mx.core.UIComponent {
var combo;
var listOwner : MovieClip;
var getCellIndex : Function;
var getDataLabel : Function;
function createChildren(Void) : Void{
combo = createClassObject( ComboBox, "combo", 1,
{owner:this});
combo.dataProvider = [{data:'SGP',label:'Singapore'},
{data:'JPN',label:'Japan'}, {data:'USA',label:'United States of
America'}, {data:'AUS',label:'Australia'},
{data:'IND',label:'India'}];
combo.addEventListener("change", this);
function getPreferredHeight(Void) : Number{
return combo != undefined ? 25:0;
function setValue(str:String, item:Object){
var val = item.country;
for(var i = 0; i < combo.dataProvider.length; i++){
combo.dataProvider
.data == val ? combo.selectedIndex = i : '';
function change() {
listOwner.editField(getCellIndex().itemIndex,
getDataLabel(), combo.selectedItem.data);
function(){
_level0.myGrid.rowHeight=25;
_level0.myGrid.getColumnAt(2).cellRenderer = GridRenderer;
}.call()
</cfsavecontent>
<!--- grid with 3 columns name, firstName, department
--->
<cfgrid name="myGrid" width="400">
<cfgridColumn name="Name">
<cfgridColumn name="Country">
<cfgridrow data="Name 1, SGP">
<cfgridrow data="Name 2, USA">
</cfgrid>
<cfinput type="submit" name="cmdSubmit" value="Submit to
see the form dump">
<!--- onLoad trigger --->
<cfinput type="text" visible="No" width="0" height="0"
name="trigger2" bind="{1==2?'':#onLoad#}">
</cfform>

Similar Messages

  • Combo drive question

    Hi guys just one question again regarding getting Snow Leopard onto my iMac. My model is the early 06 one with the combo drive and it doesn't seem to read DVD-DL's. Is there anyway I can use an external HD to boot into it?
    The only reason I bought this Mac was to get the newest OS onto it and act as a backup drive. Any suggestions are greatly appreciated!

    Hello iMuffinMan
    That iMac will upgrade to Snow Leopard no problem, if you have a retail Snow Leopard upgrade disk.
    http://store.apple.com/us/product/MC573Z/A?mco=MTY3ODQ5OTY
    Dennis

  • Combo Update Question

    I would like to update from 10.4.8 to the latest version of OS X. Is it safe to use the *10.4.10 Combo Update v 1.1* as a one shot procedure or should the update be done in increments starting with 10.4.9?
    Thanks in advance for your help.

    warren:
    It should be at least as safe as using Software Update in the Apple menu. A few precautions will be in order, though:
    1. Make sure that you install on a disk that does not have issues. Boot from your install disk and Repair Permissions.
    2. Download Mac OS X 10.4.10 Combo Update v1.1 (Intel)
    3. Repair Disk Permissions in Applications > Utilities > Disk Utility
    4. Install downloaded update.
    5. During installation, particularly optimization process, refrain from using computer, especially launching applications.
    6. Repair Disk Permissions as in 3 above.
    Please do not hesitate to post back should you have further questions.
    Good luck.
    cornelius

  • Combo drive question, I really need your help!!

    Hi,
    I plan to buy a 9.5mm combo drive for my macbook pro (my superdrive died and I just need a new cheap optical drive) but I have one question: will I be able to use that combo drive to install Leopard (a dual layer dvd) on my macbook? Will the combo drive read dual layer dvd's? Thanks

    My son's optical drive died on his macbook. I looked into replacements, and noted that a burner was only $50 more than a combo drive. However, including installation, this was going to get expensive. I bought a portable external drive from LaCie for $110, saving $200+. The portable drive is very small and powered from the firewire port.
    If this is feasible for you, it may be a superior and cost-effective option.

  • Urgent OSX data recovery question

    Hello,
    I am in urgent need of assistance with recovering some data. Long story short I have a XServe that had two 40gb ADMs in it. I successfully backed up each disk to DMG files, then upgraded the ADMs to contain 500gb modules. I then blew out the megaraid config and set the new drives up as mirrors. I am finding now however that one of the DMGs that wasn't supposed to contain anything critical actually did, and when I try to open it I get an error that "no mountable file systems" are in it.
    To top things off, earlier today the original drive was readable, but I wanted to try and boot back to it to see how the server was set up before. I popped it back into its ADM, and via the Install CD in Terminal I ran "megaraid -create auto" to try and make it boot to it again. The problem is that not only did that not work, but since then the drive cannot be read via any means.
    Essentially, I have a drive that thinks it isnt even partitioned any more and a DMG file that won't open, and it is critical that I get some data from it. Does anyone know how I could possibly repair one of the two? The files I need are under the Library folder in a very specific location.

    You'll get a cogent answer posting to the OS X Server forum at http://discussions.apple.com/category.jspa?categoryID=96

  • Urgent iMac Hard drive question!

    I have an 08 20" iMac with a bad hard drive.  I am looking to replace it.  Is there a list of compatible hard drives somewhere so I know what to look for?  Also, I have a MacBook pro from the same year. Am I able to use the hard drive from the MacBook in the iMac?  Any help is greatly appreciated!  I am looking for something around 500GB.  Also, does anyone have an idea how much it would be to have someone install it for me if I provided my own hard drive?  The quote right now from an Apple retailer is $250 for the hard drive plus installation.  I'm hoping to save a few bucks by providing my own.

    Any SATA II 3.5" hard drive will work, you can navigate to www.macsales.comand see a fairly complete list of compatible hard drives. However as the previous  poster mentioned working on an iMac is not recommended unless you are extremely comfortable working on notebook computers. Working on an iMac is not simple and it's easy to damage it beyond repair unless you know exactly what you're doing. I'd recommend taking the machine to your local AASP and have them do it.
    Finally to answer your question regarding using your old MBP's HD, no that is a 2.5" HD and the iMacs use 3.5" HDs.

  • EXTREMELY URGENT!!  Last question on Local Interfaces

    Using Oracle9iAS 9.0.3
    Running on RedHat 8.0
    Trying to implement local interfaces to my entity bean. (Oracle9iAS Containers for J2EE for 9.0.3) provides an example for writing local interfaces.
    pg. 2-10 states:
    //The variable is specified in the assembly descriptor (META-INF/ejb-jar.xml)
    Object homeObject = context.lookup("java:comp/env/EmployeeLocalBean");
    but, if you look at the ejb-jar.xml they reference, it's as follows (pg. 2-12):
    <ejb-jar>
    <enterprise-beans>
    <session>
    <description>Session Bean Employee Example</description>
    <ejb-name>EmployeeBean</ejb-name>
    <home>employee.EmployeeHome</home>
    <remote>employee.Employee</remote>
    <local-home>employee.EmployeeLocalHome</local-home>
    <local>employee.EmployeeLocal</local>
    <ejb-class>employee.EmployeeBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Bean</transaction-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    Where does the EmployeeLocalBean name come from for the lookup?!
    Also, do I NEED to deploy BOTH remote and local interfaces to get my local interfaces to work? Another post on this forum had a problem where they couldn't view the configurations of the EJB because there were not remote interfaces available, but then later they said it was just a problem with the web-based Enterprise Manager.
    Please, can someone let me know if these questions are not interesting enough to the forum? Has nobody here ever implemented Local Interfaces on 9.0.3? Do I need to be posting these questions to a different forum? Please advise and I will take care to get my answers elsewhere if necessary.
    It's just that every resource I've looked at for Local Interfaces (which 9.0.3 CAN implement...right?!) has conflicting information and seems to have buggy implementations. Please....help!
    Thanks in advance!

    Strangely enough, I'm not aware of troubles with enviroment variables and JNDI lookup. There are some misunderstandings - compared to WLS, JNDI tree is different.
    Here is an example of Session EJB settings:
    <session>
    <description>Session Bean ( Stateless )</description>
    <display-name>XSLTransformerEJB</display-name>
    <ejb-name>XSLTransformerEJB</ejb-name>
    <local-home>com.ness.europe.integration.transformer.XSLTransformerEJBLocalHome</local-home>
    <local>com.ness.europe.integration.transformer.XSLTransformerEJBLocal</local>
    <ejb-class>com.ness.europe.integration.transformer.impl.XSLTransformerEJBBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Bean</transaction-type>
    <env-entry>
    <description>path to root transformatin file</description>
    <env-entry-name>config/RootTransformFile</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>/oracle/product/IAS903/j2ee/MwCezPassport/xslt/passport.xslt</env-entry-value>
    </env-entry>
    </session>
    Next, there is an MDB with reference to it:
    <message-driven>
    <description>Message Driven Bean</description>
    <display-name>PassportMDB</display-name>
    <ejb-name>PassportMDB</ejb-name>
    <ejb-class>com.ness.europe.integration.inbound.mdb.InboundMDBBean</ejb-class>
    <transaction-type>Bean</transaction-type>
    <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
    <message-driven-destination>
    <destination-type>javax.jms.Queue</destination-type>
    <subscription-durability>Durable</subscription-durability>
    </message-driven-destination>
    <ejb-local-ref>
    <ejb-ref-name>ejb/XSLTransformerEJB</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local-home>com.ness.europe.integration.transformer.XSLTransformerEJBLocalHome</local-home>
    <local>com.ness.europe.integration.transformer.XSLTransformerEJBLocal</local>
    <ejb-link>XSLTransformerEJB</ejb-link>
    </ejb-local-ref>
    There is basically this piece of code to do lookup environment variable:
    String toRet = (String)this.initCtx.lookup("java:comp/env/config/" + paramName);
    (of course, the config prefix is our syntax)
    As for EJB lookup, this is used:
    final InitialContext context = new InitialContext();
    return (XSLTransformerEJBLocalHome)context.lookup("java:comp/env/ejb/XSLTransformerEJB");
    I didn't created those beans but I asked mate from my team and answer as to troubles was "no".
    Is the problem lies in "not hard coded" names of beans in lookup? We are not trying to get "env/ejb" but just straighforwardly EJB using its name.
    Myrra

  • HTML Combo Box Question

    I generate an HTML page with a Servlet and I have a combo box that lists numbers 1-20. Depending on a parameter that is passed to the servlet I want to set the Combo box to be initalized to (display) a certain number.
    Does anybody know how I can do that? (I would prefer to have the Combo Box entries remain in order)
    Thanks,
    Andrew

    You can always put something in there like
    int foo = Integer.parseInt(request.getParameter("foo"));
    for(int i=1; i <= 20; i++)
      out.println("<option value=\""+i+"\" "+(foo==i)?"SELECTED":"" +" >"+i+"</OPTION>");
    }

  • JSP Combo box question

    How can I make a combo box have the ability to add new items in its list? I have an existing combo box that gets its value from an SQL query. How can I let users have the ability to add to that list? If this is not possible with JSP combo boxes, any suggestions as to what field I may use? Thanks

    Hello Russ9754!
    Might be abit late, but I just read this thread.
    Anyway...I think I have what you are looking for.
    This code creates a dropdown box with the alternatives of your choice. If none of the options is good enough for the user, he/she can choose "other" and enter a more suitable choice in a pop-up javascriptprompt.
    <FORM NAME="formName">
    <SELECT NAME="country" onChange="countryOnChange();">
    <OPTION VALUE="Albania" selected>- = Albania = -</OPTION>
    <OPTION VALUE="Finland">- = Finland = -</OPTION>
    <OPTION VALUE="USA">- = USA = -</OPTION>
    <OPTION VALUE="Other"> Other... </
    OPTION>
    </SELECT>
    </FORM>
    <SCRIPT>
    function countryOnChange(){
    sel = document.formName.country.selectedIndex;
    val = document.formName.country.options[sel].
    value;
    len = document.formName.country.length;
    if (val == "Other"){
    var newcountry = prompt("Enter your country.", "");
    if (newcountry == null) { return; }
    document.formName.country.options[sel].text = newcountry;
    document.formName.country.options[sel].value = newcountry;
    document.formName.country.length = len +1;
    document.formName.country.options[len].text = "Other...";
    document.formName.country.options[len].value = "Other";
    </SCRIPT>

  • Simple combo box question

    I have Flash MX 2004 Pro. I want to create a
    movie/graphic/button ( not sure which one yet) of a county
    (obviously from a state map) and I want to have all of the counties
    (over 40) listed in a Combo Box. I would like the Combo box to
    automatically be updated/populated every time I create a
    movie/graphic/button of a county. I would like to be able to click
    on a county name in the combo box and have the county highlighted.
    While the graphic part is doable, I am asking for help with the
    scripts.
    One more thing: I have a text box that I want to have data
    displayed only for the specific county. So I am thinking of
    creating a text box that is invisible in the State swf but will be
    viewable when the county is selected (mouse over or thru the combo
    box). Do I have to use the scripts to make it viewable when the
    movie is selected?
    Is this even possible with my version of Flash and if so,
    does anyone have some codes I can look at?
    Thanks.

    As far as the text goes, there are several ways to do that.
    Simplest way is to make the text visible when rolled over and
    invisible when rolled out. That way you get the text positioned and
    formated the way you want. It isn't the best method in terms of
    maintenance. A better method is have one text clip that you can
    position in relation to the (x,y) coordinates of the highlighted
    county and pull the text for the county from an array. The latter
    requires more script but is easier to go back and change since all
    you do is update an array.
    I just noticed a line in the onRollOut
    this[this._parent._name + "menu"].selectedIndex = 0;
    that will serve you no purpose whatsoever. I missed deleting
    that from the script I modified to post to you. It doesn't hurt
    anything since it targets nothing you have

  • **urgent*** -two  combo boxes  -one  database table - ***urgent**

    1. i have one html page - in that two combo boxes are there
    2. first one called--> Bank Name and second one called-->Main Branch
    3. i have a database table like BANK_MASTER(MAIN_BRANCH,BANK_NAME)
    i am giving here some data for the above table:
    (sbi-kurnool, sbi),(sbi-cadapah,sbi),(sbi-chittor,sbi),(ab-rangareddy,ab),(ab-varangal,ab) ..like that every bank has its own main branch in different location.
    MY PROBLEM:
    In HTML page, in the first combo box ie., Bank Name will display all the bank name using the table BANK_MASTER ie.,sbi,ab,cb,sbh ...... (its ok - i too get )
    main Problem: Whenever i select a particular bank name in the first combo box, the second combo box ie.,Main Branch has to display the main branches using the table Bank_Master depending on the Selected bank name from the Bank Name Combo box ( ie., if we select the sbi, it has to display all main branches of sbi's only, but not other bank's main branches)

    Hi friend,
    I had a similar situation and i tried to solve it by using XmlHttpRequest Object(used in AJAX).
    U can checkout the below example just for further reference delete
    UserForm.jsp:
    ==========
    <head>
    <script>
    var xmlHttp
    function showState(str)
    xmlHttp=GetXmlHttpObject()
    if (xmlHttp==null)
    alert ("Browser does not support HTTP Request")
    return
    var url="getState.jsp"
    url=url+"?count="+str
    url=url+"&sid="+Math.random()
    xmlHttp.onreadystatechange=stateChange
    xmlHttp.open("GET",url,true)
    xmlHttp.send(null)
    function stateChange()
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
    document.getElementById("state").innerHTML=xmlHttp.responseText
    </head>
    <body>
    <select name='country' onchange="showState(this.value)">
    <option value='india>india</option>
    </select>
    <br>
    <div id='state'>
    <select name='state' >
    <option value='-1'>pickone</option>
    </select>
    </div>
    </body>       
    getState.jsp
    ============
    <%@page language="java" import ="java.util.Hashtable" import ="java.util.Set" %>
    <%
    String country=request.getParameter("count");
    response.setContentType("text/html");
    response.setHeader("Cache-Control","no-cache");
    try{
    Hashtable ht = (Hashtable)session.getAttribute("<ATTRIBUTE_NAME>");
    String buffer="<select name='state'><option value='-1'>Pick One</option>";
    Set s=ht.keySet();
    Object keys[]=s.toArray();
    int size=keys.length;
    for(int i=0; i < size;i++){
    buffer=buffer+"<option value='"+ht.get(keys).toString()+"'>"+ht.get(keys).toString()+"</option>";
    buffer=buffer+"</select>";
    response.getWriter().println(buffer);
    catch(Exception exp){
    response.getWriter().println(exp);
    %> I think u may go upon replacing country with your Main Branch and vice versa

  • Combo box question

    Hi! I'm new to Adobe Acrobat pro, so forgive me if I ask dumm questions!
    So I wanted to make a form with multiple comboboxes which are referring to each other, so that if you choose something from the first one, you can only choose from the subtypes of the chosen type......
    Is it even possible?
    I attached an exaple in Openoffice. It works  with the database fields and hlookup function, but it would be the best to have it in pdf......
    Thanks in advance

    It's possible in Acrobat as well, but you will need to have some custom
    scripts to do it.

  • Combo box question - can a store extra values?

    my data is
    car# id
    CAR1 111111
    CAR2 222222
    CAR5 555555
    i want to be able to select CAR1 in the combo and
    retrieve the id field.
    what is the best way to do this? in foxpro one can
    have hidden fields and some ocxs of cargo objects.
    thanks for any help
    owen brandon

    Hi,
    I haven't used JComboBox for a while but I think you just need to make a class with an id (eg. 11111) and a name (eg. CAR1), and specify a toString method that returns the name. I fyou catch the object you then can cast it and call its getID() method.
    Greets
    Puce

  • Combo Box question on JSP

    I have two combo boxes. Box 2 is populated dependant on the value of box 1.
    The data wil be coming out of a JavaBean with a connection to a database.
    What would be the best way to acheive this?
    TIA
    Owen Thomas

    Hello Russ9754!
    Might be abit late, but I just read this thread.
    Anyway...I think I have what you are looking for.
    This code creates a dropdown box with the alternatives of your choice. If none of the options is good enough for the user, he/she can choose "other" and enter a more suitable choice in a pop-up javascriptprompt.
    <FORM NAME="formName">
    <SELECT NAME="country" onChange="countryOnChange();">
    <OPTION VALUE="Albania" selected>- = Albania = -</OPTION>
    <OPTION VALUE="Finland">- = Finland = -</OPTION>
    <OPTION VALUE="USA">- = USA = -</OPTION>
    <OPTION VALUE="Other"> Other... </
    OPTION>
    </SELECT>
    </FORM>
    <SCRIPT>
    function countryOnChange(){
    sel = document.formName.country.selectedIndex;
    val = document.formName.country.options[sel].
    value;
    len = document.formName.country.length;
    if (val == "Other"){
    var newcountry = prompt("Enter your country.", "");
    if (newcountry == null) { return; }
    document.formName.country.options[sel].text = newcountry;
    document.formName.country.options[sel].value = newcountry;
    document.formName.country.length = len +1;
    document.formName.country.options[len].text = "Other...";
    document.formName.country.options[len].value = "Other";
    </SCRIPT>

  • Combo Edit question

    Hello,
    I'm fairly new in setting up combo edits. We have an account that we want to use exclusively for one Bus Unit. No other Bus Unit should be able to post to this account. If someone could suggest the easiest way to achieve this, it will be greatly appreciated.
    Thanks

    Hello iMuffinMan
    That iMac will upgrade to Snow Leopard no problem, if you have a retail Snow Leopard upgrade disk.
    http://store.apple.com/us/product/MC573Z/A?mco=MTY3ODQ5OTY
    Dennis

Maybe you are looking for