Can't Understand ADF example code

Hi All,
I am trying to learn ADF from the Oracle Tutorial, but I can't understand this loop:
public Integer getNextLineItem() {
int maxLineNo = 0;
for (ServiceHistories
svh:getServiceRequests().getServiceHistoriesCollection()){
if (svh.getLineNo() !=null) {
int testLineNo = svh.getLineNo().intValue();
if (testLineNo > maxLineNo){
maxLineNo = testLineNo;
return ++maxLineNo;
}

Hi,
It is always a best practice to post the required information while posting the questions.
1. JDeveloper version.
2. The link to the tutorial you are using.
From the initial look, the code looks for the rows in the ServiceRequests table (as collection), and gets the linenumber column. Check its value, and returns the max line number +1.
-Arun

Similar Messages

  • Where can I download LabVIEW example codes for NI PCI-6014

    I bought an PCI-6014 DAQ device, please tell me where I can download the LabVIEW codes for this device.

    Hi,
    If you have labview package, you can find lot of examples there.
    Start Labview -> Help Menu -> Find Examples-> Hardware input and output -> DAQ -> Here you either you can go to analog input -> then general -> search vi as per your requirement.
    Or you can use timer/counter/digital input & output example vi from here.
    Hope it helps. Your feedbacks are welcome.
    Best Regards,
    Nirmal

  • Asking for example code (RFComm Bluetooth Application)

    hello there, i almost give up on finding a way to connect a client application using widcomm sdk on pc to server application using jsr82 j2me on mobile ph0ne ...
    anybody can give me an example code for connecting both of them ...
    if u can, or have some advice for me please give me that valueable thing...
    my recent not working application :
    - server deployed on mobile phone using jsr82 j2me
    - client on pc using widcomm sdk visual c++ .net
    or may be u can correct and give me advice for my code bellow...
    Server (JSR82) :
    private static final UUID APP_UUID = new UUID("F0E0D0C0B0A000908070605040302010", false);
    private static final String URL = "btspp://localhost:"+APP_UUID+";name=My App;authorize=false";
    private static final String APP_ID = "My App";
    private static final int ATTR_ID = 0x1234;
    try {
    localDevice = LocalDevice.getLocalDevice();
    localDevice.setDiscoverable(DiscoveryAgent.GIAC);
    notifier = (StreamConnectionNotifier)Connector.open(URL);
    DataElement base = new DataElement(DataElement.STRING, APP_ID);
    record = localDevice.getRecord(notifier);
    record.setAttributeValue(ATTR_ID, base);
    connection = notifier.acceptAndOpen();
    catch(Exception e) {
    System.err.println(e.getMessage());
    Client (Widcomm SDK) :
    StartDiscovery(m_BdAddr, m_pServiceGuid)CSdpDiscoveryRec Sdp_Record;
    if ( ReadDiscoveryRecords(m_BdAddr, 1, &Sdp_Record, m_pServiceGuid) )
    UINT8 scn;
    SDP_DISC_ATTTR_VAL *pVal;
    if ( Sdp_Record.FindRFCommScn(&scn) )
    //if(Sdp_Record.FindAttribute(0x1234, pVal))
    I can't find an RFComm channel number from server (the j2me one)
    regards, Arch_Cancer
    // sorry my bad english
    Edited by: Arch_Cancer on Jun 20, 2008 12:03 AM

    Still looking for solutions. Looks like many Z-W88 users are having trouble with iPhone only. Assistant does not ask for pairing code, just ask confirmation of a six digit number or Bluetooth device.
    Also this problem is more common on recent iOS versions.
    There is not info about how to force iPhone to ask for pairing code, and support at stores have no idea how to make it work either, so I'm kind of stuck with this.
    If anyone have any ideas I'm open to them...
    Thanks :)

  • Documentation/Example Code for WAPI

    Can anybody point me to a place from where i can get Documentation or Example Code for WAPI calls. Especially
    SAP_WAPI_START_WORKFLOW
    SAP_WAPI_WRITE_CONTAINER.

    Can anybody point me to a place from where i can get Documentation or Example Code for WAPI calls. Especially
    SAP_WAPI_START_WORKFLOW
    SAP_WAPI_WRITE_CONTAINER.

  • How can i use ADF code in Trinidad

    Hi,
    I'm having an small Application which is Implemented to some extent using oracle ADF faces components But now, as the Trinidad is an open source i would like to do it in trinidad.
    If i replace the libraries to trinidad does my implement code in ADF Faces components needs to be Change,
    Please Suggest me how can use my ADF code in Trinidad.
    Thanks.

    Hi,
    Thanks for the Information a lot,it will helps me a lot.
    i am unable to navigate to down load the libraries given in oracle site in "How-to configure Apache Trinidad components in Oracle JDeveloper " can u help me,
    how can i get libraries to use in Oracle Jdeveloper for Trinidad.
    Can i use the libraries given on the Apache MyFaces Trinidad site (http://myfaces.apache.org/trinidad/download.html) but the libraries are different than the oracle given.
    Please Help me what libraries to used in Oracle jdeveloper 10g for trinidad.
    Thank You.

  • Can someone help me find the JavaMail example code?

    Hello, once I found a collection of source code files that contained example code for using the JavaMail API. Now I cannot find the collection. Is it still online? Can anyone help me find the JavaMail example code? Sorry if this question seems to easy - I've been searching for a while now without success.
    Thanks in advance,
    Paul Humphrey

    Really? You can't find it? My answer above wasn't
    clear? And this FAQ entry didn't help?
    http://java.sun.com/products/javamail/FAQ.html#examples
    Please, tell me how I could make the answer more clear to you...

  • Is anyone have an example code on CAN Periodic Transmission

    I'm looking for an example code for a CAN periodic transmission in Labwindows CVI, because the example deliver with NICAN is not interesting for me.
    If anyone have an example code,

    Hi Lilian,
    The Obj2Obj.c example shows how to configure a CAN object for periodic Tx (one frame each second).
    In this case, the write queue length is set to 0, which means that the last written value is transmitted. You can set a non-zero queue length to transmit a set of frames.
    DiegoF
    National Instruments.

  • How can i find 8451 & I2C example code.(Labview 7.1)

    How can i find 8451 & I2C example code.(Labview 7.1)
    ! will have to commuicate Data Read and Write
    (USB-8451 &  I2C(ST24C16) direct connection status)
    I want to Detail text and VI Example.
    Thank you.
    [ps] [email protected]

    If you installed the NI-845x driver, it should have installed in LabVIEW examples in the Example Finder. These will be configured for the 8451 but not necessarily your specific I2C device. The examples are located in the Hardware Input and Output»I2C and SPI folder in the Browse view of the Example Finder. I hope this helps!
    Regards,
    Missy S.
    Calibration Engineer
    National Instruments

  • Can you give me the example codes for DaqCard-12​00 at register-l​evel programmin​g

    Where could I find some example code in DaqCard-1200 Register_level programming Manual

    This forum is for discussion of Measurement Studio for Visual C++. You can post questions about DAQ to the Multifunction I/O secition here.
    Best Regards,
    Chris Matthews
    National Instruments

  • Can catamorphism or anamorphism or other morphism generalize code to combinatorial level from one example or more then one example code

    can catamorphism or anamorphism or other morphism generalize code to combinatorial level from one example or more then one example code
    if they can not, which methods or algorithm can generalize logic or code to combinatorial level ?
    computing nightmare

    can catamorphism or anamorphism or other morphism generalize code to combinatorial level from one example or more then one example code
    if they can not, which methods or algorithm can generalize logic or code to combinatorial level ?
    computing nightmare

  • Can't understand why my DefaultListCellRenderer doesn't work

    Hello i know that from the subject title it seems that this is the wrong category to post but because i need to load thumbnails in list and i resize them i didn't know where to post sorry if it is the wrong plase and also sorry for my bad english.
    I am making a programm that get's from the user some image paths , then makes thumbnails and then shows the thumbnails with a status and the name of the image. My list has HORIZONTAL_WRAP layout orientation and because i want to show the name the status and the thumbnail in the list i made a DefaultListCellRenderer. The problem is that when i add elements in the list it appears nothing but when i press with the mouse somewhere int the list the listImagesValueChanged is invoked and the data are passed correctly. I made an class named ImageThubInfo to save the name and the thumbnail for eatch image, also i am using a swing worker to create the thubnails and pass them along with all other information in ImageThubInfo and then store all ImageThubInfo objects to a list. When the worker thread is done it tries to add those elements to the list here is my code
    import java.awt.image.BufferedImage;
    import javax.swing.ImageIcon;
    import javax.swing.JOptionPane;
    * ImageThubInfo stores information for each image
    * @author maxsap
    public class ImageThubInfo  {
        public ImageThubInfo() {
        public ImageThubInfo(String status, String name, int width, int height, long size) {
            this(status, name, width, height, size, null);
        public ImageThubInfo(String status, String name, int width, int height, long size,BufferedImage thumbnail) {
            this.status = status;
            setName(name);
            this.width = width;
            this.height = height;
            this.size = size;
            this.thumbnail = thumbnail;
        public void setStatus(String status) {
            this.status = status;
        public String getStatus() {
            return status;
        public void setName(String name) {
            int indexOf = name.indexOf(".");
            this.name = name.substring(0, indexOf);
            JOptionPane.showMessageDialog(null, this.name);
        public String getName() {
            return name;
        public void setWidth(int width) {
            this.width = width;
        public int getWidth() {
            return width;
        public void setHeight(int heigth) {
            this.height = height;
        public int getHeight() {
            return height;
        public void setSize(long size) {
            this.size = size;
        public float getSize() {
            return size;
        public void setThumbnail(ImageIcon BufferedImage) {
            this.thumbnail = thumbnail;
        public BufferedImage getThumbnail() {
            return thumbnail;
        private String status;
        private String name;
        private int width;
        private int height;
        private long size;
        private BufferedImage thumbnail;
    }this is my DefaultListCellRenderer class
    import java.awt.Component;
    import java.awt.image.BufferedImage;
    import javax.swing.DefaultListCellRenderer;
    import javax.swing.ImageIcon;
    import javax.swing.JList;
    * @author maxsap
    public class ImageThubInfoRenderer extends DefaultListCellRenderer {
        public ImageThubInfoRenderer(){}
          @Override
        public Component getListCellRendererComponent(JList list,
                Object value,
                int index,
                boolean isSelected,
                boolean cellHasFocus) {
             super.getListCellRendererComponent(list,value,index,isSelected,
                                                                cellHasFocus);
            ImageThubInfo info = (ImageThubInfo) value;
            String name = info.getName();
            String state = info.getStatus();
            BufferedImage thumbnail = (BufferedImage)info.getThumbnail();
            setIcon(new ImageIcon(thumbnail));
            setText(name+" Current State: "+state);
            if (isSelected) {
                setBackground(list.getSelectionBackground());
                setForeground(list.getSelectionForeground());
            } else {
                setBackground(list.getBackground());
                setForeground(list.getForeground());
            return this;
    }and this is my swing worker class
    public class ThumbLoader extends SwingWorker<List<ImageThubInfo>, BufferedImage> {
          private DefaultListModel model;
          private int total;
          private File [] files;
          private List<ImageThubInfo> imageList;
          protected ThumbLoader(DefaultListModel model,File []files){
                this.model = model;
                this.files= files;
          @Override
          protected List<ImageThubInfo> doInBackground() throws Exception {
                imageList = new LinkedList<ImageThubInfo>();
                 for (int i = 0; i < files.length; i++) {
                    ImageIcon icon;
                    icon = createImageIcon(files.toString());
    if(icon != null){
    ImageIcon thumbnailIcon = new ImageIcon(getScaledImage(icon.getImage(), 100, 100,files[i]));
    return imageList;
    protected ImageIcon createImageIcon(String path) {
    if (path != null) {
    return new ImageIcon(path);
    } else {
    System.err.println("Couldn't find file: " + path);
    return null;
    private Image getScaledImage(Image srcImg, int w, int h, File file){
    BufferedImage resizedImg = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
    Graphics2D g2 = resizedImg.createGraphics();
    g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
    g2.drawImage(srcImg, 0, 0, w, h, null);
    ImageThubInfo tubInfo = new ImageThubInfo("Waiting",file.getName(),srcImg.getHeight(null),srcImg.getHeight(null),300,resizedImg);
    imageList.add(tubInfo);
    JOptionPane.showMessageDialog(null, new ImageIcon(resizedImg));
    g2.dispose();
    return resizedImg;
    }protected void done() {
    setProgress(100);
    try {
    //JOptionPane.showMessageDialog(null, imageList.size());
    List<ImageThubInfo> imageList = this.get();
    for(int i=0; i< imageList.size(); i++){
    JOptionPane.showMessageDialog(null, new ImageIcon(imageList.get(i).getThumbnail()));
    model.addElement(imageList.get(i));
    } catch (InterruptedException ex) {
    Logger.getLogger(ThumbLoader.class.getName()).log(Level.SEVERE, null, ex);
    } catch (ExecutionException ex) {
    Logger.getLogger(ThumbLoader.class.getName()).log(Level.SEVERE, null, ex);
    JOptionPane.showMessageDialog(null, "DONE");
    }}can anyone tell me what i am doing wrong???? please help because i really can't understand what i am doing wrong.
    thenks in advance                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Works okay now. Many changes to ThumbLoader:
    import java.awt.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import java.util.concurrent.*;
    import java.util.logging.*;
    import java.util.List;
    import java.util.LinkedList;
    import javax.swing.DefaultListCellRenderer;
    import javax.swing.*;
    public class ThumbLoader extends SwingWorker<List<ImageThubInfo>, Void> {
        private DefaultListModel model;
        private int total;
        private File[] files;
        private List<ImageThubInfo> imageList;
        protected ThumbLoader(DefaultListModel model, File[] files){
            this.model = model;
            this.files = files;
        @Override
        protected List<ImageThubInfo> doInBackground() throws Exception {
            imageList = new LinkedList<ImageThubInfo>();
            for (int i = 0; i < files.length; i++) {
                BufferedImage image = null;
                try {
                    image = javax.imageio.ImageIO.read(files);
    } catch(IOException e) {
    System.out.println("read error for " + files[i].getPath() +
    ": " + e.getMessage());
    if(image != null){
    BufferedImage scaled = getScaledImage(image, 100, 100);
    ImageThubInfo tubInfo = new ImageThubInfo("Waiting",
    files[i].getName(),
    image.getHeight(),
    image.getHeight(),
    300, scaled);
    imageList.add(tubInfo);
    return imageList;
    private BufferedImage getScaledImage(BufferedImage srcImg, int w, int h){
    BufferedImage resizedImg = new BufferedImage(w, h,
    BufferedImage.TYPE_INT_RGB);
    Graphics2D g2 = resizedImg.createGraphics();
    g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
    RenderingHints.VALUE_INTERPOLATION_BICUBIC);
    g2.drawImage(srcImg, 0, 0, w, h, null);
    g2.dispose();
    // JOptionPane.showMessageDialog(null, new ImageIcon(resizedImg));
    return resizedImg;
    protected void done() {
    setProgress(100);
    try {
    //JOptionPane.showMessageDialog(null, imageList.size());
    // List<ImageThubInfo> imageList = this.get();
    imageList = get();
    for(int i=0; i< imageList.size(); i++){
    // JOptionPane.showMessageDialog(null, new ImageIcon(
    // imageList.get(i).getThumbnail()));
    model.addElement(imageList.get(i));
    } catch (InterruptedException ex) {
    // Logger.getLogger(ThumbLoader.class.getName()).log(Level.SEVERE,
    // null, ex);
    System.out.println("InterruptedException: " + ex.getMessage());
    } catch (ExecutionException ex) {
    // Logger.getLogger(ThumbLoader.class.getName()).log(Level.SEVERE,
    // null, ex);
    System.out.println("ExecutionException: " + ex.getMessage());
    // JOptionPane.showMessageDialog(null, "DONE");
    import java.awt.*;
    import java.io.*;
    import java.net.*;
    import javax.swing.*;
    public class Test {
        private JScrollPane getContent() {
            File[] files = getFiles();
            DefaultListModel model = new DefaultListModel();
            JList list = new JList(model);
            list.setCellRenderer(new ImageThubInfoRenderer());
            SwingWorker worker = new ThumbLoader(model, files);
            worker.execute();
            return new JScrollPane(list);
        private File[] getFiles() {
            String prefix = "images/geek/geek";
            String[] ids = { "-c---", "--g--", "---h-", "----t" };
            String ext = ".gif";
            File[] files = new File[ids.length];
            for(int i = 0; i < ids.length; i++) {
                String path = prefix + ids[i] + ext;
                URL url = getClass().getResource(path);
                try {
                    files[i] = new File(url.toURI());
                } catch(URISyntaxException e) {
                    System.out.println("everything is busted!");
            return files;
        public static void main(String[] args) {
            Test test = new Test();
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.add(test.getContent());
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    }geek images from [Geek Images|http://java.sun.com/docs/books/tutorial/uiswing/examples/components/index.html]

  • Where can I get the sample code of gantt chart?

    hi, all
    I want to use gantt chart component.I find this video http://download.oracle.com/otn_hosted_doc/jdeveloper/11/demos/DVT_Gantt_Chart/ADFDVTGanttChartDemo.html.
    where can I get the sample code in this video?
    I have got the demo <strong>dvt-faces-demo.ear</strong>.but in this demo, the code of events process is too simple.I want more detail code of date change, denpendency change and so on.
    this is my mail [email protected]
    Thanks
    Best Regards
    kenshin
    Edited by: Himura Kenshin on 2010-8-20 上午4:57
    Edited by: Himura Kenshin on 2010-8-20 上午9:03

    Hi Katia,
    Essentially the same sample app which was referenced above (http://download.oracle.com/otn_hosted_doc/jdeveloper/11/demos/DVT_Gantt_Chart/ADFDVTGanttChartDemo.html). There are many features implemented in this sample which I'll be "reinventing the wheel" with. Its been a bit since I worked with the gantt component as I had to abandon for other development but will be getting back into it here shortly.
    Namely as I remember, I had difficult time getting the gantt to load quickly with large amount of tasks, difficulty getting the selected item when using context menus or buttons defined within the control, and a few other minor issues which could be fixed as I was using the first release of 11g and cannot remember specifics. I'll let you know as I get back into it if I see similar problems.
    For example, if you go to the ADF Demo Site (http://jdevadf.oracle.com/adf-richclient-demo/faces/feature/index.jspx) and click on "Project Gantt Custom Menu and Toolbar - add menus and buttons on the Project Gantt Menu and Toolbar". The buttons work, however if you first select a row in the left and then click the button, you have to click twice for it to work (in my findings the action listener never "fires"). So in my case I want to select a row and then have a custom event for that selected row when I click the button. There were other similar findings I had when I tried to go off of the examples.
    Hope this helps.
    Thank you,
    Kris

  • Could you help me in understanding what this code means ?

    Hi, I was reading an article about Comparing Objects. Well, here's the link:
    http://www.onjava.com/lpt/a/3286
    The link I found it somewhere in this forum too...it's about sorting an array based on another sorted array...I can't understand what is happening inside this code...Well, I knew it is a method, because it actually a member of a class Person. The problem is that, everytime I delete this part of method in a class which implements Comparable...it always throws an error...is it possible if I don't use this method below ?
    public int compareTo(Object anotherPerson) throws ClassCastException {
        if (!(anotherPerson instanceof Person))
          throw new ClassCastException("A Person object expected.");
        int anotherPersonAge = ((Person) anotherPerson).getAge(); 
        return this.age - anotherPersonAge;   
      }Thank you very much !
    Sincerely,
    Chris

    Thank you, I am new in Java Programming, and my class will start talk about Sorting Array next week, and I know that I am so weak in Sorting things...so, I have to encourage myself, so that I could understand what they will discuss in the class....
    //WHAT IS THE "!" sign before the anotherPerson instanceof Person means ?
    if (!(anotherPerson instanceof Person))
          throw new ClassCastException("A Person object expected.");
    * I know that Person is the class name and anotherPerson is an object of
    * class Person but: ((Person)anotherPerson)...what is that mean ?
    * so the getAge() method refers to anotherPerson's age ?
    * or the Person's age ?
    * Say that I don't want to sort it based on the age, but I want to sort it,
    * for example:
    * by its character's length, do I have to create a method to get the
    * characters length ?
        int anotherPersonAge = ((Person) anotherPerson).getAge(); 
        return this.age - anotherPersonAge;
       }Thank you...
    Chris

  • I want the example code for Calendar() and TimeZone() in java

    Hi,
    I want the example code for the TimeZone() and Calendar() class in java
    because i new to java, i am not able to understand the concepts properly.
    Thanks...

    Hi Paolo Dema.
    What are the exact spefications of your computer?
    Also did you computer come with 10.6 ot 10.5?.
    You may try entering the MPN (marketing part number) Format: M*****/**
    The MPN can be found on the product packaging or the System Profiler.

  • How can I link my daqmx code to another daq assistant to hear my audio output?

    Hi,
    I got a burning question about my school project. I need to use labview and my NI-mydaq to test the difference between
    various samples rates and bit depths.
    I linked an mp3 file to the AUDIO IN of my NI-mydaq and created a way to be able of switching sample rate while running my program.
    Now I would like to link my program inside the NI-mydaq to my AUDIO OUT...
    So...  I generated daqmx code out of an input daq assistant, how can I link my daqmx code to another daq assistant to hear my audio output?

    Hello Fontys_Student...,
    I am not sure I properly understand your question.
    You want to, first, acquire a signal from the AUDIO IN input, second, do some processing on the acquired signal and, third, generate this processed signal at the AUDIO OUT, right? What is the part causing some troubles?
    If you already have the signal acquired and processed, you can simply wire this processed signal to the "data" input of a second DAQ Assistant, right?
    Did you already have a look at the myDAQ User Guide (http://www.ni.com/pdf/manuals/373060e.pdf)? On page 32-35, there is an example showing what you need I suppose. 
    Cédric | NI Belgium

Maybe you are looking for