How to fill bean area with values from database

i have a bean area in form which act as acombobox autocomplete , i want to fill it with dynamic values from database , any help will be appreciated.
http://forms.pjc.bean.over-blog.com/article-16369664.html "this is the example i'm working on"
Best Regards.

An example with the EMP table:
DECLARE
  cursor cur is select empno,ename from emp;
BEGIN
  -- initialise the ComboBox twin values --
  for c in cur loop
   if c.empno is not null then
    Set_Custom_Property('BL.BEAN',1,'ADD_TWIN',c.empno||','||c.ename);
   else
    Set_Custom_Property('BL.BEAN',1,'ADD_TWIN_NULL',c.empno||','||c.ename);
   end if ;
  end loop;
  Set_Custom_Property('BL.BEAN',1,'ADD_TWIN','[END_DATA]');
  Set_Custom_Property('BL.BEAN',1,'SET_ALIGNMENT','right');
END;Francois

Similar Messages

  • How can i get the random values from database?

    Hi,
    i want to get random values from database.
    I try my best find no solution
    plz give solution in either sql query or java method.
    thanks in advance.

    try this:
    Give a numeric row-id to each row of database.
    say (1-100) for 100 rows
    In the program use random function to get random number between 0 and 1. this value u multiply with 100(or total number of rows) and take integer value of it . u then perform sql query to select the a row which matches randomly genarated value with row-id assigned to each row of database
    madhu

  • How to fill a table with data from columns & rows from a txt file

    I am trying to fill say:
    Myname     Myclass     Mycollege
    Mohan     MD     Stanford
    from a txt file into 3 columns of a table. I can easily do it into a textarea component by
    clicking a button:
    try{
    FileReader fr = new FileReader("F:/CreatorProjects1/stan.txt");
    BufferedReader br = new BufferedReader(fr);
    String s1="";
    String s="";
    stantxtarea.setValue(s);
    while((s=br.readLine())!=null) {
    s1 = s1+s;
    s1=s1+"\n";
    stantxtarea.setValue(s1);
    br.close();
    fr.close();
    } catch(Exception e) {
    e.printStackTrace();
    return null;
    All table components seem to need a database. I do not use any database. I run exe files that give output to txt files. How to solve it?
    I appreciate any help in this regard...
    dr.mohan rao

    there may be another way. This is some thing some thing I can recommend. You can create property type of ObjectListDataProvider in session or application based on the scope you required. Create web bean class with property you want to show in the column (say col1, col2, col2). Initialize the list property like similar below
    List dataList = new ArrayList();
    ObjectListDataProvider mytableprops = new ObjectListDataProvider();
    try {
    //start loop read data from your txt file
    //create instance of web bean for each line
    //add web bean instance into dataList
    //end of loop readind data from txt file
    oldpins.setList(dataList );
    oldpins.setObjectType(NotificationProfileBean.class);
    } catch (Exception ee1){;}
    return oldpins;
    Sri Thuraisamy

  • How to display checkbox that retrieve value from database?

    Hi,
    I have a problem, hope someone will help me.
    The problem is, I have 3 checkbox where contain different values.
    I will insert the values to db in array. When I retrieve the values, I got a problem to display it.
    Let say,my checkbox's value is:
    1.car
    2.bus
    3.lorry
    when I checked car and lorry, my array will be [car,bus] insert to db.
    For editing purpose, I need to display the checkbox again with the values from db. So, it should be :
    1.car (checked)
    2.bus (checked)
    3.lorry (unchecked)
    I can display the car and bus (checked) , but not the unchecked checkbox. Sometimes, it's repeating, car (checked) and car (unchecked) will display.
    Anybody have a suggestion?
    My codes:
    String[] list = {"car","bus","lorry"};
    String[] logtype ={"car","bus"}//retrieve from db (example)
    for (int i=0;i<logtype.length;i++){
    if (logtype.equals(list[i]){
    <input type="checkbox" name="type" value="<%=list[i]%>" checked>
    else{
    <input type="checkbox" name="type" value="<%=list[i]%>" >

    hey u can solve this problem by using vector instead of array
    here's the code
    <%
    Vector list=new Vector();
    list.addElement("car");
    list.addElement("bus");
    list.addElement("lorry");
    Vector logtype=new Vector();
    logtype.addElement("car");
    logtype.addElement("bus");
    for(int i=0;i<list.size();i++)
         if(logtype.contains(list.elementAt(i)))
         { %>
              <%=list.elementAt(i)%><input type="checkbox" name="type" value="<%=list.elementAt(i)%>" checked>
         <%}
         else
         {%>
              <%=list.elementAt(i)%><input type="checkbox" name="type" value="<%=list.elementAt(i)%>" >
         <%}
    %>

  • Filling a column with value from other columns

    Hello all!
    Suppose i have the following table:
    TableA(col_one int, col_two int, result int);I want to insert value to col_one and col_two, and result will be filled with the multiplication product of col_one and col_two.
    ok firstly i know this is very redundant way of storing data and generally should not be used, but one case when this might come in handy is when we want to store a total payment amount of product price and quantity. this can be useful since product price can change overtime and we need to record the data as the transaction happens to avoid change in total payment over time (as the price drops or rises).
    now with the problem:
    I tried this in mysql and it works:
    INSERT INTO TableA (col_one, col_two, result) VALUES (30,  20, col_one * col_two);but not in oracle, which output the following error:
    >
    ora 00984 column not allowed here
    any idea on how to do it in oracle?
    thank you very much :)
    ps, thank you for the fast replies on my previous topic.

    If the insert is done inside PL/SQL you can return the primary key for the row (assuming the table has a primary key?!?) and then update based on that key, but this still introduces two statements where a single statement can suffice.
    Why are you thinking so complicated? ;-)
    If it is done in PL/SQL the you can do this:
    create procedure addRow(p_value1 number,p_value2 number) is
    p_result number;
    begin
    p_result:=p_value1*p_value2;
    insert into table1 (col_one,col_two,result) values(p_value1,p_value2,p_result);
    commit;
    end;If you want to do this automatically when someone inserts a row (without providing the result) you have to use an insert trigger.
    Dim

  • How to update this table with values from another table ?

    Hi
    I have a table "regies". I want to replace the values of the column "regies.agent" by the value of the column "regies_personnes.id"
    As you see the tables have a common values column. ie regies.agent = regies_personnes.nom
    Table "regies" :
    Insert into "regies" (AGENT) values ('Humberdot Alain');
    Insert into "regies" (AGENT) values ('Danard Patrick');
    Table "regies_personnes" :
    Insert into REGIES_PERSONNES (NOM,ID) values ('Humberdot Alain',1);
    Insert into REGIES_PERSONNES (NOM,ID) values ('Danard Patrick',2);
    Before we have this
    sql>select agent from regies ;
    Humberdot Alain
    Danard Patrick
    After the update, the result should be
    sql>select agent from regies ;
    1
    2
    Thank you for your kind answer.

    You will face error if you have duplicates
    ORA-01427 Single row subquery returns Multiple rows.Try this way
    create table regies(agent varchar2(30));
    create table regies_personnes( nom varchar2(30),id number);
    Insert into regies (AGENT) values ('Humberdot Alain');
    Insert into regies (AGENT) values ('Danard Patrick');
    Insert into REGIES_PERSONNES (NOM,ID) values ('Humberdot Alain',1);
    Insert into REGIES_PERSONNES (NOM,ID) values ('Danard Patrick',2);
    Insert into regies (AGENT) values ('Humberdot Alain');
    Insert into regies (AGENT) values ('Danard Patrick');
    Insert into REGIES_PERSONNES (NOM,ID) values ('Humberdot Alain',1);
    Insert into REGIES_PERSONNES (NOM,ID) values ('Danard Patrick',2);
    commit;
    update regies r set agent = (select id from regies_personnes p where r.agent = p.nom
    and rownum=1)
      where exists (select id from regies_personnes p where r.agent = p.nom
    commit

  • Dynamically fill area with words from list

    hello all,
    i would like to fill the entire area of a flash movie with
    words.
    the movie starts out blank, but as time goes on the visible
    area fills with words from a pre-written list.
    ideally, the height and width of the words is randomized
    within a range i determine.
    i wouldn't mind being pointed to a tutorial that shows how to
    fill an area with randomly-sized rectangles, that might help.
    eventually, i want to be able to control the speed of the
    area being filled with an input device (mouse or external sensor)
    but first things first!
    am using flash 8.
    thank you,
    aya.

    You may want to check this out. It fills a space with words
    and keeps filling the empty space. I'ts open source so you can take
    peak inside.
    http://www.levitated.net/daily/levEmotionFractal.html

  • Create xml file with values from context

    Hi experts!
    I am trying to implement a WD application that will have some input fields, the value of those input fields will be used to create an xml file with a certain format and then sent to a certain application.
    Apart from this i want to read an xml file back from the application and then fill some other context nodes with values from the xml file.
    Is there any standard used code to do this??
    If not how can i do this???
    Thanx in advance!!!
    P.S. Points will be rewarded to all usefull answers.
    Edited by: Armin Reichert on Jun 30, 2008 6:12 PM
    Please stop this P.S. nonsense!

    Hi,
    you need to create three util class for that:-
    XMLHandler
    XMLParser
    XMLBuilder
    for example in my XML two tag item will be there e.g. Title and Organizer,and from ur WebDynpro view you need to pass value for the XML tag.
    And u need to call buildXML()function of builder class to generate XML, in that i have passed bean object to get the values of tags. you need to set the value in bean from the view ui context.
    Code for XMLBuilder:-
    Created on Apr 4, 2006
    Author-Anish
    This class is to created for having function for to build XML
    and to get EncodedXML
      and to get formated date
    package com.idb.events.util;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import com.idb.events.Event;
    public class XMLBuilder {
    This attribute represents the XML version
         private static final double VERSION_NUMBER = 1.0;
    This attribute represents the encoding
         private static final String ENCODING_TYPE = "UTF-16";
         /*Begin of Function to buildXML
    return: String
    input: Event
         public String buildXML(Event event) {
              StringBuffer xmlBuilder = new StringBuffer("<?xml version=\"");
              xmlBuilder.append(VERSION_NUMBER);
              xmlBuilder.append("\" encoding=\"");
              xmlBuilder.append(ENCODING_TYPE);
              xmlBuilder.append("\" ?>");
              xmlBuilder.append("<event>");
              xmlBuilder.append(getEncodedXML(event.getTitle(), "title"));
              xmlBuilder.append(getEncodedXML(event.getOrganizer(), "organizer"));
              xmlBuilder.append("</event>");
              return xmlBuilder.toString();
         /End of Function to buildXML/
         /*Begin of Function to get EncodedXML
    return: String
    input: String,String
         public String getEncodedXML(String xmlString, String tag) {
              StringBuffer begin = new StringBuffer("");
              if ((tag != null) || (!tag.equalsIgnoreCase("null"))) {
                   begin.append("<").append(tag).append(">");
                   begin.append("<![CDATA[");
                   begin.append(xmlString).append("]]>").append("</").append(
                        tag).append(
                        ">");
              return begin.toString();
         /End of Function to get EncodedXML/
         /*Begin of Function to get formated date
    return: String
    input: Date
         private final String formatDate(Date inputDateStr) {
              String date;
              try {
                   SimpleDateFormat simpleDateFormat =
                        new SimpleDateFormat("yyyy-MM-dd");
                   date = simpleDateFormat.format(inputDateStr);
              } catch (Exception e) {
                   return "";
              return date;
         /End of Function to get formated date/
    Code for XMLParser:-
    Created on Apr 12, 2006
    Author-Anish
    This is a parser class
    package com.idb.events.util;
    import java.io.ByteArrayInputStream;
    import java.io.IOException;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.XMLReader;
    import com.idb.events.Event;
    import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
    public class XMLParser {
    Enables namespace functionality in parser
         private final boolean isNameSpaceAware = true;
    Enables validation in parser
         private final boolean isValidating = true;
    The SAX parser used to parse the xml
         private SAXParser parser;
    The XML reader used by the SAX parser
         private XMLReader reader;
    This method creates the parser to parse the user details xml.
         private void createParser()
              throws SAXException, ParserConfigurationException {
              // Create a JAXP SAXParserFactory and configure it
              SAXParserFactory saxFactory = SAXParserFactory.newInstance();
              saxFactory.setNamespaceAware(isNameSpaceAware);
              saxFactory.setValidating(isValidating);
              // Create a JAXP SAXParser
              parser = saxFactory.newSAXParser();
              // Get the encapsulated SAX XMLReader
              reader = parser.getXMLReader();
              // Set the ErrorHandler
    This method is used to collect the user details.
         public Event getEvent(
              String newsXML,
              XMLHandler xmlHandler,
              IWDMessageManager mgr)
              throws SAXException, ParserConfigurationException, IOException {
              //create the parser, if not already done
              if (parser == null) {
                   this.createParser();
              //set the parser handler to extract the
              reader.setErrorHandler(xmlHandler);
              reader.setContentHandler(xmlHandler);
              InputSource source =
                   new InputSource(new ByteArrayInputStream(newsXML.getBytes()));
              reader.parse(source);
              //return the results of the parse           
              return xmlHandler.getEvent(mgr);
    Code for XMLHandler:-
    Created on Apr 12, 2006
    Author-Anish
    This is a parser class
    package com.idb.events.util;
    import java.io.ByteArrayInputStream;
    import java.io.IOException;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.XMLReader;
    import com.idb.events.Event;
    Created on Apr 12, 2006
    Author-Anish
    *This handler class is created to have constant value for variables and function for get events,
        character values for bean variable,
        parsing thr date ......etc
    package com.idb.events.util;
    import java.sql.Timestamp;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.Locale;
    import org.xml.sax.Attributes;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import org.xml.sax.helpers.DefaultHandler;
    import java.util.*;
    import com.idb.events.Event;
    import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
    public class XMLHandler extends DefaultHandler {
         private static final String TITLE = "title";
         private static final String ORGANIZER = "organizer";
         IWDMessageManager manager;
         private Event events;
         private String tagName;
         public void setManager(IWDMessageManager mgr) {
              manager = mgr;
    This function is created to get events
         public Event getEvent(IWDMessageManager mgr) {
              manager = mgr;
              return this.events;
    This function is created to get character for setting values through event's bean setter method
         public void characters(char[] charArray, int startVal, int length)
              throws SAXException {
              String tagValue = new String(charArray, startVal, length);
              if (TITLE.equals(this.tagName)) {
                   this.events.setTitle(tagValue);
              if (ORGANIZER.equals(this.tagName)) {
                   String orgName = tagValue;
                   try {
                        orgName = getOrgName(orgName);
                   } catch (Exception ex) {
                   this.events.setOrganizer(orgName);
    This function is created to parse boolean.
         private final boolean parseBoolean(String inputBooleanStr) {
              boolean b;
              if (inputBooleanStr.equals("true")) {
                   b = true;
              } else {
                   b = false;
              return b;
    This function is used to call the super constructor.
         public void endElement(String uri, String localName, String qName)
              throws SAXException {
              super.endElement(uri, localName, qName);
         /* (non-Javadoc)
    @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
    This function is used to call the super constructor.
         public void fatalError(SAXParseException e) throws SAXException {
              super.fatalError(e);
    This function is created to set the elements base on the tag name.
         public void startElement(
              String uri,
              String localName,
              String qName,
              Attributes attributes)
              throws SAXException {
              this.tagName = localName;
              if (ROOT.equals(tagName)) {
                   this.events = new Event();
         public static void main(String a[]) {
              String cntry = "Nigeria";
              XMLHandler xml = new XMLHandler();
              ArrayList engList = new ArrayList();
              engList = xml.getCountries();
              ArrayList arList = xml.getArabicCountries();
              int engIndex = engList.indexOf(cntry);
              System.out.println("engIndex  :: " + engIndex);
              String arCntryName = (String) arList.get(engIndex);
              System.out.println(
                   ">>>>>>>>>>>>>>>>>>>>" + xml.getArabicCountryName(cntry));
    Hope that may help you.
    If need any help , you are most welcome.
    Regards,
    Deepak

  • How Can I get multi column values from dynamic search help?

    Hi Gurus;
    I'm using dynamic search help in my program.
    I want to get multi column values from search help. But I dont know solution for this issue.
    I'm using F4IF_INT_TABLE_VALUE_REQUEST FM.
    How Can I get multi column values from dynamic search help?
    Thanks.

    Believe it or not, the same FM worked for me in a dynpro. I will try to explain here how it works in custom screen and then you can do your work for other screens or program types. I am not going to write my actual work but will explain in general.
    I have 4 fields (FLD1, FLD2, FLD3, FLD4) and i made the search based on FLD2 and when user click on a line (could be any field), then this would bring the line on to the screens.
    There are like 3 steps.
    You have your value_tab for my fields FLD1, FLD2, FLD3 and FLD4. This is just the data that we pass into the FM. (data: IT_VALTAB type table of ZVAL_TABLE)
    Next map the screen fields into an internal table (data: It_dynpfld type table of dselc ). I also have other internal tables defined  (just to keep it straight, i will be putting here) data:  It_return type standard table of ddshretval.
    Next step is to call the function module. Make sure you have values in IT_VALTAB.
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
            retfield        = 'FLD2'
            value_org       = 'S'
          tables
            value_tab       = It_VALTAB
            return_tab      = It_return
            dynpfld_mapping = It_dynpfld
          exceptions
            parameter_error = 1
            no_values_found = 2
            others          = 3.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
          with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        else.
          perform get_selected_fields tables It_return.
        endif.
    The code within the perform GET_SELECTED_FIELDS  - We need to map the result fields after user selects it. The code goes like this. This is step is to update the dynpro fields.
    I need a internal table as well as a work area here. like,
    data: lt_fields type table of dynpread,
            la_fields type dynpread.
      field-symbols: <fs_return> type ddshretval.
    so fill out LT_FIELDS from the IT_RETURN table
    loop at lt_return assigning <fs_return>.
        la_fields-fieldname = <fs_return>-retfield.
        la_fields-fieldvalue = <fs_return>-fieldval.
        append la_fields to lt_fields.
        clear: la_fields.
      endloop.
    Call the FM to update the dynpro
    call function 'DYNP_VALUES_UPDATE'
        exporting
          dyname               = sy-repid
          dynumb               = '1002' "This is my screen number. You could use 1000 for selection screen (hope so)
        tables
          dynpfields           = lt_fields
        exceptions
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          undefind_error       = 7
          others               = 8.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    good luck

  • How to popup values from database tables to SelectOneMenu

    Hi friends,
    I am doing a jsf application, in which there is a selectOneMenu
    control and I want that, iwhen this page is loaded after clicking button
    on the previous page, the selectOne Menu should be populated with
    the values from database.
    Also I want , if i will select any menu item from the menu , acccordingly
    another selectOneMenu control should be filled with respective values
    thanx,
    bye

    Oh dear. I don't think anybody can advise you until you are not "kinda" new to Java anymore. Learn Java itself (the language, the platform and the tools), only then should you start considering going into web development.

  • Set value in af:query with value from method

    hello all
    i have problem, when they want set value in af:query (inputText) with value from method, how to do that?
    anyone help..?
    thx
    agungdmt

    Hi,
    are you facing this issue when you try to show few values on right side (selected list) of shuttle component.
    what is your usecase exactly ?

  • Error while populating drop down list with values from a database

    Hi all,
    I have a JSP page with a drop down list that is to be populated with values from a database.
    This is the code in my JSP file:
         <!-- Form for picking the floor -->
             <!-- Get the available floors -->
             <% ArrayList<Integer> floornumbers = dataManager.getAllFloorNumbers();
                Iterator<Integer> iterator = floornumbers.iterator(); %>
             <!-- Create the form for users to select the floor -->
             <form id="floorselectionform">
                  <input type="hidden" name="action" value="floorselected"/> <!-- Guides the servlet to redirect to the appropriate page -->
                  Select floor | <select name="floorselector" id="floorselector">
                       <% while (iterator.hasNext()) { %>
                       <option value="<%=iterator.next().intValue()%>"> <%=iterator.next().intValue()%> </option>
                       <% } %>
                  </select>
                  <input type="submit" value="Go!"/>
             </form>   The DataManager.java class simply forwards this to its respective Peer class, which has the code shown below:
          package seatplanner.model;
        import java.sql.Connection;
        import java.sql.ResultSet;
        import java.sql.SQLException;
        import java.sql.Statement;
        import java.util.ArrayList;
        /* This class handles all floor operations */
         public class FloorPeer
         /* This method returns all the floor numbers */
         public static ArrayList<Integer> getAllFloorNumbers(DataManager dataManager) {
            ArrayList<Integer> floornumbers = new ArrayList<Integer>();
            Connection connection = dataManager.getConnection();
            if (connection != null) {
              try {
                Statement s = connection.createStatement();
                String sql = "select ID from floor order by ID asc";
                try {
                  ResultSet rs = s.executeQuery(sql);
                  try {
                    while (rs.next()) {
                      floornumbers.add(rs.getInt(1));
                  finally { rs.close(); }
                finally {s.close(); }
              catch (SQLException e) {
                System.out.println("Could not get floor numbers: " + e.getMessage());
              finally {
                dataManager.putConnection(connection);
            return floornumbers;
         }  The classes compile properly, but when I load this page up in Tomcat it just freezes and does not load the form. I tested the DB connection and it works fine.
    What am I doing wrong in the JSP code?
    Thanks for the help in advance.
    UPDATE: I commented out the form, and added <%=floornumbers.size()%> right above the commented code to check if the ArrayList is indeed getting populated with the values from the database (the values are of type integer in the database). The page still freezes like before. I'm puzzled now :confused: .

    Wrong usage of Iterator.
    <!-- Form for picking the floor -->
             <!-- Get the available floors -->
             <% ArrayList<Integer> floornumbers = dataManager.getAllFloorNumbers();
                Iterator<Integer> iterator = floornumbers.iterator(); %>
             <!-- Create the form for users to select the floor -->
             <form id="floorselectionform">
                  <input type="hidden" name="action" value="floorselected"/> <!-- Guides the servlet to redirect to the appropriate page -->
                  Select floor | <select name="floorselector" id="floorselector">
                       <% while (iterator.hasNext()) {
                                    Integer inte = iterator.next();
                            %>
                       <option value="<%=inte.intValue()%>"><%=inte.intValue()%></option>
                       <% } %>
                  </select>
                  <input type="submit" value="Go!"/>
             </form>or make use of enhanced loop as you are already using J2SE 5.0+ for avoiding confusions.
    <!-- Form for picking the floor -->
             <!-- Get the available floors -->
             <% ArrayList<Integer> floornumbers = dataManager.getAllFloorNumbers(); %>
             <!-- Create the form for users to select the floor -->
             <form id="floorselectionform">
                  <input type="hidden" name="action" value="floorselected"/> <!-- Guides the servlet to redirect to the appropriate page -->
                  Select floor | <select name="floorselector" id="floorselector">
                       <% for(Integer inte:floornumbers) {%>
                       <option value="<%=inte.intValue()%>"><%=inte.intValue()%></option>
                       <%}%>
                  </select>
                  <input type="submit" value="Go!"/>
             </form>and a lot better thing would be making usage of basic Taglib provided with JSTL spec or struts spec which make life easier and simple.
    something like usage of <c:forEach/> or <logic:iterate/> would be lot better without writing a single scriptlet code.
    Hope that might help :)
    REGARDS,
    RaHuL

  • How to create a interface with NTR from SAP XI?

    How to create a interface with NTR from SAP XI?

    Hi,
        What do you mean by NTR ?...
    What are the details you needed...Please be clear and more elaborative as far as possible..so that you will get straight forward answers...
    HTH
    Rajesh

  • Fill JComboBox with Vector from database

    Hi there,
    I have a problem with filling a JComboBox with data from a database. I can print the data in the console, but it seems to be impossible to do it in a ComboBox ...
    I tried this:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    *package client;*
    *import data.Raum;*
    *import data.RaumImpl;*
    *import java.net.MalformedURLException;*
    *import java.rmi.Naming;*
    *import java.rmi.NotBoundException;*
    *import java.rmi.RemoteException;*
    *import java.sql.SQLException;*
    *import javax.swing.JComboBox;*
    *import javax.swing.JFrame;*
    *import java.util.Vector;*
    *import verwaltung.*;
    import server.DraServer;
    * @author philipp
    public class ComboBox extends JFrame
        ComboBox(String title) throws RemoteException, SQLException, NullPointerException, MalformedURLException, NotBoundException {
        super(title);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        DraVerwaltung verwaltung = (DraVerwaltung) Naming.lookup ("rmi://localhost/DRA");
        System.out.println("Remote object created...");
        Vector raeume = verwaltung.RaumAusleser();
        Raum r;
        for (int i = 0; i < raeume.size(); i++)
            r = (Raum)raeume.elementAt(i);
    //      System.out.println ("Raum: " + r.getRaumname());
    //      System.out.println ("Raumid: " + r.getIdRaum());
         JComboBox jcb = new JComboBox(r.getRaumname());
        getContentPane().add(jcb);
        setSize(200, 50);
        setVisible(true);      
      public static void main(String[] args) throws RemoteException, SQLException, NullPointerException, MalformedURLException, NotBoundException {
        new ComboBox("Test");
    }In this case I get the following for JComboBox (line 44):
    "cannot find symbol
    symbol: constructor JComboBox(java.lang.string)
    location: class javax.swing.JComboBox"
    I tried:
    -> change "JComboBox jcb = new JComboBox(r.getRaumname());" to "JComboBox jcb = new JComboBox(raeume);"
    then I got the JComboBox, but with ... I don't know how to describe the content. It seems like a (very long) reference.
    All other tries can't be tested, because I got the problem with constructor again.
    I'm happy for an early response.
    Regards

    Now, it works!
    It looks like that:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package client;
    import data.Raum;
    import data.RaumImpl;
    import java.net.MalformedURLException;
    import java.rmi.Naming;
    import java.rmi.NotBoundException;
    import java.rmi.RemoteException;
    import java.sql.SQLException;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import java.util.Vector;
    import verwaltung.*;
    import server.DraServer;
    * @author philipp
    public class ComboBox extends JFrame
        ComboBox(String title) throws RemoteException, SQLException, NullPointerException, MalformedURLException, NotBoundException {
        super(title);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        DraVerwaltung verwaltung = (DraVerwaltung) Naming.lookup ("rmi://localhost/DRA");
        System.out.println("Remote object created...");
        Vector raeume = verwaltung.RaumAusleser();
        Raum r = new RaumImpl();
        Vector vJcb = new Vector();
        for (int i = 0; i < raeume.size();i++){
            r = (Raum)raeume.elementAt(i); 
            vJcb.add(r.getRaumname());
        JComboBox jcb = new JComboBox(vJcb);
        getContentPane().add(jcb);
        setSize(200, 50);
        setVisible(true);     
        public static void main(String[] args) throws RemoteException, SQLException, NullPointerException, MalformedURLException, NotBoundException {
           new ComboBox("Combo box Demo1");
    }Thanks in advantage to all!

  • I HOW I FILL PDF FORM WITH HEBROW ON CHROME ?

    I HOW I FILL PDF FORM WITH HEBROW ON CHROME ?

    Chrome uses its own (incompatible) PDF viewer.
    Download the PDF to your local disk, then fill it from there with Adobe Reader.  Or use a browser that uses the Adobe PDF plugin.

Maybe you are looking for