How to update/refresh main panel's image displays inside subvi?

Hi everyone,
I have a image display control located in my main panel,  and I have a subvi which do some process works inside it.
but what I have done inside the subvi can not be seen in the main panel.
I used image session controls as the input/outpout nodes for subvi.
If I use image display control as input node for subvi,
I can see the realtime displays in the subvi's panel,
but this is not waht I wanted.
anyone have good idea?
Solved!
Go to Solution.

Reall sorry, i have attached 8.6 version.
Also, I think the answer of Andrey_Dmitriev is what you are looking for. I think I understand your problem now. My example updates the image only after subVI is executed.
Regards,
https://decibel.ni.com/content/blogs/kl3m3n
"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Attachments:
mainVI_1.vi ‏36 KB
mainVI_2.vi ‏36 KB
subVI_sobel.vi ‏9 KB

Similar Messages

  • Dialog updates database... refresh Main panel?

    ref: JDev 3.1
    Given an application that has a Master/Detail Form with details in a gridcontrol, and a button that kicks up a dialog panel that allows the user to edit extensively a row that appears in the said gridcontrol...
    How does one force a refresh of the underlaying rowset in the original panel ( and force a redisplay into the grid control to reflect the updated data )?
    I'm trying to avoid instantiating the rowset as a passed parameter to the dialog and then manually pushing everything back on the main panel...
    Or am I ( again ) conceptually missing some significant approach to solving this task?
    TIA

    OK... here's some (working) sample code for an application based on Brian's help to Ali's session question, that also answers my question. Probably obvious to many, it may be helpful to newbies like me who are very confused reading the postings and trying to figure this stuff out.
    It shares a rowset between a frame and a dialog box. The data is kept in synch (automagically) as things change in the dialog box.
    Steps:
    1. Build a database connection class
    2. Put it in the application before opening the base frame.
    3. Build the frame/dialog. DO NOT specify a sessioninfo/rowsetinfo using the infoproducer drag/drops.
    4. Manually hardcode the sessioninfo/rowset stuff manually as noted.
    Note also that session info is not passed nor published except once.
    This seems to work. Please advise if you know of any glaring flaws. I wouldn't be surprised. Obviously, this is easier to actually do when you see the sample code than what it sounds like reading the postings! TIA.
    public class Application1
    public Application1()
    /** call the generic database connections **/
    /** Note that this is a simple class that used the IDE **/
    /** to define a sessioninfo and rowset using drag and drop **/
    /** in the DESIGN mode to the Structure pane... then edit the attributes **/
    dbConnections x = new dbConnections();
    /** THEN open the frame **/
    Frame1 frame = new Frame1();
    frame.show();
    public static void main(String[] args)
    new Application1();
    package package2;
    import oracle.dacf.dataset.*;
    import oracle.dacf.dataset.connections.*;
    public class dbConnections extends Object
    SessionInfo sessionInfo3 = new SessionInfo();
    RowSetInfo rowSetInfo3 = new RowSetInfo();
    AttributeInfo ACTION_CODErowSetInfo3 = new AttributeInfo(java.sql.Types.VARCHAR);
    AttributeInfo ACTION_TEXTrowSetInfo3 = new AttributeInfo(java.sql.Types.VARCHAR);
    public dbConnections()
    try
    jbInit();
    sessionInfo3.publishSession();
    catch (Exception e)
    e.printStackTrace();
    private void jbInit() throws Exception
    ACTION_TEXTrowSetInfo3.setName("ACTION_TEXT");
    ACTION_CODErowSetInfo3.setName("ACTION_CODE");
    rowSetInfo3.setAttributeInfo( new AttributeInfo[] {
    ACTION_CODErowSetInfo3,
    ACTION_TEXTrowSetInfo3} );
    sessionInfo3.setAppModuleInfo(new PackageInfo("", "MyProject3"));
    sessionInfo3.setConnectionInfo(new LocalConnection("qms"));
    sessionInfo3.setName("sessionInfo3");
    rowSetInfo3.setQueryInfo(new QueryInfo(
    "rowSetInfo3ViewUsage",
    "package2.ActionCodes",
    "action_code, action_text",
    "action_codes",
    null,
    null
    rowSetInfo3.setSession(sessionInfo3);
    rowSetInfo3.setName("rowSetInfo3");
    package package2;
    import javax.swing.*;
    import java.awt.*;
    import oracle.dacf.control.swing.*;
    import oracle.jdeveloper.layout.*;
    import oracle.dacf.dataset.*;
    import java.awt.event.*;
    public class Frame1 extends JFrame
    JPanel jPanel1 = new JPanel();
    GridControl gridControl1 = new GridControl();
    XYLayout xYLayout1 = new XYLayout();
    XYLayout xYLayout2 = new XYLayout();
    JButton jButton1 = new JButton();
    public Frame1()
    super();
    try
    jbInit();
    catch (Exception e)
    e.printStackTrace();
    private void jbInit() throws Exception
    this.getContentPane().setLayout(xYLayout2);
    this.setSize(new Dimension(517, 549));
    jButton1.setText("Detail");
    jButton1.addActionListener(new java.awt.event.ActionListener()
    public void actionPerformed(ActionEvent e)
    jButton1_actionPerformed(e);
    gridControl1.setLayout(xYLayout1);
    this.getContentPane().add(jPanel1, new XYConstraints(0, 0, 508, 284));
    jPanel1.add(gridControl1, null);
    this.getContentPane().add(jButton1, new XYConstraints(219, 268, -1, -1));
    /** manually typed this in **/
    gridControl1.setDataItemName("infobus:/oracle/sessionInfo3/rowSetInfo3");
    void jButton1_actionPerformed(ActionEvent e)
    Dialog1 myDialog = new Dialog1();
    myDialog.show();
    package package2;
    import javax.swing.*;
    import java.awt.Frame;
    import java.awt.BorderLayout;
    import oracle.jdeveloper.layout.*;
    import oracle.dacf.control.swing.*;
    import oracle.dacf.dataset.*;
    public class Dialog1 extends JDialog
    JPanel jPanel1 = new JPanel();
    XYLayout xYLayout1 = new XYLayout();
    TextFieldControl textFieldControl1 = new TextFieldControl();
    NavigationBar navigationBar1 = new NavigationBar();
    TextFieldControl textFieldControl2 = new TextFieldControl();
    public Dialog1(Frame parent, String title, boolean modal)
    super(parent, title, modal);
    try
    jbInit();
    pack();
    catch (Exception e)
    e.printStackTrace();
    public Dialog1()
    this(null, "", false);
    private void jbInit() throws Exception
    jPanel1.setLayout(xYLayout1);
    getContentPane().add(jPanel1);
    jPanel1.add(textFieldControl1, new XYConstraints(89, 125, 234, -1));
    jPanel1.add(navigationBar1, new XYConstraints(99, 314, -1, -1));
    jPanel1.add(textFieldControl2, new XYConstraints(89, 158, 236, -1));
    /** Manually typed the following in **/
    textFieldControl1.setDataItemName("infobus:/oracle/sessionInfo3/rowSetInfo3/ACTION_CODE");
    textFieldControl2.setDataItemName("infobus:/oracle/sessionInfo3/rowSetInfo3/ACTION_TEXT");
    navigationBar1.setDataItemName("infobus:/oracle/sessionInfo3/rowSetInfo3");
    null

  • Problem: Is this how i update/refresh a JTable?

    Newbie in JTable and Swing here.
    I have created panel class which will load data from the database when first time come into this panel
    JScrollPane sp1 = new JScrollPane();
    PlayerTableModel pModel = new PlayerTableModel();
    JTable table1 = new JTable(pModel);
    upon a combobox change, i will refresh my table with new data...
    void cb_position_actionPerformed(ActionEvent e) {
    PlayerTableModel pModel = new PlayerTableModel(str_item);
    pModel.fireTableDataChanged();
    table1.repaint() ;
    but the above codes does not seems to refresh and update my table..
    help..
    Thanks...

    I have a piece of example code from a book that I've been working with lately. In this case when a certain combo box changes the table data is refreshed.
    Here is how it's done:
    if (scrollPane != null)
    getContentPane().remove(scrollPane);
    try
    String tableName= (String)tableNames.getSelectedItem();
    if (rs != null) rs.close();
    String query = "SELECT * FROM " + tableName;
    rs = stmt.executeQuery(query);
    if (SCROLLABLE)
    model = new ScrollingtbSchedule1Model(rs);
    else
    model = new CachingtbSchedule1Model(rs);
    JTable table = new JTable(model);
    scrollPane = new JScrollPane(table);
    getContentPane().add(scrollPane, "Center");
    pack();
    doLayout();
    catch(SQLException e)
    System.out.println("Error " + e);
    Notice that the pane is removed and then added again with the new data to force a "refresh".

  • How to update my library and copy images to replace current linked ones?

    I've decided that I want to update my iPhoto library. Currently, most images that have been imported are just using links to images in their actual location. I want to change that so that all images are actually copied into the iPhoto library and no long remain outside of the software's structure.
    There does not seem to be a command for doing that – sort of equivilent to one in iTunes that does something very similar. Does anyone have any ideas about how to do this? It seems that there might be an Automator workflow out there that would
    step through my iPhoto library
    check to see if it is a link external to iPhoto
    if it is a link, then replace it with a copy of the actual image
    delete the original image (i.e. with steps 3 and 4, 'move' the image into iPhoto)
    produce a list of images that the original cannot be found (after Spotlight has had its go at finding the images for import)
    Surely there is something out there already so I don't have to write it.

    iPhoto has no built-in tools to turn a referenced library into a managed library.
    There are two options using other programs, but both are not free:
    Use the paid version of iPhoto Library Manager:If you copy your iPhoto Library with this tool, it will include the referenced originals into the copied library.
    Upgrade to Aperture: Aperture is the professional version of iPhoto with more advanced editing and organisational tools, and it has built-in tools to manage referenced originals, relocate them, and consolidate them. iPhoto and Aperture are compatible and can both work on each other's photo libraries.
    Regards
    Léonie

  • How to update/refresh external hard drives?

    Okay, lets say that you add some music to a memory card but later you want to remove those songs and add a new stack of songs... So you delete your old songs and try to add your new songs (keeping it in the size) but it wont allow you because the memory card/external says not enough space because it has not registered the fact that you have already deleted your old songs. Even though the songs do not show up, and the size is correct when plugged into any other computer just not the mac.
    What to do?

    After you delete the songs on the memory stick, you need to *empty the trash* to recover that space for reuse.

  • How to create two front panels

    Hi in my application i am using two Monitors .. 
    so i like to use one monitor for Vision display and control operation (Front panel )
    And another For Motion Control Front panel .. is it possible to do this .. 
    (In this case How to split my Front panel of my Vi ..)

    Hi
    If we use Border Layout, the Panels which are added to the main panel are not displaying properly.
    Solution is to use BoxLayout with AXIS parameter. Statement looks like this:
    mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout(PAGE_AXIS));
    Thank You for giving Reply,

  • How do i create a Count for the no. of images displayed on stage

    i am a total newbie in flash ! & currently making a simple mcq quiz.
    each stage will have three choices of answers (A/B/C)
    every correct answers will be displayed an image :
    var myQ1a:URLRequest=new URLRequest("tick.png");
    in the end, how can i count the number of images displayed in the overall flash and display it.
    or.. perhaps you have other options on how can i display the scores.

    Hi.
    here's my code :
    stop();
    aa1.addEventListener(MouseEvent.CLICK, ona1Click);
    bb1.addEventListener(MouseEvent.CLICK, onb1Click);
    cc1.addEventListener(MouseEvent.CLICK, onc1Click);
    next1.addEventListener(MouseEvent.CLICK, onNext1Click);
    home1.addEventListener(MouseEvent.CLICK, onHome1Click);
    var Q1a:Loader;
    var Q1b:Loader;
    var Q1c:Loader;
    var Q1next:Loader = new Loader();
    var Q1home:Loader = new Loader();
    //the name of the function has to match what you're calling from the event listener
    function ona1Click(evt:MouseEvent):void {
    Q1a = new Loader();
    bb1.removeEventListener(MouseEvent.CLICK, onb1Click);
    cc1.removeEventListener(MouseEvent.CLICK, onc1Click);
    var myQ1a:URLRequest=new URLRequest("wrong.png");
    Q1a.load(myQ1a);
    addChild(Q1a);
    Q1a.x=320;
    Q1a.y=180;
    function onb1Click(evt:MouseEvent):void {
    Q1b = new Loader();
    aa1.removeEventListener(MouseEvent.CLICK, ona1Click);
    cc1.removeEventListener(MouseEvent.CLICK, onc1Click);
    var myQ1b:URLRequest=new URLRequest("tick.png");
    Q1b.load(myQ1b);
    addChild(Q1b);
    Q1b.x=320;
    Q1b.y=260;
    function onc1Click(evt:MouseEvent):void {
    Q1c = new Loader();
    aa1.removeEventListener(MouseEvent.CLICK, ona1Click);
    bb1.removeEventListener(MouseEvent.CLICK, onb1Click);
    var myQ1c:URLRequest=new URLRequest("wrong.png");
    Q1c.load(myQ1c);
    addChild(Q1c);
    Q1c.x=320;
    Q1c.y=340;
    //next1.addEventListener(MouseEvent.CLICK, onNext1Click);
    function onNext1Click(evt:MouseEvent):void {
    if(Q1a)
    removeChild(Q1a);
    if (Q1b)
    removeChild(Q1b);
    if(Q1c)
    removeChild(Q1c);
    gotoAndPlay(2);
    //home1.addEventListener(MouseEvent.CLICK, onHome1Click);
    function onHome1Click(evt:MouseEvent):void {
    gotoAndPlay(17);
    this code is on the 1st frame. this will go on till the 15th frame. i wonder where i can put the codes you've given me ..

  • Show the line after draw with IMAQ selectline.vi in the image display

    hi..
    may i know how to show the line on the image display after i draw the line by using the IMAQ select line.vi??
    i use the the IMAQ select line.vi for drawing few couples of lines...but i don know how to show it all on the image display...
    because i will forget the location of the lines after i draw it by IMAQ select line.vi...
    thanks for help..

    Hey,
    Just use IMAQ Draw.vi
    Christian

  • How do I fix missing and corrupted images after update to Mountain Lion 10.8.2 and Aperture 3.4?

    Last night I tried to update to Aperture 3.4 on my MacBook Pro (late 2007 / 3,1 model) and received a message that I needed to install Mountain Lion 10.8.2 first.  However, there was no update in my App Store account for 10.8.2.  The update for 10.8.2 appeared above the Aperture 3.4 update after I restarted the laptop and rechecked for updates.  I proceeded to update Mountain Lion and then Aperture.  Everything seemed to be working fine so I opened Aperture 3.4 and watched it update the database without any issues...
    Upon examining the small library (of approximately 1200 images totaling about 8 GB) that I leave on this MacBook Pro specifically for testing Aperture updates, I observed the following:
    I know anything can happen with stored images, so I try to create redundancy by duplicating important photos on import to an external device, running Time Machine backups and keeping memory cards stored away until I am comfortable with the integrity of the first 2 methods.  I am not really worried about this specific Aperture Library on this laptop because it has become my "laboratory" for testing new updates before we apply them to our other computers.
    In general, I try not to be too early of an adopter when it comes to software and updates--even though I have had remarkably few problems with Apple updates in the past.  However, my success rate with Apple's products and "feature curiosity" occasionally leads me to update early!  It is my curiosity that, again, has me wondering:  What went wrong and how can I fix this in case it happens to something important in the future?

    I still don't know what happened to my test Aperture Library after the update to 3.4...Not only were my previews lost, but so were the original images!  Needless to say, I haven't bothered to update the main library on the Mac Pro because I don't want to deal with this level of uncertainty (even with backups in place).

  • How to get extension version number to update in exchange panel.

    I was able to upload my Illustrator extension, set it to private and share it. Brialliant functionality. Now I have released a point update, and although it shows the correct version in the extension details on the Adobe Exchange website, the version number will not update in the panel itself, although my description modifications update just fine. The extension as shown in the "Not Published" list of the sight has the old version number. When I click on it to get to the main extension page, it shows the correct version number in title and in also correct in the details on the right. It does say "(Preview)" after the name. I don't intend to ever sell it, but want to keep sharing it privately. How do I get it to recognize version updates?
    Thanks

    Hi there,
    It sounds to me like the reason your new patch (with the updated product version) is not showing in the panel is that it has not been "published". If it's showing up in the "Not Published" screen, this means that it's only available for you personally to make changes to in the producer portal - once you're finished making your changes (uploading a new ZXP etc.) you need to click Submit (with Auto-Publish) to make the new version go live to the people it's shared with (and show up in the panel). As long as the product is set to Private, clicking Submit (with Auto-Publish) will not make the product available publicly - it will continue to be private, visible only to the groups you specify.
    Fraser

  • How to update drawImage() images

    This may be quite simple for most, but I'm stumped. I have BuffereredImages[] being passed to a class where my Graphics are. I then use drawImage() to draw the images on the JPanel. That all works fine. My problem is that I have a button that I need to repaint or redraw the images when the button is clicked. I have the button listener all setup. I just don't know how to get the drawImages() to redraw using different images.
    In my main panel I have:
             die1 = rand.nextInt(6);
             die2 = rand.nextInt(6) + 6;
             //get images for vending machine
                img = loadImages();
             //paint all images
                dieImg = new DiceImage(die1, die2, img);Then my button listener:
           private class ButtonListener implements ActionListener
             //declare variables 
             private Object source;
              public void actionPerformed(ActionEvent event)
                source = event.getSource();
                *   Roll Button         *
                if (source == rollBtn)
                  //paint all images
                *   Pass Button         *
                if (source == passBtn)
         System.out.println("Pass");
          } //end of Button Listener ClassThen this is where I get the images:
           private BufferedImage[] loadImages()
               //create prefix for path if needed
             String prefix = "";
               //create array of filenames to draw
             String[] fileNames = { "die1-1.gif", "die1-2.gif", "die1-3.gif", "die1-4.gif", "die1-5.gif", "die1-6.gif",
                                    "die2-1.gif", "die2-2.gif", "die2-3.gif", "die2-4.gif", "die2-5.gif", "die2-6.gif" };
             //get the files
             BufferedImage[] images = new BufferedImage[fileNames.length];
             for(int j = 0; j < images.length; j++)
                try
                   URL url = getClass().getResource(prefix + fileNames[j]);
                   images[j] = ImageIO.read(url);
                    catch(MalformedURLException mue)
                      System.err.println("url: " + mue.getMessage());
                    catch(IOException ioe)
                      System.err.println("read: " + ioe.getMessage());
               //return the array of images
             return images;
          }And this is where I draw the images:
           public class DiceImage extends JPanel
             private int x, y;
             private int width = 500, height = 150;
             private BufferedImage[] image;
             private int die1, die2;
          //create constructor and pass in image array     
              public DiceImage (int die1, int die2, BufferedImage[] image)
         this.die1 = die1;
         this.die2 = die2;
                         this.image = image;
          * Beginning of the paintWindow method
              public void paint(Graphics display)
         super.paint(display);
         //draw images in vending machine 3D box
                          x = 75;  //center the to images evenly
                          y = 10;  //10 pixels down from the top of the panel
         display.drawImage(image[die1], x, y, this);
         display.drawImage(image[die2], x + 200, y, this);                                   
             } // end paint
          //sets the preferred size for the item box
              public Dimension getPreferredSize()
                return(new Dimension(width, height));
          } //end of class   Let me know if you need any other snippets of code. I'm new to Java so please be gentle!

    I just don't know how to get the drawImages() to redraw using different images.display.drawImage(image[die1], x, y, this);
    display.drawImage(image[die2], x + 200, y, this);     
    In your paint method you are specifying the image to be drawn based on the values of die1 and die2. So if you want to draw a different image then you need to change the value of these two variables. So you need a method that changes these values.

  • How do you refresh a report after an update?

    Hi all,
    I have a Welcome Page that has several Portlets on it. One of the Portlets is a QBE report. From the report a user can click on a column record and be transported to a form, where the user can modify the record. Once the user is satisfied with the changes, the user hits the UPDATE button and is transported back to the Welcome Page. The only problem is that the Report has not been updated. Refresh does not work on the web toolbar and the only way I figured out on how to refresh the report is to go into the 'Customize' page and make some sort of change and hit O.K. After that, I am redirected back to the Welcome Page with the Report refreshed with current data. How can I refresh the report, without going into the 'Customize' Page? What code does the 'Customize' page do, to automatically refresh the report? I am using Portal 9.0.2.2.14.
    TIA,
    Dan

    Hi,
    This is due to webcache. You can solve this problem by calling the page url with an extra parameter. That way the page would get invalidated.
    Say the page url is
    http://domain/portal/page_pageid=33,32951&_dad=portaldad&_schema=portalschema
    then you should call the page like this
    http://domain/portal/page_pageid=33,32951&_dad=portaldad&_schema=portalschema&1=2
    This just adds a dummy parameter at the end and hence invalidates the cache.
    Thanks,
    Sharmila

  • How to update ADF VO object to refresh the data in ADF Pivot table

    I need to know how to update the View object so that the date in pivot table is refreshed/updated/filtered.
    here are the steps I performed to create ADF pivot table application using VO at design time.
    1) created a collection in a Data Control (ViewObject in an ApplicationModule) that provides the values I wanted to use for row and column labels as well the cell values (Used the SQL query)
    2) Dragged this collection to the page in which wanted to create the pivot table
    3) In the pivot table data binding editor specified the characteristics of the rows (which attribute(s) should be displayed in header), the columns (likewise) and the cells.
    Now, I have a requirement to update/filter the data in pivot table on click of check box and my question is how to I update the View object so that the date in pivot table is refreshed/updated/filtered.
    I have got this solution from one of the contact in which a WHERE clause on an underlying VO is updated based upon input from a Slider control. In essence, the value of the control is sent to a backing bean, and then the backing bean uses this input to call the "filterVO" method on the corresponding AppModule:
    but, I'm getting "operationBinding" object as NULL in following code. Please let me know what's wrong.
    here is the code
    Our slider component will look like
    <af:selectBooleanCheckbox label="Unit" value="#{PivotTableBean.dataValue}"
    autoSubmit="true" />
    The setDataValue() method in the backing bean will get a handle to AM and will execute the "filterVO" method in that, which takes the NumberRange as the input parameter.
    public void setDataValue(boolean value) {
    DataValue = value;
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = (OperationBinding)bindings.getOperationBinding("filterVO");
    Object result = operationBinding.execute();
    The filterVO method in the AMImpl.java will get the true or false and set the where Clause for the VO query to show values.
    public void filterVO(boolean value) {
    if (value != null) {
    ViewObjectImpl ibVO = getVO1();
    ibVO.setWhereClause("PRODUCT_TOTAL_REVENUE(+) where rownum < 10");
    ibVO.executeQuery();
    }

    Did you define a filterVO action in your pagedef.xml file?
    You might want to read on how to access service method from a JSF Web Application in the ADF Developer Guide for 10.1.3 chapter 8.5

  • How do I disable linked smart-object auto-update/refresh?

    Working in the CC3D features, I am constantly making changes to my bump map. Every time I step-backwards, or make a significant change to the bump texture (smart object?), CC auto-saves the layer. This specific file is a very very large document (3 gigs in the bump texture layer alone), and the 3D layer has lots of lights and is very complex. This auto-refresh/update really bogs down the time that it would take me to make my changes. I have a very fast machine (I know it's fast, I dont need to list my specs), and I have all shadows disabled.
    How do I disable linked smart-object auto-update/refresh?

    If you do not like a feature like smart objects there is nothing forcing you to use it. Use some other features to do what you want. Please don't ask Adobe to introduce bug into smart object support.
    You could work on your bump maps textures in external files. When your done some time in the future you could edit your project with the smart object layer and use replace smart object. Only then will all smart filters be applied to the smart layer with the replaced smart object.
    Or if by CC Auto save Layer you referring to CC Generate feature you can disable that feature.
    I have no idea what your referring to when you write "CC auto-saves the layer" being a feature. I know CC Generate will write layers out as web files but that more a Web feature then a 3d feature.  Where do you see your layer being saved?

  • How can I use a cfwindow with a form in it to update the main page?

    This seems simple enough but I can't figure it out. My main
    page calls a query to get a list of departments. I have put this
    list in a table inside a cfdiv tag. I have an add department link
    on my page. When the user clicks on this link, I want a popup
    window (cfwindow) to display containing a form to add a department.
    Then when the user submits the form, the form should disappear and
    the main page should show the updated list of departments.
    I can't get the form to close without getting an error
    stating that there already is a window with that name and the new
    data doesn't display unless I refresh my screen.
    Here's my departments.cfm page:
    <html>
    <head>
    </head>
    <cfinvoke component="department"
    method="list"
    returnvariable="departments">
    </cfinvoke>
    <body>
    <cfwindow name="deptWindow" title="Department Window"
    draggable="true" resizable="false"
    initshow="false" height="400" width="600" x=200 y=100>
    <cfform action="processDepartment.cfm"
    onsubmit="ColdFusion.Window.hide('deptWindow')">
    Department:
    <cfinput type="text" name="deptname">
    <cfinput type="submit" name="submit">
    </cfform>
    </cfwindow>
    <a href="#"
    onClick="ColdFusion.Window.show('deptWindow')">Add
    Department</a>
    <cfdiv>
    <table>
    <tr>
    <th>Department</th>
    <th>Action</th>
    </tr>
    <cfoutput query="departments">
    <tr>
    <td>#deptname#</td>
    <td><a href="##"
    onClick="ColdFusion.Window.show('deptWindow')">Edit</a></td>
    </tr>
    </cfoutput>
    </table>
    </cfdiv>
    </body>
    </html>
    Here's my department.cfc page:
    <cfcomponent output="false">
    <cfset THIS.dsn="cf8test">
    <cffunction name="list" access="remote" output="false"
    returntype="Query">
    <cfquery name="departments" datasource="#THIS.dsn#">
    SELECT department_id, deptname
    FROM departments
    ORDER by deptname
    </cfquery>
    <cfreturn departments />
    </cffunction>
    <cffunction name="add" access="public" output="false"
    returntype="Boolean">
    <cfargument name="deptname" required="true"
    type="string">
    <cfquery datasource="#THIS.dsn#">
    INSERT INTO departments(deptname)
    VALUES (<cfqueryparam value="#Trim(ARGUMENTS.deptname)#"
    cfsqltype="cf_sql_varchar">)
    </cfquery>
    <cfreturn true />
    </cffunction>
    </cfcomponent>
    And finally, here's my processDepartment.cfm page:
    <!--- Form Field Validation --->
    <cfparam name="FORM.deptname" type="string">
    <cfif IsDefined("FORM.id")>
    <cfset method="update">
    <cfelse>
    <cfset method="add">
    </cfif>
    <cfinvoke component="department"
    method="#method#">
    <cfif IsDefined("FORM.id")>
    <cfinvokeargument name="id"
    value="#FORM.id#">
    </cfif>
    <cfinvokeargument name="deptname"
    value="#Trim(FORM.deptname)#">
    </cfinvoke>
    <!--- When done go back to the Departments listing --->
    <cflocation url="/departments.cfm">

    Hi Jeff,
    One way to do it is to write a JavaScript function that binds
    to your CFC. The CFC should both insert the user values, and then
    select all of the departments from the department table, and then
    return the query set to the page. I wrote sort of a test page which
    gets the state from the States table according to the state
    abbreviation that the user types in from a CFWindow. The table
    never gets updated, however, the result comes back from the CFC
    through AJAX, then updates the main page. You can use this same
    idea but you'll have to update your CFC a little bit. However, the
    idea is the same.
    Here's the code for my get State application. Especially
    notice the following three lines of code in the JavaScript function
    called getStates:
    var d = new getStates2(); //this is the name of your CFC
    d.setForm('form1'); //not sure if you need this, but I found
    it somewhere
    var stateName = d.getAllStates(); //the name of the function
    inside your CFC
    Anyway here's the code in full:
    <style>
    .stateClass {
    font-family: arial;
    font-weight: bold;
    font-size: 12pt;
    padding-top: 10px;
    </style>
    <cfajaxproxy cfc="getStates2">
    <script language="javascript">
    function enter_pressed(e){
    var keycode;
    if (window.event) keycode = window.event.keyCode;
    else if (e) keycode = e.which;
    else return false;
    return (keycode == 13);
    function getStates()
    if(document.form1.theState.value == '') {
    alert('Please make sure the textbox is not empty.');
    return false;
    var d = new getStates2();
    d.setForm('form1');
    var stateName = d.getAllStates();
    ColdFusion.Window.hide('stateWin');
    if (stateName == '')
    document.getElementById('stateDiv').innerHTML = 'No such
    state';
    else
    document.getElementById('stateDiv').innerHTML = 'The state
    is ' + stateName;
    </script>
    <cfwindow name="stateWin" x="100" y="100" width="400"
    height="200">
    <form name="form1" method="post" onsubmit="return
    false;">
    <input name="theState" type="text" size="5"
    onKeyPress="if(enter_pressed(event)){ getStates() }"
    />
    <input type="button" value="get state"
    onClick="getStates()">
    </form>
    </cfwindow>
    <div id="stateDiv" class="stateClass">
    </div>
    <a
    href="javascript:ColdFusion.Window.show('stateWin')">find a
    state</a>

Maybe you are looking for

  • My ipod safari can't open links or press buttons.

    Like for instance,I tried to press one of the episodes from http://www.justanimedubbed.tv/watch/adventure-time/ and it won't let me.When I press it,it doesn't do anything...And even if I type the specific URL for the episode,it won't let me watch the

  • Multi-machine sequence missing from AE?

    Hi there after i installed the script BG Render, not sure what happened but multi-machine sequence becomes missing from AE as it says on startup that there is an output module missing from after effects, really need to solve this as I am running out

  • I can't access my email address to activate my icloud

    I have just got a new phone kept the same number and i can't access my icloud to synch due to not able to recover password as since i set up icloud i have changed number but not updated it on icloud. also email has changed too.  I have set up a new i

  • Lost vert/horiz scroll feature-no synaptic icon in hardware. HELP!

    After a recent "computer cleansing" we seem to have lost our ability to use touchpad vert/horiz scroll feature- in hardware, there is no synaptic icon on which to click to remedy the problem.  We have a Compac Presario A931NR notebook PC. Is there so

  • Escape a & in an inlist

    I am attempting to escape the & character in an inlist. I have tried unsuccessfully to use the \ Example: note the last item of the inlist AND dp.code    NOT IN ('CES', 'COUNCL', 'CITSER', 'RECYCL', 'C&NSRV')Any ideas are appreciated.