Another nooblike question on DataTable and displaying ResultSets from db...

Hey guys,
I am trying to follow this tutorial example:
http://www.oracle.com/technology/oramag/oracle/06-jan/o16jsf.html
I am doing the second part of the example because the first part is not matching with what I want to do. So if you go through the code and I am sure for you gents its absolutely no problem to analyze and decipher the code. Basically I have a 2 column small table that I want to show up on the screen. I am using this as a learning example. I understand most of the code posted except for the variable 'column1' or 'column2' are. For the life of me I cannot figure out what it is. If someone can fill in the missing gap I would appreciate it. Also another part of the code that is kind of not making sense is the dataTable1.setVar("catalog"); line. Where does the author get 'catalog' from?
Hope someone can help me out.
Thanks in advance.
Surya

In this line dataTable1.setVar("catalog"); you are making a reference to your value. Inside the datatable, you will refer to the value (a register in the model) as catalog. So you can access all properties of a single register.
Column1 and column2 are columns in the table.
It's better to you to see first a more simple example of a datatable.
http://www.laliluna.de/first-java-server-faces-tutorial.html

Similar Messages

  • Help, how to open and display blobs from tables

    Dear all,
    I am trying to store ms-word files on a table using a blob column.
    Does anyone how to open the files and display them from a form using 9iAS?
    Thank you.
    Carlos.

    And there may be, but you won't likely find that here. Do some time searching Google and maybe you'll find code that someone was nice enough to make freely available, although I wouldn't count on it. Were i a programmer and took the time to read those docs and write the code, I'd want to be paid for my time. But there are a lot of programmers who swear by freeware! You may get lucky.

  • How to acquire and display data from labview to excel simultaneo​usly

    hello,
    I am using the NI-DAQ to measure the falling edges of a clock and display them into a table. What I need is to display these data in a table in excel while the program is running. In addition, when I receive a pulse from an external clock, for which I have created a digital channell, the data must be logged in a different column. In other words, every time I receive a pulse the data must be stored in the adjacent column in excel.

    Hello Evangelos,
    As far as I know and have experienced, it is not possible to access a spreadsheet file (or any file, for that matter) by two programs at the same time, you will get an error.
    Also, a couple of observations on your code:
    A constant wired to a case selector of a case structure makes no sense as the false case will never be executed.
    Move the DAQmx Read from your Digital Input task into the while loop, as the DAQmx Read will only read once and the wire won’t get information in or out of a while loop as long as the while loop is iterating.
    Regards,
    Daniel REDS
    RF Systems Engineer
    Help us grow.
    If a post solves your question, mark it as The Solution.
    If a post helps, give Kudos to it.

  • How can I get dataTable to display values from the java layer?

    When I use the dataTAble in my JSP page it will only display values from my java layer if the facets tag has it's name set to "header". Why is this happening?
    If I set it to "header" and I look at the page source it actually has created the correct number of rows but it doesn't put the values between the <td> tags? It see's the length of my list but it doesn't pick the values out of the list.
    <h:dataTable var="data" value="#{NameBean.test}" border="1">
    <h:column>
    <f:facet name="header">
    <h:outputText value="Name"/>
    </f:facet>
    </h:column>
    <h:column>
    <f:facet name="header">
    <!-- <h:outputFormat styleClass="outputFormat" id="format1" value="#{NameBean.test}"></h:outputFormat>-->
    <h:outputText styleClass="outputText" value="#{NameBean.test}" style="" rendered="true" escape="false"/>
    </f:facet>
    </h:column>
    </h:dataTable>
    public List gettest()
              List li = new LinkedList();
              Object Developers[] = {"M@n00j", "sdsadas"};
              for( int i = 0; i < Developers.length; i++ )
                   li.add(Developers);
              return li;
    Thanks in advance to anyone that can help.
    -ls6v

    I've been able to get it working with some of those changes along with changes in the JSP. I think it's a setting or two in the JSP that'll allow the program to run correctly.
    I have a list and it's returned like what you suggested. A day or two ago I tried to move the outputtext outside of the facet tag but nothing would print, I know believe that's related to the following setting in the JSP:
    rows="0" in the <h:dataTAble tag
    Unfortunately the dataTAble isn't displaying the values correctly. It prints all of the values (Strings) in the list on each row and it make a new row for the number of items in the list.......... ???
    Here's what it's printing to the screen (the table):
    ===================
    == [asdasd], [sddfdfd] ==
    ===================
    ===================
    == [asdasd], [sddfdfd]==
    ===================
    what it should print:
    ============
    == [asdasd] ==
    ============
    ============
    == [sddfdfd] ==
    ============
    My code:
    public List gettest()
              List li = new ArrayList();
              li.add("asdasd");
              li.add("affffd");
              return li;
              }JSP
    <h:dataTable border="1" columnClasses="list-column-left"
        headerClass="list-header"
        rowClasses="list-row-odd"
        id="table"
        rows="0"
        value="#{NameBean.test}"
        var="data">
    <h:column>
    <f:facet name="header">
    <h:outputText value="test"/>
    </f:facet>
    <h:outputText value="#{NameBean.test}" style="" rendered="true" escape="false"/>
    </h:column>
    </h:dataTable>

  • Importing and displaying captions from Aperture to iPhoto

    I'm using Aperture as my main photo library, then exporting select pictures with a copyright watermark on them. Then I'm importing those watermarked photos into iPhoto so that I can drag them into albums in iWeb (so the watermarks show).
    I'd like for the captions to show under the photos in iPhoto, but instead the keywords do. I can't find a place to require iPhoto to display the captions other than the little caption window in the lower left of the window.
    Problem is, I need the captions to chow up ultimately under the photos in the iWeb albums, but they don't. Instead, it's the keywords that show up, just like they do in iPhoto. My reasoning is that if I can get the captions to display under the photo in iPhoto, they will do the same in iWeb (I could be wrong on this).
    So the ultimate question is: how to get iPhoto to import and display Aperture-entered captions and then pass them on to iWeb.
    I've seen a few variants on this topic, but none that specifically address this issue.

    Randy
    There is no way to make iPhoto display the captions under the Photos in iPhoto. For specific help with iWeb, try posting on that forum.
    Regards
    TD

  • Store and Display Image from Database

    Now that MySQL is working (woo hoo!) with JSC, I have a couple of questions for any experts out there...
    1. How would I perform an image or other file upload from a browser?
    2. How would I retrieve and display an image from a db on a jsp page?
    Thanks for any help.

    Craig, I think I have a simpler way to load an image on the page, although for the time being I'm not retrieving from a database, but from the file system. The problem is that I'm not getting the pages to load continuously with new images. At some point it apears that the session gets clogges and can not load new pictures. I'll try to include the page bean code just below. This time I'm not adding the "code" tags because I haven't being successful with that. If you have problems , please, contact me at [email protected].
    The core of the code is in a couple of button_action methods.
    If you need, I can give access to the http server where this is running.
    Luiz
    package untitled;
    import javax.faces.*;
    import com.sun.jsfcl.app.*;
    import javax.faces.component.html.*;
    import com.sun.jsfcl.std.*;
    import javax.faces.component.*;
    import javax.swing.filechooser.*;
    import javax.swing.*;
    import java.io.*;
    * Creator-managed class.
    * Your code should be placed at the end.
    public class Page1 extends AbstractPageBean {
    private HtmlForm form1 = new HtmlForm();
    private FileSystemView filesystem = FileSystemView.getFileSystemView();
    private File path = new File("C:/Documents and Settings/Luiz Costa/My Documents/Creator/Projects/PictureAlbum/build/images/Isadora\'s Wedding");
    private File[] fileslist = filesystem.getFiles(path, false);
    private int counter = 1;
    private int iw = 0;
    private int ih = 0;
    private Integer aiw = new Integer("1");
    private float aar = 0;
    private float ar = 0;
    private ImageIcon ii = null;
    public HtmlForm getForm1() {
    return form1;
    public void setForm1(HtmlForm hf) {
    this.form1 = hf;
    private HtmlGraphicImage image1 = new HtmlGraphicImage();
    public HtmlGraphicImage getImage1() {
    return image1;
    public void setImage1(HtmlGraphicImage hgi) {
    this.image1 = hgi;
    private HtmlCommandButton button1 = new HtmlCommandButton();
    public HtmlCommandButton getButton1() {
    return button1;
    public void setButton1(HtmlCommandButton hcb) {
    this.button1 = hcb;
    private HtmlCommandButton button2 = new HtmlCommandButton();
    public HtmlCommandButton getButton2() {
    return button2;
    public void setButton2(HtmlCommandButton hcb) {
    this.button2 = hcb;
    private HtmlGraphicImage image2 = new HtmlGraphicImage();
    public HtmlGraphicImage getImage2() {
    return image2;
    public void setImage2(HtmlGraphicImage hgi) {
    this.image2 = hgi;
    private HtmlOutputText outputText1 = new HtmlOutputText();
    public HtmlOutputText getOutputText1() {
    return outputText1;
    public void setOutputText1(HtmlOutputText hot) {
    this.outputText1 = hot;
    * This constructor contains Creator-managed initialization code.
    * Your initialization code can be placed at the end,
    * but, this code will be invoked only the first time the page is rendered,
    * and any properties set in the .jsp file will override settings here.
    public Page1() {
    // Creator-managed initialization code
    try {
    catch ( Exception e) {
    log("Page1 Initialization Failure", e);
    throw new FacesException(e);
    // User provided initialization code
    public String button1_action() {
    // Add your event code here...
    outputText1.setValue(fileslist[counter].getAbsoluteFile().getPath()+fileslist.length+"left"+counter);
    ii = new ImageIcon("images/Isadora\'s Wedding/"+fileslist[counter].getName());
    ar = (float)ii.getIconHeight()/(float)ii.getIconWidth();
    // aiw = new Integer(image1.getWidth());
    aiw = new Integer(ii.getIconHeight());
    aar = ar*aiw.intValue();
    image1.setHeight(""+(int)aar);
    outputText1.setValue(image1.getHeight());
    image1.setUrl("images/Isadora\'s Wedding/"+fileslist[counter].getName());
    ii = new ImageIcon("images/Isadora\'s Wedding/"+fileslist[(counter + 1 + fileslist.length) % fileslist.length].getName());
    ar = (float)ii.getIconHeight()/(float)ii.getIconWidth();
    // aiw = new Integer(image2.getWidth());
    aiw = new Integer(ii.getIconHeight());
    aar = ar*aiw.intValue();
    image2.setHeight(""+(int)aar);
    outputText1.setValue(image2.getHeight());
    image2.setUrl("images/Isadora\'s Wedding/"+fileslist[(counter + 1 + fileslist.length) % fileslist.length].getName());
    counter = (counter-1+fileslist.length) % fileslist.length;
    return null;
    public String button2_action() {
    // Add your event code here...
    outputText1.setValue(fileslist[counter].getAbsoluteFile().getPath()+fileslist.length+"right"+counter);
    ii = new ImageIcon("images/Isadora\'s Wedding/"+fileslist[counter].getName());
    ar = (float)ii.getIconHeight()/(float)ii.getIconWidth();
    // aiw = new Integer(image1.getWidth());
    aiw = new Integer(ii.getIconHeight());
    aar = ar*aiw.intValue();
    image1.setHeight(""+(int)aar);
    outputText1.setValue(image1.getHeight());
    image1.setUrl("images/Isadora\'s Wedding/"+fileslist[counter].getName());
    ii = new ImageIcon("images/Isadora\'s Wedding/"+fileslist[(counter + 1 + fileslist.length) % fileslist.length].getName());
    ar = (float)ii.getIconHeight()/(float)ii.getIconWidth();
    // aiw = new Integer(image2.getWidth());
    aiw = new Integer(ii.getIconHeight());
    aar = ar*aiw.intValue();
    image2.setHeight(""+(int)aar);
    outputText1.setValue(image2.getHeight());
    image2.setUrl("images/Isadora\'s Wedding/"+fileslist[(counter + 1 + fileslist.length) % fileslist.length].getName());
    counter = (counter+1+fileslist.length) % fileslist.length;
    return null;
    }

  • Pass variables and return ResultSet from same preparedStatement

    I am passing "fp" and "week_no" to a preparedStament in a class and want to return the values to my jsp page. "fp" and "week_no" are used twice. Please see below. When I run it, I get no error messages but, it doesn't display any data.
    I have the following code in a class:
    public ResultSet getHistory(String fp, String week_no)
                        throws SQLException, Exception {
    ResultSet rs = null;
    if (con != null) {
    try {
         PreparedStatement getHist;
         getHist = con.prepareStatement(
         "SELECT sbu, TO_CHAR(((sum_dollar) + (adj_sum_dollar)),'$999,999,999.99') AS sum_dollar, TO_CHAR(actual_date,'MM/DD/YY') AS actual_date, " +
         "((sum_cases) + (adj_sum_cases)) AS sum_cases, " +
         "((new_order_cases) + (adj_new_order_cases)) AS new_order_cases, " +
         "((total_open_orders) + (adj_total_open_orders)) AS total_open_orders, " +
         "((back_orders) + (adj_back_orders)) AS back_orders, " +
         "TO_CHAR((sum_dollar/sum_cases), '999.99') AS yield " +
         "FROM SUMMARY " +
         "WHERE actual_date BETWEEN (SELECT begin_dt " +
                   "FROM fiscal_calendar " +
                             "WHERE fiscal_period = '?' " +
                             "AND week_number = '?' " +
                             "AND week_number <> '9' " +
                             "AND fiscal_yr = '2003') " +
                        "AND " +
                             "(SELECT end_dt " +
                        "FROM fiscal_calendar " +
                             "WHERE fiscal_period = '?' " +
                             "AND week_number = '?' " +
                             "AND week_number <> '9' " +
                             "AND fiscal_yr = '2003') " +
              "ORDER BY actual_date, sbu ");
         getHist.setString(1, fp);
         getHist.setString(2, week_no);
         getHist.setString(3, fp);
         getHist.setString(4, week_no);
         rs = getHist.executeQuery();
         } catch (SQLException sqle) {
    error = "SQLException: Update failed, possible duplicate entry.";
         throw new SQLException(error);
    } else {
    error = "Exception: Connection to the database was lost.";
         throw new Exception(error);
    return rs;
    This is in my jsp:
    <%
    String fp = request.getParameter("fp");
    String week_no = request.getParameter("week_no");
    historyInfo.connect();
    ResultSet rs = historyInfo.getHistory(fp, week_no);
    while (rs.next()) {
    //String sum_dollar = rs.getString("sum_dollar");
    %>
    <%= rs.getString("sum_dollar") %>
    <%
    %>

    Hi,
    First thing U can't do this way in java. If U are executing this sort of database query, after retriving all the values, put inside Haahtable or HashMap as the application required and return it.
    Otherwise execute this query at the same place where u r printing values in jsp page insted of writing it inside seperate method..It will work.
    If still it's not workimg, please let me know.
    Rajeh Pal

  • How to decode and display jpeg from a bytes stream ?

    Hello.
    I am new to Flex and got stuck on something that I assume has an easy solution.
    I have an RIA application in which I want to display a jpeg image. this image was
    sent on a Web Service message,  as an array of bytes (I just read the jpeg file as
    is and send it to the web application).
    I couldn't figure out a way to decode and display this image at the RIA, using an apropriate component. (Image ?)
    I have seen a few examples where a jpg is loaded from a web server using a url in
    which it's avaliable, but I don't think this is much help to me...
    Your help/example apreciated.

    Thanks.
    I assume you mean passing the bytesArray to Image.load() ?
    Anyway, that's what I did and it worked fine.
    Now I am facing the same issue with playing sounds, which are available on bytesArray.
    I tried to pass the mp3 bytes to the Sound.load(), but it doesn't work, becuase it tries
    to cast it to a URL. do you know by any chance  whether I can achieve that somehow ?
    (I could use prety much any other sound format, if it makes a difference)
    Thanks again.

  • Loading And Displaying image From MYSQL

    Hello, How can I load and display picture stored into a MYSQL database in a Swing GUI using for example JLable component.

    establish a connection to ur sql, n
    retireve the record with the images or image url in the db.
    and then load it to a Image icon and set it to a JLabel.

  • Retrieve and display info from 3 tables

    Been struggling with this for some days now. Setting up a calendar with football fixtures. For some reason, the team names do not appear in the table and this is really killing me. I thought I knew something about sql and php, guess not.
    So for building up this page, I use 3 tables, Season, Teams & Calendar containing a.o. these columns. The first table, season, has only 1 record/row, being the season that's up, in this case 2010-2011:
    Season
    id (primary key - AI)
    current
    Teams
    id (primary key - AI)
    season
    leagueid
    teamid (unique value)
    teamname
    Calendar
    id (primary key - AI)
    season
    leagueid
    hometeamid
    awayteamid
    So, what the query should look like is, based on that 1 record from the table season, it has to select all games from the table calendar, selecting all the columns as displayed above. Now that's the easiest part, the hardest part is, replacing the hometeamid AND awayteamid by their names from the teams table. The teamid you see in the table teams is also used in the table calender. Below some basic input from the tables in question, to get a better feel of it:
    Season
    1
    2010-2011
    Teams
    ID
    Season
    League ID
    Team ID
    Team Name
    1
    2010-2011
    u12
    1245-u12aa
    Team XYZ
    2
    2010-2011
    u8a
    9521-u8a
    Team ABC
    3
    2010-2011
    u12
    1245-u12a
    Team HFH
    Calendar
    ID
    Season
    League ID
    Hometeam ID
    Awayteam ID
    1
    2010-2011
    u12
    1245-u12aa
    5874-u12a
    2
    2010-2011
    u12
    9521-u12ab
    7436-u12ab

    So far you have 4 tables, so the links between the 4 tables is:
    1)id from season table(parent) is linked to seasonid from teams table(child)
    2)id from season table(parent) is linked to seasonid from calendar table(child)
    3)id from league table(parent) is linked to leagueid from teams table(child)
    So the joins between them are:
    JOIN1: season.id=teams.seasonid
    JOIN2: season.id=calendar.seasonid
    JOIN3: league.id=teams.leagueid
    To extract from multiple tables, SQL query would be as follows:(criteria 1 is optional)
    SELECT * FROM teams,season,league,calendar
    WHERE [CRITERIA 1] AND JOIN1 AND JOIN2 AND JOIN3
    To create relational tables, change all the tables ENGINE=INNODB
    then
    ALTER TABLE foreign table name ADD FOREIGN KEY(' insert foreign key') REFERENCES(' insert database.primary table.primary key ')
    ON DELETE CASCADE ON UPDATE CASCADE

  • Querying and displaying data from a database

    Hi,
    The environment I am working in has the EBIZR12 suite installed on the apps server APP1, the EBIZR12 database deployed to server DB1 listening on port 1522 and a MIDTIER database deployed to server DB1 listening on port 1521. I have a custom page that needs to query the data off of MIDTIER and populate a display table. The page I have created emulates that of the Search tutorial. I have an application module that contains a BC4J object and views and these are connecting to the MIDTIER to retrieve data. It has a table that should display queries returned from the MIDTIER database. My question is, are there any limitations with OA framework development and deployment that would NOT make this feasible? if not is there anything else I would need to do either as a pre-requisite or as part of my page construction to make this work, because currently my page table is not being populated and I am not getting any exceptions on the page to indicate the database is either unreachable or the connection configurations are incorrect. Any help is very much appreciated.
    regards,

    Yes, in case of query region, an executequery was getting called on clicking go button. But now as you just have a table mapped to a VO, you also need to call the executequery explicitly in the page controller's processRequest method.
    Your point "I would like to point out that the instructions in those tutorials are not compatible with the newest version of JDEV" is completely wrong. First of all each Jdev has its own set of tutorials reflecting all the changes in that particular version. Secondly, as you are trying to use a particular scenario steps to create something different, you can't expect it to handle all the side off scenarios you can make. Drag and drop UI won't get you more than a few basic screens. Read more and you will understand the working of framework.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to retrieve and display image from database in a web page

    Hi all;
    I have been trying this for some time now. I have found some tutorials so far but none of them addresses my concern. Here it is:
    I have built a web application that can connect to an Oracle DB.
    I have a table called "employee", where I record any employee details, among which the employee picture. I stored the pictures and the finger prints using "Oracle sql developper" as blob type.
    How can i retrieve and view all these information when i run the application?
    I can easily retrieve all other types of value, but the image(BLOB type) has been a nightmare for me.
    HELP PLEASE.

    morgalr wrote:
    I believe your Binary Large Obejct will come back as an array of int, and you'll need to use BufferedImage it's associated API to get it to a viewable image configuration.I don't think BufferedImage immediately solves the problem -- this is a web app, so I assume the image will be displayed using the HTML IMG tag.
    Solution: google. There are many example of how to do this. For example, any book on servlets will have an example of dishing up a dynamic image.

  • How to store and display Response from REST Service

    Hi,
    My WADL has defined the response that my REST service returns back as below :
    <object name="Get_Root">
            <property name="RequestId" type="number" />
            <property name="Name" type="string" />
            <property name="fromPlace" type="string" />
            <property name="toPlace" type="string" />
            <property name="fromDate" type="string" />
            <property name="toDate" type="string" />
    </object>
    I want to store this response; response is a single entry of the above type and not a collection (I am making the request on a button click) and then display it on the screen in multiple labels.
    How can I do this? Will I have to use a collection and a gallery, even though I have a single response?
    Thanks,
    Pragya

    Okay.. got it. So MyRestData has a Get function taking some n arguments and it responds back with an object of the type I had mentioned before.
    From what I understood, I have to write the below code for each label
    MyRestData!Get(.....)!Name
    MyRestData!Get(.....)!fromPlace
    MyRestData!Get(.....)!toPlace ...and so on
    Wouldn't that translate to different REST calls? Is there a way to get and store the entire response object
    in the app and access each of its properties/subelements locally?
    Also when you wrote the below before
    Text: "The name is: " &  MyRestData!Get_Root!Name
    it seems that I can access the response object Get_Root using MyRestData. This is not the case for me. MyRestData only lets me access the Get function using "!", and not the response object in any way.
    Thanks for your help!

  • How to control and display video from IP camera using ActiveX control over Internet.

    Hello,
    I need to control my IP cameras over the internet. I need to log into the cameras and then display the video.  There's an ActiveX control registered on the computer and works fine with IE to access and control the cameras. Controlling the cameras using IE works fairly well, but there are some quirks that I'd like to eliminate by using my own custom code.
    Has anyone created a vi that controls a Foscam FI8905W over the Internet? I’ve attempted, but I keep getting a catastrophic failure when I try to call ManagementConnect Method in the DVM_IPCam2 ActiveX Control Module V1.0. I'm not sure whether I need to establish an IP connection with the cameras first, or allow the ActiveX control to establish it for me.
    Some example code would be greatly appreciated. Running LabVIEW 2011 on a Win7 32bit.  Even some code used to control a similar device using ActiveX over Internet would be helpful.

    I have an example vi for interfacing to the foscam activex.
    I plan on using mouse click events within the activex window to trigger the PT function.
    I only have the basic up/down/right/left directions and not the down-right/down-left/up-right/up-left in the enum.  You can load the camera's web page and view the source to see the Java script code that uses the activex control.  There are definitions for the other directions.
    I had to mark the control as "Disabled" to keep click events from going to the activex control.  If I double click the control, it goes full screen.  If I then click on it to get out of full screen mode the video never returns or returns to the wrong spot in the VI.
    Attachments:
    Foscam Demo.vi ‏24 KB

  • How to go about building a app that searches for and displays pages from Google.

    I was wondering how i would go about building an app that takes a users input such as a sentence (not a URL) and then searches  for their input on Google. This app would then have to display a selected page automatically on the UIWebView.
    My existing code in my viewcontroller.m is as follows:
    - (void)viewDidLoad
    [super viewDidLoad]; [webView loadRequest: [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]];
    I now want my app to use a users input (a word or a sentence) and search Google with that input but do it in the background then display the first search result in the UIWebView, what code would i need?
    Thanks

    Sorry, I cant view the App Store Review Guidelines
    https://developer.apple.com/appstore/resources/approval/guidelines.htmllink, maybe its because i dont have a developers account yet i will be getting one when i am ready to launch my app on the app store.

Maybe you are looking for