Handling Popup Return Values

Hi
I have created a popup that I can pass values to, perform a search in, and return an object from with the values I want set. It works fine.
The problem I have is I want to display one value from the returned object and have another value hidden but available when the originating page submits.
If I display both values in fields on the originating form so they can be seen, all is well. If I try and use a hidden field there is no partial trigger attribute so it doesn't work. If I use a standard text field but change the render attribute to false so it doesn't display, I don't have a value submitted.
The only solution I have so far is to record the value I don't want displayed in my session bean, maybe this is the excepted approach?
Tom
Message was edited by:
user571146

Errrr, don't know is the honest answer.
I'm new to using JDev and the ADF stuff.
It would seem the hiddenInput field is no good because of the missing PartialTrigger attribute.
If I use the normal text field and turn rendering off then I can set the PartialTrigger, in the return handler I use the lines...
inputText4.setSubmittedValue(null);
inputText4.setValue(d.getId());
to set the value, as describe in the SRDemo example.
I then use EL to read the value back later on when I am handling the submit of the entire page.
If I set the render attribute to false the, I don't appear to get a value back from the EL.
Does that make more sense?
Tom

Similar Messages

  • Any example for (bounded task flow) popup return value

    I need to know what is the type of popup RETURN VALUE
    any example will be great

    I want to get parameter form popup bounded task flow with NO page fragment (task flow 1) to jsff page from another task flow with page fragment(task flow 2)
    I applied the scenario exist in URL's in first replay and it didn't work
    when I select task flow 1 from inside task flow 2 diagram I found in its inspector page filed called "Dialog Return Value"
    how can I use this field

  • [ASK] popup return value only able to be displayed in disabled inputtext

    Hi,
    I'm using Jdev 10.1.3.
    I have an inputtext and a commandbutton that triggers its value by selecting it from a popup window.
    The problem is the inputtext will be able to display the returned value only when its "disabled" attribute
    set to true. I need this inputtext to be enabled. Am i doing something wrong?
    This is what I'm doing:
    <af:panelGroup layout="horizontal">
          <af:inputText value="#{processScope.glCode}" binding="#{productBean.glCodeInputText}" disabled="true"
                                   id="glCodeValue" partialTriggers="dialogPopUpGlCode"
                                   required="true" requiredMessageDetail="Select a GL Code for this Product"/>
          <af:commandButton text="..." shortDesc="GL Code List" action="dialog:glCodePopUp" id="dialogPopUpGlCode"
                                   partialSubmit="true" useWindow="true" immediate="true" windowHeight="300" windowWidth="300"
                                   returnListener="#{productBean.onReturnFromSelectGlCodeDialog}">               
          </af:commandButton>
    </af:panelGroup>Backing bean:
        public String onReturnFromSelectGlCodeDialog(ReturnEvent returnEvent){
            returnGlCodeId = returnEvent.getReturnValue().toString();
            if (returnGlCodeId != null) {         
                PolicyMaintenanceModuleImpl policyMaintenanceModuleImpl = null;
                try {
                    policyMaintenanceModuleImpl = getPolicyMaintenanceModuleImpl();
                    Product_ParamGlCodeViewImpl paramGlCodeVo = (Product_ParamGlCodeViewImpl)policyMaintenanceModuleImpl.getProduct_ParamGlCodeView();
                    paramGlCodeVo.setWhereClause("PARAM_GL_CODE_ID = '"+returnGlCodeId+"'");
                    paramGlCodeVo.executeQuery();
                    while (paramGlCodeVo.hasNext()) {
                        Product_ParamGlCodeViewRowImpl row = (Product_ParamGlCodeViewRowImpl)paramGlCodeVo.next();
                        returnGlCode = row.getGlCode().toString();
                finally {
                    releaseAM(policyMaintenanceModuleImpl);
                ((AttributeBinding)getBindings().getControlBinding("GlCode")).setInputValue(returnGlCode);
                JSFUtil.setProcessObj("glCode",returnGlCode);
            return null;
        }Please help..T_T
    Thanks a lot..

    Thanks Shay, I've followed your suggestion but with no luck..
    <af:selectInputText required="true" columns="#{bindings.GlCode.displayWidth}"
                                            windowHeight="300" windowWidth="300" simple="true"
                                            action="dialog:glCodePopUp" value=""
                                            binding="#{productBean.selInputTextGlCode}"
                                            returnListener="#{productBean.handleGlCodeReturn}"/>What do I should put in the "value" attribute? I've tried #{bindings.GlCode.inputValue} but if I do that then the selectinputtext will displayed in zero length (just a small vertical grey line) and with no such that green flash light image on the right. Because the main page is an add new form, so for the first time all the input is blank.
    This is the handling method in the add-new-page back bean:
        public void handleGlCodeReturn(ReturnEvent returnEvent) {
            GlCodePopUpBean glCodeBean = (GlCodePopUpBean)returnEvent.getReturnValue();
            if(glCodeBean == null)return;
             //setter lines
             String glCodeId = glCodeBean.getGlCodeId();
             String glCode = glCodeBean.getGlCode(); 
             getSelInputTextGlCode().setValue(glCode);
             getSelInputTextGlCode().setSubmittedValue(null);
             ((AttributeBinding)getBindings().getControlBinding("ParamGlCodeId")).setInputValue(glCodeId);
             AdfFacesContext afContext = AdfFacesContext.getCurrentInstance();
             afContext.addPartialTarget(getSelInputTextGlCode());
        }I've printed out glCodeId, glCode and getSelInputTextGlCode().getValue() after the setter lines, and all of them printed the right value, but it just not displayed in the inputtext!
    I've also tried using processScope - #{processScope.glCode} - and it also failed in displaying the value in the inputtext.
    I wonder what's wrong?

  • Popup return value

    how I use this function???
    $v_PopupReturn(pValue, pThat)
    Sets the value of the item in the parent window (pThat), with (pValue) and then closes the popup window.
    Return Value
    Not applicable.
    Parameters
    pValue (string)
    pThat (DOM node | string ID)

    > Unfortunately if it was Fortran, well Fortran IV, I'd recognize it.<g>
    In my bookshelf in my computer room at home, I still have "Numerical Methods with Fortran IV Case Studies". By William Dorn and Daniel McCracken.
    Of course, the book is next to McCracken's "Simplified Guide to Structured Cobol Programming".
    Can't say I really miss programming in either. :-)

  • Handling the return values and passing values to a dialog

    Dear all,
    I am trying to return values from a dialog to a page.
    I am following a tutorial:
    http://www.oracle.com/technology/products/jdev/101/howtos/adfdialog/index.html
    its okey, but I couldnt understand the following code:
    public void handleReturn(ReturnEvent event)
    if (event.getReturnValue() != null)
    Customer cst;
    String name;
    String psw;
    cst = (Customer)event.getReturnValue();
    CustomerList.getCustomers().add(cst);
    name = cst.getFirstName();
    psw = cst.getPassword();
    inputText1.setSubmittedValue(null);
    inputText1.setValue(name);
    inputText2.setSubmittedValue(null);
    inputText2.setValue(psw);
    please help me what are these variables?
    that I could be able to map with me own.
    Regards:
    Muhammad Nadeem
    [email protected]

    If you look further down on the tutorial, you will notice that these values are set in the dialog done() and cancel() actionListeners. Similarly, you will return your own object(s) when calling returnFromProcess() - see the done() method.
    Regards,
    Nick

  • Handling Collection return values best paractice

    hi;
    over 50% of my code returns Collection implementations as return values plus those Collections have proprietry objects that have nested Collections inside them.
    what a best practice for dealing with such a problem when trying to expose these methods as webservices?
    i could not understand by searching the forum if i can return a Collection or not (there are mixed posts on that).
    any help would be great
    P.S: i am using jboss application server + axis

    Your method seems to return an entity with semantic
    maening, otherwise the values wouldn't belong
    together. So what's wrong with an object? Especially
    if you're doing further calculations with the data -
    they should be performed by this object then.They are not particularly well related... apart from they are returned together.
    I have several different cases that I am currently working with. In one instance (c, n_t, s_f_0, s_f_1, s_vPrime) are returned, they are all BigIntegers but that is where the similarities end. c is a MessageDigest (converted to BigInteger), n_t is a random number. The remaining values have something in common s_x := r_x + c * x where x = {s_f_0, s_f_1, s_vPrime}.
    The variable names are taken straight from a research paper... hence their nonsensical meaning. I have opted to keep them throughout for ease of development (I don't fancy having a lookup table....)

  • Handle hex return values in mapping

    Hi
    I have a return from SAP Content Server that comes in hex format. My message mapping are not happy and as far as I have understood, normal message mapping and XSLT cannot handle this return.
    I have tried with ABAP mapping, but the output stream is still on hex format. Does anyone know how a java mapping can handle this? The input stream is ok, but I would like to output a string (or something else readable for the mapping) instead of the outputstream from the java mapping. Do I have to use StreamTransformation for the java mapping, or do I have any other options?
    Thanks!
    regards Ole

    First you should mention, how you want the output, then people can give advice, how to achive this.
    When I have understood right, your response is a plain hex string like this:
    127464fde452f.
    The easiest way to handle this, is envelope this with a tag:
    <root>127464fde452f</root>

  • Multiple return values (Bug-ID 4222792)

    I had exactly the same request for the same 3 reasons: strong type safety and code correctness verification at compile-time, code readability and ease of mantenance, performance.
    Here is what Sun replied to me:
    Autoboxing and varargs are provided as part of
    JSRs 14 and 201
    http://jcp.org/en/jsr/detail?id=14
    http://jcp.org/en/jsr/detail?id=201
    See also:
    http://forum.java.sun.com/forum.jsp?forum=316
    http://developer.java.sun.com/developer/earlyAccess/adding_generics/index.html
    Multiple return values is covered by Bug-ID 4222792
    Typically this is done by returning an array.
    http://developer.java.sun.com/developer/bugParade/bugs/4222792.html
    That's exactly the problem: we dynamically create instances of array objects that would better fit well within the operand stack without stressing the garbage collector with temporary Array object instances (and with their backing store: 2 separate allocations that need to be recycled when it is clearly a pollution that the operand stack would clean up more efficiently)
    If you would like to engage in a discussion with the Java Language developers, the Generics forum would be a better place:
    http://forum.java.sun.com/forum.jsp?forum=316
    I know that (my report was already refering to the JSR for language extension) Generics is not what I was refering to (even if a generic could handle multiple return values, it would still be an allocated Object
    instance to pack them, i.e. just less convenient than using a static class for type safety.
    The most common case of multiple return values involve values that have known static datatypes and that should be checked with strong typesafety.
    The simple case that involves returning two ints then will require at least two object instances and will not solve the garbage collection overhead.
    Using a array of variable objects is exactly similar, except that it requires two instances for the components and one instance for the generic array container. Using extra method parameters with Integer, Byte, ... boxing objects is more efficient, but for now the only practical solution (which causes the least pollution in the VM allocator and garbage collector) is to use a custom class to store the return values in a single instance.
    This is not natural, and needlessly complexifies many interfaces.
    So to avoid this pollution, some solutions are used such as packing two ints into a long and returning a long, depacking the long after return (not quite clean but still much faster at run-time for methods that need to be used with high frequencies within the application. In some case, the only way to cut down the overhead is to inline methods within the caller code, and this does not help code maintenance by splitting the implementation into small methods (something that C++ can do very easily, both because it supports native types parameters by reference, and because it also supports inline methods).
    Finally, suppose we don't want to use tricky code, difficult to maintain, then we'll have to use boxing Object types to allow passing arguments by reference. Shamely boxed native types cannot be allocated on the operand stack as local variables, so we need to instanciate these local variables before call, and we loose the capacity to track the cases where these local variables are not really initialized by an effective call to the method that will assign them. This does not help debugging, and is against the concept of a strongly typed language like Java should be:
    Java makes lots of efforts to track uninitialized variables, but has no way to determine if an already instanciated Object instance refered in a local variable has effectively received an effective assignment because only the instanciation is kept. A typical code will then need to be written like this:
    Integer a = null;
    Integer b = null;
    if (some condition) {
    //call.method(a, b, 0, 1, "dummy input arg");
    // the method is supposed to have assigned a value to a and b,
    // but can't if a and b have not been instanciated, so we perform:
    call.method(a = new Integer(), b = new Integer(), 0, 1, "dummy input
    arg");
    // we must suppose that the method has modified (not initialized!)
    the value
    // of a and b instances.
    now.use(a.value(), b.value())
    // are we sure here that a and b have received a value????
    // the code may be detected at run-time (a null exception)
    // or completely undetected (the method() above was called but it
    // forgot to assign a value to its referenced objects a and b, in which
    // case we are calling in fact: now.use(0, 0); with the default values
    // or a and b, assigned when they were instanciated)
    Very tricky... Hard to debug. It would be much simpler if we just used:
    int a;
    int b;
    if (some condition) {
    (a, b) = call.method(0, 1, "dummy input arg");
    now.use(a, b);
    The compiler would immediately detect the case where a and b are in fact not always initialized (possible use bere initialization), and the first invoked call.method() would not have to check if its arguments are not null, it would not compile if it forgets to return two values in some code path...
    There's no need to provide extra boxing objects in the source as well as at run-time, and there's no stress added to the VM allocator or garbage collector simply because return values are only allocated on the perand stack by the caller, directly instanciated within the callee which MUST (checked at compile-time) create such instances by using the return statement to instanciate them, and the caller now just needs to use directly the variables which were referenced before call (here a and b). Clean and mean. And it allows strong typechecking as well (so this is a real help for programmers.
    Note that the signature of the method() above is:
    class call {
    (int, int) method(int, int, String) { ... }
    id est:
    class "call", member name "method", member type "(IILjava.lang.string;)II"
    This last signature means that the method can only be called by returning the value into a pair of variables of type int, or using the return value as a pair of actual arguments for another method call such as:
    call.method(call.method("dummy input arg"), "other dummy input arg")
    This is strongly typed and convenient to write and debug and very efficient at run-time...

    Can anyone give me some real-world examples where
    multiple return values aren't better captured in a
    class that logically groups those values? I can of
    course give hundreds of examples for why it's better
    to capture method arguments as multiple values instead
    of as one "logical object", but whenever I've hankered
    for multiple return values, I end up rethinking my
    strategy and rewriting my code to be better Object
    Oriented.I'd personally say you're usually right. There's almost always a O-O way of avoiding the situation.
    Sometimes though, you really do just want to return "two ints" from a function. There's no logical object you can think of to put them in. So you end up polluting the namespace:
    public class MyUsefulClass {
    public TwoInts calculateSomething(int a, int b, int c) {
    public static class TwoInts {
        //now, do I use two public int fields here, making it
        //in essence a struct?
       //or do I make my two ints private & final, which
       //requires a constructor & two getters?
      //and while I'm at it, is it worth implementing
      //equals(), how about hashCode()? clone()?
      //readResolve() ?
    }The answer to most of the questions for something as simple as "TwoInts" is usually "no: its not worth implementing those methods", but I still have to think about them.
    More to the point, the TwoInts class looks so ugly polluting the top level namespace like that, MyUsefulClass.TwoInts is public, that I don't think I've ever actually created that class. I always find some way to avoid it, even if the workaround is just as ugly.
    For myself, I'd like to see some simple pass-by-value "Tuple" type. My fear is it'd be abused as a way for lazy programmers to avoid creating objects when they should have a logical type for readability & maintainability.
    Anyone who has maintained code where someone has passed in all their arguments as (mutable!) Maps, Collections and/or Arrays and "returned" values by mutating those structures knows what a nightmare it can be. Which I suppose is an argument that cuts both ways: on the one hand you can say: "why add Tuples which would be another easy thing to abuse", on the other: "why not add Tuples, given Arrays and the Collections framework already allow bad programmers to produce unmainable mush. One more feature isn't going to make a difference either way".
    Ho hum.

  • Return values for deadlock handling in BDB-SQLITE

    The whitepaper titled "Oracle Berkeley DB SQL API vs.SQLite API – A Technical Evaluation, November 2010" notes that
    all programs should be able to handle SQLITE_ERROR or SQLITE_LOCKED while handling potential deadlocks. From the sqlite errorcode page
    #define SQLITE_ERROR 1 /* SQL error or missing database */
    Further documentation lists SQLITE_ERROR as "This return value indicates that there was an error in the SQL that was passed into the sqlite_exec."
    Question 1:
    Why is BDB-SQLITE raising a generic errorcode "SQLITE_ERROR" when we have to abort a transaction and start all over again?
    While running my test application under intensive load, I have never gotten SQLITE_ERROR. I have gotten SQLITE_LOCKED and occasionally SQLITE_BUSY which is being handled in my code.
    Question 2:
    Can someone please confirm whether is this indeed is the expected behaviour?
    Thank you for your time.

    The behavior described in the white paper only applies to Berkeley DB version 5.0, versions 5.1 and beyond do not have this behavior.
    In DB-5.0 SQLITE_ERROR is returned when you attempt to use an explicit transaction that has already returned SQLITE_LOCKED. The reason for this is because in BDBSQL (as opposed to SQLite) SQLITE_LOCKED is returned when a transaction is forced to give up its locks because it has entered a state of deadlock with another transaction. Because the transaction has lost its locks it is invalid and cannot be used anymore other than to abort it, that is why SQLITE_ERROR is returned if you continue to use the transaction. In DB-5.1 and beyond SQLITE_LOCKED means only the last operation lost its locks and has been rolled back, the transaction is still good and can still be committed or be used to perform other operations.
    I hope this clears up your confusion.
    Lauren Foutz

  • When i add menu bar in my user interface gives me error that this handle is not a panel handle(return value -42)

    i have 3 panels in my application and parent panel is displayed first then i display other two panels which come to the front then on entering correct password i discard the child panel and then you can see parent panel , but there is an issue when i add menu to my parent panel i dont know whats wrong when i add menu bar in my user interface (parent panel)  gives me error that this handle is not a panel handle(return value -42) for a child panel. when i dont open and display child panel then its fine , and even without menu added to my parent panel all my panels and my application works perfactly

    Hello smartprogrammer,
    some more informations are needed in order to properlu help you in this situation:
    - Are you adding menus dynamically at runtime or in the UIR editor? If dynamically: how are you loading the menu bar?
    - Are you dynamically tailoring the menu bar at runtime (adding or deleting menu items, dimming / undimming some of them or checking / unchecking)?
    - Can you post the code where you are getting the error, documenting variables and scope (local to the function, global to the source file, global to the project)?
    You can look at uirview.prj example that ships with CVI for an example of LoadMenuBar (the exampl eis in <CVI samples>\userint folder): in that project, the menu bar is shown as a context menu when you right-click on a tree element (see DeferredMenuCB callback).

  • How to handle return values in AppleScript

    Warning: AppleScript newbie on the loose without adult supervision.
    I have an Omnis Studio app that calls an AppleScript that in turn invokes a couple of shell commands. As an aside, I don't believe Omnis Studio can invoke a shell script directly without other complications.
    What I would like to do is capture the return code and/or any stdout from the shell commands in the AppleScript, then pass that result out as a return value from the AppleScript.
    Q1. How does one hold the return values, exit code, stdout, etc. of a shell script in AppleScript?
    Q2. How do I tell AppleScript to pass the results back to the calling routine?
    Examples, links to documentation, etc, will be gratefully accepted.

    There is a whole forum for just Applescript here:
    http://discussions.apple.com/forum.jspa?forumID=724

  • JDBC - how to handle insert that returns value (bind?)

    Hi,
    I'm trying to do an insert into a table in an Oracle database with an auto-incrementing primary key (using a trigger and sequence) and I need to retrieve the value after the insert. From SQL*Plus, I'd enter:
    var id number;
    INSERT INTO mytable (name) VALUES ('foo') RETURNING id into :id;
    whereupon if I do "print id", I get the value of the id field from the newly-inserted record.
    The big question is how to achieve the same thing using JDBC. I've been flailing around all morning trying to figure it out and suspect it has something to do with using a CallableStatement instead of a PreparedStatement, but all of the examples I've seen so far only deal with calling stored procedures instead of raw SQL, and they all omit the part where some variable is bound to the resultset.
    Assuming I want to have the Java variable (int? Integer()?) "newId" set to the value being returned by the SQL statement as "id" (or ":id"?), what do I need to do between getting the connection and looking at "newId" to see what the value returned by the statement is?
    ie,
    Connection conn = db.connect();
    int newId;
    // show me what I need to do here
    System.out.println("The id of the newly-inserted record is:");
    System.out.println(newId);Thanks!

    This is untested:
    use the executeUpdate() method from the Statement. The return value will be your result from the RETURNING id portion of your SQL statement, if not then you'll probably have to do a seperate select or/and explicit return to get the value back from SQL.

  • Unable to capture return values in web services api

    At the time of login to web services if my server is down ,
    it returns following error :
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
            at java.lang.String.substring(String.java:1438)
            at java.lang.String.substring(String.java:1411)
    I want to capture this error so that i can try another server to login. how do i capture this error
    Another place where i want to capture the return Value is when i look for a report on the server
    rh = boBIPlatform.get("path://InfoObjects/Root Folder/"src_folder"/" + reportName +
                               "@SI_SCHEDULEINFO,SI_PROCESSINFO" ,oGetOptions);
    oInfoObjects = rh.getInfoObjects();
    CrystalReport = (CrystalReport)oInfoObjects.getInfoObject(0);
    Here if the report is not there on the server , it returns a null handler exception.
    but if i try catching it by checking my responsehandler is null  like rh == null  it does not catch it.
    Any help will be appreciated
    thanks
    Rakesh Gupta

    Ted : i have two cases
    1)   server = server_st.nextToken();
        providerURL = "http://"server"/dswsbobje/services";
        sessConnURL = new URL(providerURL + "/session");
       Connection boConnection = new Connection(sessConnURL);
       Session boSession = new Session(boConnection);
      EnterpriseCredential boEnterpriseCredential = new    EnterpriseCredential();
                  boEnterpriseCredential.setLogin(userid);
      boEnterpriseCredential.setPassword(pwd);
      boEnterpriseCredential.setAuthType(auth);
    SessionInfo boSI = boSession.login(boEnterpriseCredential);
    I have got a list of servers running web servcies stored in my tokens. when i pass the first server name say " test:8080" and that server is down , i want to catch somewhere in the code above that it did not get the connection so that i can loop back and try with the second server say test1:8080
    This is for failover purposes.
    at present when i was trying to capture return value of boSI it  breaks giving the error
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1438)
    at java.lang.String.substring(String.java:1411)
    2nd case :
    I am geeting reports from the server and scheduling them:
    i run the following code which works fine if reports is there
    rh = boBIPlatform.get("path://InfoObjects/Root Folder/"src_folder"/" + reportName +
    "@SI_SCHEDULEINFO,SI_PROCESSINFO" ,oGetOptions);
    oInfoObjects = rh.getInfoObjects();
    CrystalReport = (CrystalReport)oInfoObjects.getInfoObject(0);
    Here if  the  report  is not there on the server  then i should be able to catch from the response handle rh that it has got a null value.
    but rh does not return a null value 
    the code ultimately throws a null handle at the following line
    CrystalReport = (CrystalReport)oInfoObjects.getInfoObject(0);
    i am not able to catch the null value there also.
    hope you got my issue.

  • How do I handle NULL returns from prepared statement?

    Thanks in advance to all those who respond. As a beginner with Java/JSP/JDBC, I need all the help I can get!
    Here's the problem...
    I'm using a prepared statement in JSP to query a MySQL database.
    If there is a value to return, everything works properly.
    If the query returns a NULL (empty set) value, I get the following error:
    javax.servlet.ServletException: Before start of result set
    Here's the code (no negative comments please...I know I'm violating some conventions! I'll restructure it later. Right now I just need help with handling the NULL case):
    <%
    Driver DriverAppt = (Driver)Class.forName(MM_test_DRIVER).newInstance();
    Connection ConnAppt = DriverManager.getConnection(MM_test_STRING,MM_test_USERNAME,MM_test_PASSWORD);PreparedStatement StatementAppt = ConnAppt.prepareStatement("SELECT lastname FROM appts_pid1 WHERE user_id = " + Recordset1__MMColParam + " AND year = " + yy + " AND month = '" + months[mm] + "' AND date = " + dates[dd] + " AND appttime = '16:15:00'");
    ResultSet Appt = StatementAppt.executeQuery();
    boolean Appt_isEmpty = !Appt.first();
    boolean Appt_hasData = !Appt_isEmpty;
    Object Appt_data;
    int Appt_numRows = 0;
    %>
    Thanks for the help!!!

    I think I have a better handle on what's occurring here. To cut to the heart of the problem, I'm going to give a very simple example that illustrates what type of error handling I need.
    HERE'S THE EXAMPLE:
    Let's say that I have a database of users. There are only two columns in the database: user_id and lastname. There are only 2 users, user_id "1" has lastname "Jones" and user_id "2" has lastname "Smith".
    I built a very simple web interface that let's a user enter a number to see if there's a lastname associated with that record. The user has no way of knowing if the user_id exists or not, so they may or may not enter a valid number.
    If the user enters a valid user_id (in this case "1" or "2"), then the correct lastname is displayed. If the user enters an invalid user_id (in this case, anything other than "1" or "2") then I get the same "Before start of result set" error that I'm getting in my real application.
    So, the question is: WHERE IN THIS CODE WOULD I HANDLE THE RETURN OF AN EMPTY SET?
    The goal here is to have the sentence say "The user's lastname is .", basically returning null. If there has to be a value, then have the last sentence say "The user's lastname is unknown."
    If you can solve this simple example, you'll have also solved the problem with my main application!!!! :-)
    Here's the example code:
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <%@ include file="Connections/example.jsp" %>
    <%
    String Recordset1__MMColParam = "1";
    if (request.getParameter("user_id") !=null) {Recordset1__MMColParam = (String)request.getParameter("user_id");}
    %>
    <%
    Driver DriverRecordset1 = (Driver)Class.forName(MM_example_DRIVER).newInstance();
    Connection ConnRecordset1 = DriverManager.getConnection(MM_example_STRING,MM_example_USERNAME,MM_example_PASSWORD);
    PreparedStatement StatementRecordset1 = ConnRecordset1.prepareStatement("SELECT * FROM test_table WHERE user_id = " + Recordset1__MMColParam + "");
    ResultSet Recordset1 = StatementRecordset1.executeQuery();
    boolean Recordset1_isEmpty = !Recordset1.next();
    boolean Recordset1_hasData = !Recordset1_isEmpty;
    Object Recordset1_data;
    int Recordset1_numRows = 0;
    %>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <form action="test.jsp" method="get" enctype="application/x-www-form-urlencoded" name="form1" target="_self">
    <p> Submit a user id and a lastname will be displayed.</p>
    <p>
    <input type="text" name="user_id">
    <input type="submit" name="" value="Submit">
    </p>
    </form>
    <p>The User's lastname is <%=(((Recordset1_data = Recordset1.getObject("lastname"))==null || Recordset1.wasNull())?"":Recordset1_data)%>.</p>
    </body>
    </html>
    <%
    Recordset1.close();
    StatementRecordset1.close();
    ConnRecordset1.close();
    %>
    A huge "THANK YOU!!!!" to all those who've helped me here!!!

  • How to get return values from task flow in af:region ?

    Hi!
    I'm working with a taskFlow that is rendered inside a popup using the "popup inside a region pattern" (http://www.oracle.com/technology/products/adf/patterns/popupregionpattern.pdf), but now this taskFlow has an input parameter and a return value definition. So the question is how to get a value returned by this taskFlow thas is called inside a region?
    Any suggestion?
    Thanks in advance!

    Hi,
    write the value to a shared memory scope like session and read it in the regionNavigation listener. If you follow the paper you refer to then the listener determines of the viewId is null, this a return happens. It wuld then look in the memory scope for the return value.
    Another option would be to use an object that you pass as an argument to the task flow you open in the popup. Then you change the object you passed in, which then makes the return information available in teh calling flow. The object you pass in would have to be in a shared scope too
    Frank

Maybe you are looking for

  • How can I create JScrollPane in my swing application with scroll bars movin

    Hi, How can we create scrollpanes moving with scrollbars.I tried many times with custom layout.but it does not work if i set custom layout.I hope that I will get my problem solved. Thanks and Regards, Rameh RK

  • My dad deleted quicktime!

    hey my dad deleted quicktime and now my itunes wont open and it says,"itunes required files are missing". also my dad tried the system restore and that didnt work either. i tried deleting itune and reinstalling it but still wont open. i dont know wha

  • TS3694 i cant restore my iphone 3g

    please help i cant restore my iphone 3g and i also forgot my password..

  • Debtors Aging - Journal Entries

    Hi Experts, I need some advice regarding omitting Journal Entries from a Debtors Aging report, particularly fluctuation journals that don't reflect a value on the debtor statement. Any comments will be highly appreciated. Regards, Lebo

  • GTX 880M downclocking for no apparent reason???

    Whenever I am playing a game, I notice that my GPU clock speed is always under default clock rate of 954mhz. I know it is not a overheating problem since both my gpu and cpu stays around 75C . The GPU is showing 99% load when running rome 2 benchmark