HTML select tag on irpt page - update database from options

Hi all,
I have an irpt page with two selects.  It is the traditional move stuff from one select to the other, then set the order of the options in the configured select.  (Admin page to specify an ordered list of items)
After the user gets the list how they want it, I would like to send the options to an MII transaction (iCommand?) to update the database table that backs this admin data.
I can do a comma delimited string to hold the select tag's option values, but would like to know if there is a more elegant way!
Ideas?
Thanks,
--Amy Smith
--Haworth

It sounds elegant already - a pretty simple javascript loop to build your csv and Param.1 to your iCommand applet query should work like a charm.
If you need to run it to a TRX, then the StringListToXML action makes turning your csv into linkable properties a simple effort.

Similar Messages

  • Html:select tag

    Hi all,
    In my jsp page i am using struts html:select tag,some contents are not fitting in the alloted size so i want to give horizontal scrolling for this select box,pls any body can tell me which property of select tag can be used,or any html tricks by which i can achive horizontal scrolling.examples will be help full.
    thanks,

    There aren't any tricks. This has nothing to do with Struts or JSP. It only has to to with HTML. The width is controlled by the size of the options or the size of the HTML area it has to display in. The latter if it's restricted otherwise by some table cell's width. I don't believe that I've ever seen a select box which has horizontol scrolling in any browser ever.

  • Use of titleKey attribute in html:select tag

    Hi,
    There is one "titleKey" attribute to create mouse over pop-up texts taking key values from property files in case of i18n. It works for every struts specific tag like <html:text titleKey="help.rmc.name"/> or <html:checkbox titleKey="help.rmc.name"/> except for <html:select> tag which is used for creating combo box or list box. But this tag contains the titleKey attribute.
    Please give me some suggestions how to implement this mouse over pop-up texts in case of <html:select> tag

    Hi,
    There is one "titleKey" attribute to create mouse over pop-up texts taking key values from property files in case of i18n. It works for every struts specific tag like <html:text titleKey="help.rmc.name"/> or <html:checkbox titleKey="help.rmc.name"/> except for <html:select> tag which is used for creating combo box or list box. But this tag contains the titleKey attribute.
    Please give me some suggestions how to implement this mouse over pop-up texts in case of <html:select> tag

  • Update database from Jtable

    Hi all,
    I am trying to update database from Jtable. I added Jtable to scrollpane .
    My question is..
    after updating the Jtable..I want to save the details to database..when I click save button on my screen...how to do that? Please help me out! Thanks in advance..
    Here is the code that I wrote...
    public class VasuTest extends JFrame {
    private boolean DEBUG = true;
    Vector column_list = new Vector();
    Vector rows = new Vector();
    public VasuTest() {
    super("VasuTest");
         JToolBar toolBar = new JToolBar();
    JButton button = null;
    button = new JButton("Send Email");
    button.setToolTipText("This is the Exit button");
    button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
         System.out.println("Send Email");
    toolBar.add(button);
    button = new JButton("Save");
    button.setToolTipText("This is the Save button");
    button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
         System.out.println("Save");
    toolBar.add(button);
    button = new JButton("Exit");
    button.setToolTipText("This is the Exit button");
    button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
         System.exit(0);
    toolBar.add(button);
         JPanel ContentPane = new JPanel();
    ImageIcon i1 = new ImageIcon("Dongle.gif");
    JLabel j1 = new JLabel( i1, JLabel.CENTER);
         ContentPane.add(j1,BorderLayout.CENTER);
         setContentPane(ContentPane);
         JDBCT myModel = new JDBCT();
    String q = "select a.email_no,a.email_ln_no,b.cust_no,null customer_name,null cdate,a.batch_no,b.purch_ord_no,a.user_part_no,null part_desc,a.user_upgraded_part_no,null prod_id,a.qty,a.price,a.encrypted_sum_id,a.decrypted_sum_id,a.approval_key,a.status_cd,decode(a.status_cd,'APPROVED','true','ERROR','false','PROCESSED','true') approved,null end_cust,null sales_ord,null so_line,null sales_ord_cust,null shipment ,null sales_end_cust_name ,null shipment_line,a.note,null fromcust from upgrade_req_key_s3 a,upgrade_req_s3 b where a.email_no = b.email_no order by a.email_no,a.email_ln_no";
    myModel.setQuery();
    final Font f = new Font("SansSerif", Font.BOLD, 10);
    JTable table = new JTable(myModel);
    table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    // Container ContentPane = getContentPane();
         int v = ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS;
         int h = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS;
         JScrollPane scrollPane = new JScrollPane(table,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
         scrollPane.setPreferredSize ( new Dimension ( 770, 400 ) );
    ContentPane.add(toolBar,BorderLayout.CENTER);
    //Add the scroll pane to this window.
    ContentPane.add(scrollPane,BorderLayout.CENTER);
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    public class JDBCT extends AbstractTableModel {
    Vector cache; // will hold String[] objects...
    int colCount;
    int rowHeight;
    String [] headers;
    Connection db;
    Connection conn;
    Statement statement;
    String currentURL;
    // public QueryTableModel() {
    // cache = new Vector();
    // new oracle.jdbc.driver.OracleDriver();
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    catch (ClassNotFoundException e) {
    System.out.println(e.getMessage());
    System.exit(-1);
    String url = "jdbc:odbc:c3-erp,s3,s3";
    public String getColumnName(int i) {
         if (i == 0)      {  return      "Email No"                     ;     } else
    if (i == 1)      {  return      "Email Line No.";} else
         if (i == 2)      {  return      "Customer";} else
         if (i == 3)      {  return      "Customer Name";} else
         if (i == 4)      {  return      "Date";} else
         if (i == 5)      {  return      "Batch No";} else
         if (i == 6)      {  return      "Customer PO";} else
         if (i == 7)      {  return      "Upgrade From Part";} else
         if (i == 8)      {  return      "Part Description";} else
         if (i == 9)      {  return      "Upgrade To Part";} else
         if (i == 10)      {  return      "Product Id";} else
         if (i == 11)      {  return      "Quantity";} else
         if (i == 12)      {  return      "Price";} else
         if (i == 13)      {  return      "Encypted Sum ID";} else
         if (i == 14)      {  return      "Decrypted Serial No";} else
         if (i == 15)      {  return      "Key";} else
         if (i == 16)      {  return      "Status";} else
         if (i == 17)      {  return      "Approved";} else
         if (i == 18)      {  return      "End Customer";} else
         if (i == 19)      {  return      "Sales Order";} else
         if (i == 20)      {  return      "SO Line";} else
         if (i == 21)      {  return      "Sales Order End Customer";} else
         if (i == 22)      {  return      "Sales Order End Customer Name";} else
         if (i == 23)      {  return      "Shipment";} else
         if (i == 24)      {  return      "Shipment Line";} else
         if (i == 25)      {  return      "Errors";} else
         if (i == 26)      { return       "From"; }
         else {return headers[i-1] ;}
    public int getColumnCount() { return colCount; }
    public int getRowCount() { return cache.size(); }
    //public Class getColumnClass(int c) {
    // return getValueAt(0, c).getClass();
    // overloaded isCellEditable method so that it returns true
    // in reference to a cell being editable.
    public boolean isCellEditable(int row, int col) { return true; }
    // overloaded setValyeAt which updates the data Vector and
    // calls the fireTableRowsUpdated() to notify any listeners
    // that data has changed and they need to redraw.
    public void setValueAt(Object value, int row, int col) {
    ((String[])cache.elementAt(row))[col] = (String)value;     
         fireTableRowsUpdated(row,row);     
    public void getInfo () {
    System.out.println("Row Count is : " + cache.size());
         System.out.println("Value at 0,0 is : " + getValueAt(0,0));
    //     boolean res = isCellEditable(0,0);
    //     System.out.println("The value of the Boolean result is : " + res);
    public Object getValueAt(int row, int col) {
    return ((String[])cache.elementAt(row))[col];
    // All the real work happens here!
    // In a real application, we'd probably perform the query in a separate thread.
    public void setQuery() {
    cache = new Vector();
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    conn = DriverManager.getConnection ("jdbc:odbc:c3-erp","s3","s3");
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("select a.email_no,a.email_ln_no,b.cust_no,null customer_name,null cdate,a.batch_no,b.purch_ord_no,a.user_part_no,null part_desc,a.user_upgraded_part_no,null prod_id,a.qty,a.price,a.encrypted_sum_id,a.decrypted_sum_id,a.approval_key,a.status_cd,decode(a.status_cd,'APPROVED','true','ERROR','false','PROCESSED','true') approved,null end_cust,null sales_ord,null so_line,null sales_ord_cust,null shipment ,null sales_end_cust_name ,null shipment_line,a.note,null fromcust from upgrade_req_key_s3 a,upgrade_req_s3 b where a.email_no = b.email_no order by a.email_no,a.email_ln_no");
    ResultSetMetaData meta = rs.getMetaData();
    colCount = meta.getColumnCount();
    String[] record = new String[27];      
    // Now we must rebuild the headers array with the new column name
    headers = new String[27];
    for (int h=0; h < 27; h++) {
    // headers[h-1] = meta.getColumnName(h);
         headers[h] = getColumnName(h);
    // and file the cache with the record from our query. This would
    // be practical if we were expecting a few million records to our
    // response query, but we are not so we can do this.
    while(rs.next()) {
         for (int i=0; i < colCount; i++) {
         record[i] = rs.getString(i + 1);
         cache.addElement(record);
         // Get the FIRST column of the table tableView
    // TableColumn column0 = table.getColumn(cache.elementAt(0));
    // Set the cell editor as non editable.
    // column0.setCellEditor(new EditableCellEditor(new JComboBox(), true));
    fireTableChanged(null); // notify everyone the we had a new table.
    catch (Exception e) {
    cache = new Vector(); // blank it out and keep going.
         e.printStackTrace();
    public static void main(String[] args) {
    VasuTest frame = new VasuTest();
    frame.pack();
    frame.setVisible(true);
    }

    When you click on the save button, you need to go through the model and retrieve the values getValueAt().
    Convert to whatever type you want since getValueAt() returns type Object and update the DB.

  • Struts html:select tag

    Hi All,
    I am using struts. I want a dropdown single select menu option on my Jsp page.
    Basically, the options would be a dropdown either US or CA (meaning USA or CANADA). Html selectoptions is easy. How to do it in struts ?
    Once page is displayed, US will be selected by default. Then user may select either of the value from dropdown.
    Then, I have a state option dropdown, which should get populated, depending upon the first selection. Meaning, if user selects US in first dropdown, then all USA states show up in this second single select options.
    If user selects CA in first dropdown, then CANADA states show up in this second dropdown. I have the states list with me for both US and Canada.
    Can anyone send me a snippet of code for first dropdown. and then how in struts can I populate the second single select states dropdown (depending on whether user selected US or CA in first dropdown)
    Any help highly appreciated.
    thanks,
    pp

    Thanks Shanu.
    Nope. I am populating states in both cases in the ActionForm constructor. in other words, they are not coming from database. Folowing is short snippet how I am populating. So, I am able to display those states on the Jsp page dropdown.
    Onlything, i am stuck at is "that determination switch" as I quoted in previous post like
    If (US) then showUsStates else show CanadaStates on the Jsp thinggy ......... I am stuck here.
    And it has to happen on client side, cause if I sybmit the form, its gonna complain about other mandatory textfields like city , zip , phone NOT found as a result of Submit to ActionForm validation -- Even when user has yet to input rest of values and submit the entire form. Thats the reason why I say "On selection of country dropdown, population of appropriate states has to happen on client side"
    Any idea ?
      public CreateServiceRequestForm() {
             countrybean = new CountryBean[2];
             for (int i = 0; i < 2; i++) {
                 countrybean[i] = new CountryBean();
                 countrybean.setCountry(i);
    countrybean[0].setCountryName("US");
    countrybean[1].setCountryName("CA");
    statebean = new StateBean[54];
    for (int i = 0; i < 54; i++) {
    statebean[i] = new StateBean();
    statebean[i].setStateId(i);
    statebean[0].setName("AK");
    statebean[1].setName("AL");
    statebean[2].setName("AR");
    statebean[3].setName("AZ");
    statebean[4].setName("CA");                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Html select tag issue.

    Hi All,
    I created a new project using EB3 to develop a photoshop extension. In that panel, I added the drop down box as follows,
    <body onLoad="onLoaded()">
         <select>
                <option value="">1</option>
                <option value="">2</option>
                <option value="">3</option>
                <option value="">4</option>
         </select>
    </body>
    I am seeing an issue, following are the steps to reproduce it,
    - Open the panel.
    - Click on the drop down. (Drop down opens)
    - Now loose the focus from the panel by clicking outside the panel.
    - Now click on the drop down. (Here comes the issue)
    Drop down doesn't open but it comes into the focus and when I clicked second time it will open.
    So every time when focus loosed the panel and I clicked on the drop down nothing happens on first time.
    And the strange thing is that I am seeing this issue on windows only.
    Anyone have any idea why it behave like this or is it a select tag bug in html panel?
    Thanks for any help..

    Yep, I second that. Combos take two clicks to be activated. Seems like yet another bug from a long, long list of issues with this CEP.

  • Using taglibs to generate html select tag

    Hello,
    I'm using taglibs to generate html select statements like this:
    <input:select ... options="<%= optionsMap %> </input:select>
    However I would like each option element to be assigned a
    "onclick" attribute. Is that possible?
    Thanks!

    >
    <input:select ... options="<%= optionsMap %> </input:select>
    Probably u meant ...
    <html:select ..>
    <html:option value="all">All</html:option>
    </html:select>
    You cannot add an onclick event on the "option" element. Its an incorrect tag.
    However you may add an onClick or rather onChange event of html:select
    Cheers
    -Rohit

  • How to use HTML 'pre' tag in ADF pages

    Hi,
    I am using adf 11.1.1.6.0 and trying to print some formatted text from log files. It can contain either xml / log file with new lines / tabs.
    When I use hte UIX / Regular jsp, I am able to use the <pre> tag and retain the output format form end user.
    When I am migrated the same application to ADF, I am not able to get the desired output format.
    Here are my trials:
    <af:outputYext> with escape="true" : Entire output is displayed in a single paragraph. All new line/formatting has gone.
    <af:outputYext> with escape="false" : Page itself is not painting as the logout put has some special characters.
    <af:richTextEditor> readonly = true : Taking out all xml tags with in the output log
    I tried with f:verbatim as shown
    <f:verbatim><pre> </f:verbatim>
    #{dojStep.displayStepOutput}
    <f:verbatim></pre></f:verbatim>
    In this case, I get the following error: "End tag does not match start tag 'pre'."
    Can you please suggest the alternative to use the html pre tag in ADF world to print the el expression data as it is.
    Thanks,
    -Jaya.

    Hi,
    have a outputText.. with escape="false"
    and in #{dojStep.displayStepOutput} have it like this
      public String displayStepOutput(){
    StringBuilder sb = new StringBuilder();
    sb.append("<pre>");
    sb.append("your text");
    sb.append("</pre>");
    return sb.toString();
    }example-
    <af:outputText value="#{dojStep.displayStepOutput}"/>

  • How to make  struts html:select tag readOnly....!!!!

    Hi All,
    In my below code I want to make <html:select> as readonly like I did for <html:text>
    I don't want to make it disabled as it is graying out that field.
    My requirement is that it should be visible and also it shouldn't be editable.
    I am using Struts...!!!
    <html:text property="paramName" size="20" maxlength="50" readonly="true"/>                                
    <html:select property="paramTypeId" disabled="true"> // I dont want to use this--- disabled="true"
         <html:options collection="queryReturnType" property="value" labelProperty="label"/>
    </html:select>Thanks in advance....!!

    Can some one tell me in the below code
    *1. what is test="${controlEnabled}"....wha is this controlEnabled variable*
    *2. do I need to create an attribute for paramTypeId_Label in my form bean ??*
    I just wanna to make my <html:select> readonly..pls see my first post in this thread....!!
    <c:choose>
         <c:when test="${controlEnabled}">
           <html:select property="paramTypeId" >
                <html:options collection="queryReturnType" property="value" labelProperty="label"/>
           </html:select>
         </c:when>
         <c:otherwise
           <html:text property="paramTypeId_Label" value="${queryReturnType[paramTypeId].label}" readonly="true"/>
           <html:hidden property="paramTypeId"/>
         </c:otherwise>
    </c:choose>--Thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Update database from 11.2.0.1 to 11.2.0.3

    Hi all,
    I have installed 11gR2 *(11.2.0.1)* on Redhat Linux 5.4.
    No I want to update database version to *11.2.0.3*
    How to achieve this.
    This is for testing purpose.
    Bala:)

    You do this by reading the readme which comes with every patch set.
    No one here would abstract it for you.
    Sybrand Bakker
    Senior Oracle DBA

  • On iOS7.0.3 html select tag with attribute 'multiple' crashes Safari

    Try loading an HTML page on Safari that has:
    <div>Multi-Select Picklist- tap on this to crash the iOS app
    <select id="12121" title="Available" multiple="multiple" size="3" style="width: 120px;">
    <optgroup label="Available">
    <option value="1">AAAAAA</option>
    <option value="2">BBBBBB</option>
    <option value="3">CCCCCC</option>
    <option value="4">DDDDDD</option>
    </optgroup>
    </select>
    </div>
    Safari will crash once you tap on the picklist. If I remove the attribute 'multiple' or if you have set it as multiple="multiple" it will work, but then it will offcourse not allow multiple selection. At least need to know a workaround.

    You might be better of asking this in the Developer forum. They might know more information about that, or at least in the Safari forum. I'll ask the moderators to move this for you.

  • Struts - HTML:link tag with dynamic page attribute?

    I am trying to use the html:link but the page value is dynamic (resulting from the bean within the iterate tag). The code below doesn't work - error. Is there a way to use all Struts tags and make this happen. Any ideas?
            <logic:iterate id="myMenuForm" property="menuItem" scope="session" name="menuForm" >          <html:link page="<bean:write name="myMenuForm" property="menuDisplayName"/>">                  <bean:write name="myMenuForm" property="menuDisplayName"/>          </html:link>        </logic:iterate> Thanks,
    mlv

    Thanks for all your help. Based on all you your comments, it is now working
    and I thought I would provide some details about how I got it working.
    There are not that many examples within the Struts documentation.
    id = unique name for the object that can be referenced within the iterate
    tag.
    name = is the Bean, in this case it's the ActionForm, that contains the List
    object that will be iterated. In my case, I have a ActionForm that contains
    a List property that contains all the menu item rows from the databse.
    property = is the property name within the ActionForm that is the List
    object. Links to the getter method
    Within the <bean:write> tag you use the id name to get a handle on the final
    object from the iterate tag and the property is one of the property values
    within the bean that is contained within the List.
    So in this case I have a ActionForm bean that contains a List property that
    contains a collection of beans.
    FormAction - bean
    property menuItems of type List contains:
    - row 1 = bean (with a property of menuDisplayName)
    - row 2 = bean (with a property of menuDisplayName)
    - row 3 = bean (with a property of menuDisplayName)
    Here's the JSP code for the tag.
            <logic:iterate id="myMenuForm" name="menuForm" property="menuItem" >
              <html:link page="www.yahoo.com"/>
                      <bean:write name="myMenuForm" property="menuDisplayName"/>
              </html:link>
            </logic:iterate>Now I would like to make the <html:link> page attribute value dynamic from
    the iterate bean. Therefore, you can make the url for the link dynamic If
    you know how to do that, please feel free to provide some help.

  • JSF equivalent of HTML select Tag

    Can any one please tell me how to achieve this in JSF.
    <select>
      <option selected="selected" value="volvo">Volvo</option>
      <option value="saab">Saab</option>
      <option value="mercedes">Mercedes</option>
      <option value="audi">Audi</option>
    </select>I have tried this but its not working:
    I want the "Volvo" option to be the default selected one.
    <tr:selectOneChoice label="Car" required="true"
                              value="#{myBean.car}">
            <f:selectItem value="A" itemValue="A" itemLabel="Volvo"/>
            <f:selectItem value="B" itemValue="B" itemLabel="Saab"/>
            <f:selectItem value="C" itemValue="C" itemLabel="Mercedes"/>
            <f:selectItem value="D" itemValue="D" itemLabel="Audi"/>
      </tr:selectOneChoice>With the HTML code the VOLVO value comes as default selected, but with the JSF Code the default value is blank in the drop down. I want the first value to be selected in the drop down.
    Some one please help.

    You need to set the 'value' attribute of the selectOneChoice to the desired value as it is in f:selectItem's 'itemValue' attribute.
    That said, the 'value' attribute of the f:selectItem should point to a javax.faces.model.SelectItem property, not a plain vanilla String. Also, you should either use that only, OR the itemValue and the itemLabel.

  • Cannot use jstl tag for jsp page which generated from Human Task

    Hi
    Plz help me.
    I have tried to using jstl in jsp which generate from Human Task and I deploy it to server( by ant on Jdev ) to see task detail in Oracle Worklist application. But when i submit task and then I access to worklist to see task detail, the error has show in page that "OracleJSP: An error occurred. Consult your application/system administrator for support. Programmers should consider setting the init-param debug_mode to "true" to see the complete exception message. " .
    I access server to see application.log to see error and I see error show "workflowform: JspServlet: unable to dispatch to requested page: Exception:oracle.jsp.parse.JspParseException: /Header1.jsp: Line # 3, <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%> "
    How do I fix this error?
    PS. I tried to us jstl because I need to connet to database which jstl tag(sql) if somebody has another solution for connect database in task detail page, Please help suggest me.
    Thanks
    user520932

    Is the jstl tag libray loaded in the appsserver?
    Can you use jdbc connection like
    DataSource ds = ic.lookup("java:comp/env/jdbc/myDB");
    Connection con = ds.getConnection();
    DataSource ds = (DataSource) org.apache.derby.jdbc.ClientDataSource()
    ds.setPort(1521);
    ds.setHost("localhost");
    ds.setUser("APP")
    ds.setPassword("APP");
    Connection con = ds.getConnection();
    http://java.sun.com/docs/books/tutorial/jdbc/basics/connecting.html

  • Updating Database From csv File in Web Dynpro Java

    Hi Gurus,
    I'd like to write an WDJ where the (super-)user can upload a csv file and delta-update the content of this file witch an external database.
    Could you please give some me hints & examples.
    Thanks in advance,
    Farid
    ps. answers will be rewarded with points, of cource.

    Hi Farid:
    From your question it seems like you want to write a WDJ application which writes a CSV file after connecting to a database and everytime you do so, updates the file with the new record from the DB.
    For this, I wouldnt think to write an application in WebDynpro since its an over kill, unless you want to host this appln in a portal environment and want it accessible for  a set of people.
    Ideally you could use the JDK api to open a connection to the database and then then file api to write to files. You would need to use an identifier somewhere to know the last record read and written to the file.
    Incase you put in the type of db you want to connect to, i could be of more help
    Thanks,
    LioneL

Maybe you are looking for