Jsp/bc4j form

Hi All
I am trying to develop a JSP page to use the user to submit a form. In normal browse edit page we create a row and then update that row.
How can i code the form that when user wants a form the new row already gets created and the edit form is presented to the user.
Please help
Thanks
Preety Agarwal

Preety -
What you can do is run the browse form, click 'new' and then copy that URL. That is the URL that you can use to present
the edit for to the user. Notice that it calls the Edit form with a jboEvent of 'Create'. That's how it's determined whether
to display the selected row or blank text fields for inserting data.
Hope this helps,
Lynn
Java Tools Team

Similar Messages

  • Shell commands from JSP after Forms migration

    During application migration from forms 9i to JSP & BC4J, I have to code the following Forms code into my JSP application.This is for a button pressed trigger.
    DECLARE
    RENAME_STRING VARCHAR2(120):= 'RENAME C:\BRC\PDATA' ||:DRAWING_ACCOUNTS.ACCOUNT_ID|| '.TXT P' || :DRAWING_ACCOUNTS.ACCOUNT_ID || TO_CHAR(SYSDATE,'DDMMYY')|| '.txt';
    BEGIN
    HOST( RENAME_STRING, no_screen );
    web.show_document( 'http://hostname/selectfile.html', '_new');
         IF NOT Form_Success THEN
              Message('Error -- File not Renamed.');
         END IF;
    END;
    How can I do this simple sending of OS commands in JSP, any ideas?

    Hi,
    Not only rename commands but I have to pass several other os commands like 'sqlldr' for data upload as well. Therefore, I need a reusable piece of code for that. I have acheived some way for that using the following code.
    put the following file in that package.
    package BankrecBC4J;
    import java.util.*;
    import java.io.*;
    import java.net.*;
    import java.text.*;
    import java.util.zip.*;
    class StreamGobbler extends Thread
    InputStream is;
    String type;
    StreamGobbler(InputStream is, String type)
    this.is = is;
    this.type = type;
    public void run()
    try
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line=null;
    while ( (line = br.readLine()) != null)
    System.out.println(type + ">" + line);
    } catch (IOException ioe)
    ioe.printStackTrace();
    public class GoodWindowsExec
    private static final boolean NATIVE_COMMANDS = true;
    //Allow browsing and file manipulation only in certain directories
         private static final boolean RESTRICT_BROWSING = false;
    //If true, the user is allowed to browse only in RESTRICT_PATH,
    //if false, the user is allowed to browse all directories besides RESTRICT_PATH
    private static final boolean RESTRICT_WHITELIST = false;
    //Paths, sperated by semicolon
    //private static final String RESTRICT_PATH = "C:\\CODE;E:\\"; //Win32: Case important!!
         private static final String RESTRICT_PATH = "/etc;/var";
         * Command of the shell interpreter and the parameter to run a programm
         private static final String[] COMMAND_INTERPRETER = {"cmd", "/C"}; // Dos,Windows
         //private static final String[] COMMAND_INTERPRETER = {"/bin/sh","-c"};      // Unix
         * Max time in ms a process is allowed to run, before it will be terminated
    private static final long MAX_PROCESS_RUNNING_TIME = 30 * 1000; //30 seconds
         //Normally you should not change anything after this line
         //Change this to locate the tempfile directory for upload (not longer needed)
         private static String tempdir = ".";
         private static String VERSION_NR = "1.1a";
         private static DateFormat dateFormat = DateFormat.getDateTimeInstance();
    public GoodWindowsExec(String g)
    System.out.println(" hello " + g);
    /*if (g.length < 1)
    System.out.println("USAGE: java GoodWindowsExec <cmd>");
    System.exit(1);
    try
    String osName = System.getProperty("os.name" );
    String[] cmd = new String[3];
    System.out.println("here ");
    if( osName.equals( "Windows NT" ) )
    cmd[0] = "cmd.exe" ;
    cmd[1] = "/C" ;
    cmd[2] = g;
    else if( osName.equals( "Windows 2000" ) )
    System.out.println("Windows 2000");
    cmd[0] = "command.com" ;
    cmd[1] = "/C" ;
    cmd[2] = g;
    else if( osName.equals( "Windows XP" ) )
    System.out.println("Windows XP");
    cmd[0] = "command.com" ;
    cmd[1] = "/C" ;
    cmd[2] = g;
    else if( osName.equals( "Windows 95" ) )
    cmd[0] = "command.com" ;
    cmd[1] = "/C" ;
    cmd[2] = g;
    Runtime rt = Runtime.getRuntime();
    System.out.println("Execing " + cmd[0] + " " + cmd[1]
    + " " + cmd[2]);
    Process proc = rt.exec(cmd);
         * Starts a native process on the server
         *      @param command the command to start the process
         *     @param dir the dir in which the process starts
    // any error message?
    StreamGobbler errorGobbler = new
    StreamGobbler(proc.getErrorStream(), "ERROR");
    // any output?
    StreamGobbler outputGobbler = new
    StreamGobbler(proc.getInputStream(), "OUTPUT");
    // kick them off
    errorGobbler.start();
    outputGobbler.start();
    // any error???
    int exitVal = proc.waitFor();
    System.out.println("ExitValue: " + exitVal);
    } catch (Throwable t)
    t.printStackTrace();
         * Converts some important chars (int) to the corresponding html string
         static String conv2Html(int i) {
              if (i == '&') return "&amp;";
              else if (i == '<') return "&lt;";
              else if (i == '>') return "&gt;";
              else if (i == '"') return "&quot;";
              else return "" + (char) i;
    static String startProcess(String command, String dir) throws IOException {
              StringBuffer ret = new StringBuffer();
              String[] comm = new String[3];
              comm[0] = COMMAND_INTERPRETER[0];
              comm[1] = COMMAND_INTERPRETER[1];
              comm[2] = command;
              long start = System.currentTimeMillis();
              try {
                   //Start process
                   Process ls_proc = Runtime.getRuntime().exec(comm, null, new File(dir));
                   //Get input and error streams
                   BufferedInputStream ls_in = new BufferedInputStream(ls_proc.getInputStream());
                   BufferedInputStream ls_err = new BufferedInputStream(ls_proc.getErrorStream());
                   boolean end = false;
                   while (!end) {
                        int c = 0;
                        while ((ls_err.available() > 0) && (++c <= 1000)) {
                             ret.append(conv2Html(ls_err.read()));
                        c = 0;
                        while ((ls_in.available() > 0) && (++c <= 1000)) {
                             ret.append(conv2Html(ls_in.read()));
                        try {
                             ls_proc.exitValue();
                             //if the process has not finished, an exception is thrown
                             //else
                             while (ls_err.available() > 0)
                                  ret.append(conv2Html(ls_err.read()));
                             while (ls_in.available() > 0)
                                  ret.append(conv2Html(ls_in.read()));
                             end = true;
                        catch (IllegalThreadStateException ex) {
                             //Process is running
                        //The process is not allowed to run longer than given time.
                        if (System.currentTimeMillis() - start > MAX_PROCESS_RUNNING_TIME) {
                             ls_proc.destroy();
                             end = true;
                             ret.append("!!!! Process has timed out, destroyed !!!!!");
                        try {
                             Thread.sleep(50);
                        catch (InterruptedException ie) {}
              catch (IOException e) {
                   ret.append("Error: " + e);
              return ret.toString();
    In the first line of the JSP file include the package
    <%@page import="BankrecBC4J.*" %>
    and call
    it this way:from the jsp page
    new GoodWindowsExec ("calc"); //
    which should open up the calciulator, and should do for other os commands as well.
    Thanks

  • Adf-Struts/JSP/BC4J- and setting date fields from jsp

    Hi,
    I'm working with the new ADF Frameworks (JDev 9.0.5.1) and ran into some questions regarding exception handling using BC4J, Struts and JSPs.
    I have a DATE column in database and an entity and VO with a datefield with type oracle.jbo.domain.Date.
    My JSP shows a textfield and the user should enter a valid date. Everything fine, until date is of wrong format or contains illegal characters...
    Problem:
    ADF tries to do a setAttribute on the datefield in VO row which expects a parameter with type oracle.jbo.domain.Date. When the user entered e.g. "NiceWeather" as date, I get an IIlegalArgumentException while converting to the correct Date format. This exception isn't thrown by bc4j as AttrValException and therefore my JSP renders a global error instead of a message directly behind the date field.
    I tried to validate the datefield in my DataForm and in my Action in the validateModelUpdates() method, but with no fitting solution.
    Any ideas how to validate a datefield with adf/struts/jsp/bc4j?
    Thanks for your help!
    Torsten.

    Torsen - In the first instance I'd recommed that you try and handle it declaritively using the Struts Validator Framework . See http://otn.oracle.com/products/jdev/howtos/10g/StrutsValidator/struts_validator_howto.html
    There is a section in there on how to use the validator with ADF databound pages and you can check the format the user enters via generated JavaScript.
    Also check out the matching sample project:
    http://otn.oracle.com/sample_code/products/jdev/10g/ADFandStrutsValidator.zip - this has a data field check on it as well

  • Calling JSP from Forms and going back from JSP to Forms

    Hi,
    We are calling JSP from Forms 6i using show_document
    I'd like to go back to tha calling Form from the JSP.
    How can I construct the URL that would lead me back to the same Form and Forms session where the JSP was called from?
    Thanks,
    Arpad

    Thanks Shay,
    works for me too...
    Now:
    when I use the "Back" button of my IE to go back from JSP to the Forms session, it works for Jinitiator 1.1.8.19, but if I use Jinitiator 1.3 I got hung...
    Any ideas how could I make it work from Jinit 1.3?
    Thanks again/
    Regards,
    Arpad

  • UIX-BC4J Form Example

    Could anybody post an example of a simple UIX-BC4J Form with Insert, Update and Delete event handlers but NOT in automatic mode?
    TIA.
    Francisco

    I still consider myself a beginner in UIX/BC4J, but I presented a paper at June's ODTUG conference that included an example. Try www.odtug.com, look at the 2002 handouts, under JDeveloper. You should be able to download the Powerpoint. If you're interested, e-mail me and I'll send you the actual paper (as a Word document). Or just buy the conference proceedings from ODTUG. They papers should also be up soon in the "Members Only" section of the ODTUG site.
    -- jim

  • Pass Parameter to second.jsp using "form & action"

    I wrote a JSP Portlet. Like the sample, multipage. But, I need to use <form> to pass the parameter to second.jsp
    The first.jsp include:
    <form name="parameters" method="POST" action="<%= HttpPortletRendererUtil.htmlFormActionLink(request,PortletRendererUtil.PAGE_LINK) + "?" + HttpPortletRendererUtil.portletParameter(request, "next_page") + "=second.jsp" %>" >
    The provider.xml include:
    <pageParameterName>next_page</pageParameterName>
    But, error occur and show as following:
    Wed, 21 Mar 2001 10:20:02 GMT
    No DAD configuration Found
    DAD name:
    PROCEDURE : !null.wwpob_page.show
    URL : http://oraas2:80/pls/null/!null.wwpob_page.show?_pageid=null
    PARAMETERS :
    ===========
    ENVIRONMENT:
    ============
    Do I have to do something with next_page or pageID?
    I have run the first.jsp in the sample that JPDK provided. After each click, the screen will refresh.
    null

    Leo,
    The error you are getting is actually a portal error, you have an incorrect URL.
    http://oraas2:80/pls/null/!null.wwpob_page.show?_pageid=null
    If you notice, after pls, you should have a DAD name such as portal30. Instead you have null. Take a look at your Database access descriptors in Portal and update your URL.
    Sue

  • JSP parameter form question...Please Urgent..

    Hi,
    Can I use JSP parameter form to the Paper report.
    Like calling the paper report URL in the action=<" "> by passing the values selected in the jsp param form to the parameters in the paper report URL ?
    Please give me the code.
    Please help me. Its very urgent.
    Thanks alot.
    Priya.

    you just have to define the report user parameters with the same name you use in the JSP parameter form and setting the action attribute of the Form tag like that(calling rwservlet) action="rwservlet" & method="get", then all form inputs will be concatenated to the rwservlet call and passed as parameters to the report.
    thx.

  • Jsp Login Form

    Hi All,
    I am new to JSP. Please send me a JSP Login Form Validatio with DB.
    Regards,
    Gokul.

    Validation.jsp whats the error in that
    <%@ page language="java" import="java.sql.*,java.io.*,java.lang.*,java.util.*,com.login.users.*" %>
    <jsp:useBean id="user" class="com.login.users.Users" />
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
    <head>
    <% Connection cc = user.connect();
    String username = request.getParameter("j_username");
    String password = request.getParameter("j_password");
    ResultSet rs = user.validateUser(cc);
    %>
    </head>
    <body>
    <%
    while(rs.next()){
    String u1 = rs.getString("name");
    String p1 = rs.getString("Password");
    if (u1.equals(username) && (p1.equals(password))){
    break;
    %>
    <jsp:forward page="err.html" />
    <%}
    out.println("You Are a Valid User");
    user.disconnect();
    %>
    </body>
    </html>
    my mail id is [email protected]

  • UiXML using Legacy BC4J Form Components

    I have created a uiXML page. In this page I have four BC4J choice drop down boxes from the uiXML Legacy BC4J Form Components. These choice boxes are dependent upon each other. For example: I select an item from the first choice box. This item is then used to query the database and populate the result in the second choice box and so on. I have two questions:
    1) Why when I place the choice boxes on the designer page in JDeveloper10G they do not show up? I can find them in the XML Code, but not in the designer.
    2) How do I perform this querying of the database with the selection from the choice box. Are there certain components I should use? I know I need an appModuleScope and a viewObjectScope.
    Any suggestions would be greatly appreciated. Thanks for your time.

    I have created a uiXML page. In this page I have four BC4J choice drop down boxes from the uiXML Legacy BC4J Form Components. These choice boxes are dependent upon each other. For example: I select an item from the first choice box. This item is then used to query the database and populate the result in the second choice box and so on. I have two questions:
    1) Why when I place the choice boxes on the designer page in JDeveloper10G they do not show up? I can find them in the XML Code, but not in the designer.
    2) How do I perform this querying of the database with the selection from the choice box. Are there certain components I should use? I know I need an appModuleScope and a viewObjectScope.
    Any suggestions would be greatly appreciated. Thanks for your time.

  • Looking for documentation about filling Comboboxes in bc4j forms

    Im looking documentation about filling comboboxes in bc4j forms. My case is as follows:
    I have an edit form. This edit form needs two comboboxes. The values in the second combo box depends of the choice selected in the first combo box. Both combos are bounded to its respective tables.
    How can i do that?
    Thank u.

    Orlando
    JComboBox jComb1 = new JComboBox();
    // bind combo box to BC4J
    jComb1.addPropertyChangeListener(new PropertyChangeListener()
    public void propertyChange(PropertyChangeEvent e)
    String val = ((JComboBox) e.getSource()).getSelectedItem();
    // use value to change query for VO2 and combobox 2
    Frank

  • Create Form Beans from JSP/HTML forms

    In the Builder certification objectives, there is one called "Create Form Beans from JSP/HTML forms". How can I do that? How can I create a form beam starting from the JSP form or HTML form?

    Guys, no one from forum can answer this question?

  • Run jsp/bc4j

    hi
    im not sure if i'm right in this forum.
    i use jdeveloper to build a jsp/bc4j application. is it possible to develop the files directly on the remote application-server?
    what's the keyword to find more informations?
    thanks

    See this post:
    BC4J app deployment question
    Mike.

  • Jsp,bc4j,Data web Bean , error : NO ROWS AVAILABLE FOR EDITING

    HI
    I'm developping a jsp application based on Bc4j. when trying to insert a new row with missing fields which must be not null,
    in order to be able to edit the row and correct the non seized fields, I display the edit page and it works for several views. but this time when editing fields and submitting the edit form an error is raised with the message no rows available for editing.
    the particularity for these views(which causes the error) is that are details for a view which is detail for an other.
    can someone please suggest some solution for such a problem
    thanks in advance
    Ghassen
    null

    ghassen
    this is a typicall error that occurs when trying to execute the Row data tag with action "Update" and there is not row obtained through the rowkeyparam (normally MyRowKey url parameter passed from the Edit page). I don4t have sufficient information to give you an exact solution.
    I don4t understand all your escenario, you spoke about "Insert new row with missing values in required fields", but if you don4t specify a right value to that fields, the insert fail.
    Then you display the Edit page to edit that just inserted row, to correct (specify?) the values of that fields. The error occurs in the EditSubmit page.
    The EditSubmit page execute de Row data tag, according to the implementation of Rowtag, first recover the row reference (from rowkeyparam url parameter) and then, if that row reference is null, throws the "No rows available for editing" Runtime Exception. This means that the datasource used in your EditSubmit page not include that RowKey reference (obtained from Edit page as Url parameter).
    HTH
    Pepe

  • JSP, BC4J, Row Tag: what is the best way to delete multiple rows?

    Hi all.
    I have a JSP Edit page with three datasources on it. The tables these VO's represent (A, B and C) have a Parent --> Child (1:1 between A and B) relationship and then another Parent --> Child (1:n between B and C) relationship. So the user retrieves one row for Table A, 1 matching row for table B and then between 0 and 6 matching rows for Table C (there cannot be more than 6 because the user can only add these rows from a finite list).
    In my EditSubmit page, I want to perform a RowTag Update action on Tables A and B and they both work no problem. They can't update any rows from Table C but they can add or delete from the list of 0 - 6 rows (the UI is actually a list of 6 checkboxes that they can turn on or off). I figure that the easiest way to handle this rather than keep a list of original values and compare them is simply to delete all existing rows and then add any that the user checked.
    This is causing a problem. I have added a hidden field to the form that picks up the RowKey for each existing row. I can get these RowKeys in the Submit page but cannot find a way of using them with the Delete Row Tag.
    In the end, the only way I could get it to work was the following code (which I stole from the RowTag.java file in jbohtmlsrc.zip):
    if (stakeMailRowKeys != null) {
    for (int counter = 0; counter < stakeMailRowKeys.length; counter++) {
    Key stakeMailKey = new Key(stakeMailRowKeys[counter], stakeMailingRS.getViewObject().getKeyAttributeDefs());
    stakeMailRows = stakeMailingRS.findByKey(stakeMailKey,1);
    stakeMailingRow = stakeMailRows[0];
    // Tell the row to delete itself from the database
    stakeMailingRow.remove();Is there a simpler way to do this (I figure there probably is)? I have another problem with updating the constrained View Objects but I will leave that out of this thread for now.
    TIA,
    Simon

    I don't know if this will help you, but this is what I do:
    I separate the logic into a delete.jsp page. If you can create a View Object that will represent the rows you want to delete and append a where clause to select only the rows you want to delete. Then loop through the view deleting each row. Lets just say you have department and employee tables. and you want to delete employees within a given department. Create a view object that brings back all employees.
    In your delete.jsp find out the department no. by request.getParameter("dept_id");
    then append this to the where clause of your view Object and execute the query:
    vo.setWhereClause(request.getParameter("dept_id");
    vo.executeQuery;
    now loop through and remove the rows:
    while(vo.next){
    vo.getCurrentRow().remove();
    and commit or post changes accordingly.
    There are many ways of doing this action. The easiest way I have found is to create the ViewObjects based on what actions you want to take on them. Make bc4j work for you.
    regards,
    aaron
    null

  • 9i;JSP; BC4J Data Tags...

    Hi,
    What's different between these two tags in BC4J Data Tags pallet:
    <jbo:InputText> & <jbo:InputRender>

    Hello,
    Here is the difference (from the online documentation)
    <jbo: InputText> Inserts a text-input field form element into
    your page.
    JSP Syntax <jbo:InputText
    datasource="datasourceId" dataitem="attributename"
    [ cols=numberCharactersWide ]/>
    Examples
    Order Id:<jbo:InputText datasource="Orders" dataitem="Id" />
    Description The input render converts all values to a String for
    storage in the database.
    <jbo: InputRender>
    Inserts a input form element that allows user to edit data of
    all types, including complex object types.
    JSP Syntax
    <jbo:InputRender
    datasource="datasourceId"
    dataitem="attributename"/>
    Examples
    <form enctype="multipart/form-data"
    NAME="iForm" METHOD="POST"
    ACTION="Submit_AddImage.jsp" >
    Image Id:<jbo:InputRender datasource="ds1" dataitem="Id" />
    Image File:<jbo:InputRender datasource="ds1"
    dataitem="Image" /><input type="submit" /> </form>
    Description
    Input form uses a field render specific to the object type.
    Hope this helps. You can search on the online documentation for
    description about this and other components.
    Thanks,
    -Kishore
    JDev Team

Maybe you are looking for

  • Simple problem with a list initialization.

    hello ! i have a class Contact and i would like to make a list of lists of Contact variables .. but when i try to run my code , it says "IndexOutOfBoundsException: Index: 0, Size: 0" . I know that every list of the list must be initialized .. but i d

  • 'No further confirmations expected '  in a PO

    We have a service PO  and when i click on 'No further confirmations expected' for a line items and order the PO. The check box of 'No further confirmations expected' is reset to blank.Please advise .

  • Graphical component for date??

    is there any graphical component enable user to select a date (day,mounth,year)? thanks in advance

  • Screen resolution with new graphics card

    Mac G4 400 AGP (Sawtooth) OS9.2.2 + Tiger Hi, I have just updated my old G4 with new HD and new Nvidia GeForce 2MX graphics card. Under OSX everything seems fine but under OS9 the screen (22 Lacie Electron) will only display at 640 x 480 with no othe

  • White circle with diagonal line on start-up  where the black Apple was

    Started up an A1138 powerbook. It showed the black Apple, then the revolving little hairy wheel for quite a while, then replaced the black Apple with this circle and now just sits there. Any ideas? Thanks