Retreive int variable from other pages.

Hi,
My program is something like this:
Content.jsp
<script type="text/javascript">
function clicked2()
var x2;
for (var i = 0; i < form1.radio.length; i++)
if (form1.radio.checked)
x2=(form1.radio[i].value );
document.form2.hiddenTextBox.value = x2;
</script>
<%int i=0;
for(int l=1;l<=(Ress.size()/4);l++){ //Ress is my vector of results
%>
<tr>
<td width="10%">
<form method="get" name="form1" action="Update.jsp">
<fieldset>
<input type="radio" name="radio" value="<%=l%>">
</fieldset>
<input type=submit name="submit" value="Update" onclick="clicked2()">
</form>
<br><br>
<form name="form2" method="get" action="content.jsp">
<input type=submit name="submit" value="Delete" onclick="clicked2()"><br>
<input type="hidden" name="hiddenTextBox"><br>
</form>
<br>
<% int y2 =0;
if(request.getParameter("submit") != null){
y2 =Integer.parseInt(request.getParameter("hiddenTextBox"));
session.setAttribute("num",new Integer(y2));
//For deleting data
String Result="";
Result=mb1.deleteRow(y2);
if (Result.trim().toLowerCase().equals("deleted")){
out.println("Deleted from the database");
}else{
out.print(Result);
}%>
update.jsp
<%Integer i1=(Integer) session.getValue("num");
int i2=Integer.parseInt("num");%>
<td width="65%">
<input type=text name="textno" value="<%=i2%>">
</td>
<%String first=request.getParameter("textfirst");
String middle=request.getParameter("textmiddle");
String design=request.getParameter("textdesig");
String dept=request.getParameter("textdept");
String Result="";
Result=mb1.Updating(first,middle,design,dept);
if (Result.trim().toLowerCase().equals("done")){
out.println("Updated");
//response.sendRedirect("content.jsp");
}else{
out.print(Result);
}%>
I am getting null value error when I click on update button for update.jsp.I know it's a looooong one.Sorry for taking u r time.Plz help. I am just submitting the abstract.

"private static double area (int radius, final double pi)"
final double pi? as the method parameter? ROFLHAHAHAHAHAHAHAHAHAHAHA
That made my day.
As for your question, make range_1 a global variable, in other words, declare it outside your main method
Something like
public class gary{
int range_1;
public static void main (String afgfg[]){
range_1=//something;
private static double area (int radius)
radius = range_1
return radius * radius * 3.14

Similar Messages

  • Importing variables from another page in jsp

    Hey.
    I want to make two pages. I want the first page to include the variables from another page or POJO.
    I did this but i cant use the variables in index.jsp without initializing them first. But when I initialize them i get an error when trying to initialize them two times.
    if i use the variable in index without saving i get an error in eclipse.. but it works if i save and deploy.
    Is there any way to make eclipse see that i have imported the variable?
    The pages look something like this:
    index.jsp
    <%@ include file="extra.jsp" %>
    Print the number from the extra page
    <%= number %>extra.jsp
    int number = 32;I plan using this in a much greater system so I would appreciate any help.

    I'm having the same problem.
    Would be nice if somebody could help us.

  • How can I display de last items of a region from other page in Portal?

    I want to display de last five items (f.e.) included in a region (with attributes created) from other page. I've tried using custom search, but it also shows the attribute names, and I want show the attribute values (I don´t know how can I format these attributes).
    Thanks a lot.

    How can I display the last items of a region from other Oracle Portal page?

  • When Publishing to BC, images get swapped around from other pages

    When i am Publishing my muse file to Business Catalyst, all my images get swapped around from other pages, both in slideshows and placed images, how do i get it to stop doing this! In preview mode the images are where i want them!
    This is one of my pages with the slide show with the correct image
    This is the image that is appearing in its place within the slide show which is from another page within my site!
    I have tried to look through each page and re publish the site which is working for some pages but then makes others worse!

    Check out Apnewbie's page on publishing errors. See if any of the suggestions help your particular situation....
    http://web.mac.com/mark8heaton/iWeb/PublishErrorsHelp

  • Page with Information from other page

    I need to do a page where it shows information from other page.
    By example,I want that my page must a banner with the bursatil information.
    How can I do that?
    Thank by any idea.
    null

    So is anyone actually here to help with problems? What's the use of just seeing how many other people experience the same issue? Hello? I'm still having this problem with Firefox...

  • How to populate a filter field in one page with the value from other page

    Take the classic report with form application.
    on page 1 (report) I have a filter (dbname) for the records that will appear in the report. Say that, I enter "ap02" in the filter and all records where dbname starts with "ap02" will display. It works ok.
    Then I click on "create" button and page 2 appears. I enter all fields except the dbname. This field is generated, at "pre-insert trigger on the table".
    What I want is when I press the button "create" on page 2 to pass the value of the generated dbname field into the filter in page 1 so when that page refreshes I will have only one record on the report page (1). I understand that the dbname at the page 2 level still empty because it is generated by the trigger. How do I have access to that info to populate the filter.
    Thanks for your assistance

    Joe - Work backwards from the value generated during the execution of the trigger. You have the value there so you could save it into a package variable right then (create a package with a variable and assign the value to the variable). Then create a process on the page (after the DML process) to assign the value of your package variable to a page item. Then in the branch back to page 1, pass the item. (Or without messing with the branch, the process could simply assign the package variable directly the the page 1 item -- :P1_ITEM := my_package.my_var; ).
    An alternative would be to use the "returning into" feature of DML to capture the PK of the created record into an item. Then the next page process could use the PK to fetch the new row and get the dbname value for passing to page 1.
    Another option would be to update session state directly in the trigger.
    Scott

  • Read variable from other method

    i am coding a method which required a reading from a variable in another method.
    what's the syntax for getting the variable???
    I tried.....
    ++++++++++++++++++++++++++++++++++++++++++++++++++
    public static void main (String[ ]args)
    range_1
    private static double area (int radius, final double pi)
    radius = range_1
    return radius * radius * pi
    ++++++++++++++++++++++++++++++++++++++++++++++++++
    but it doesn't work

    "private static double area (int radius, final double pi)"
    final double pi? as the method parameter? ROFLHAHAHAHAHAHAHAHAHAHAHA
    That made my day.
    As for your question, make range_1 a global variable, in other words, declare it outside your main method
    Something like
    public class gary{
    int range_1;
    public static void main (String afgfg[]){
    range_1=//something;
    private static double area (int radius)
    radius = range_1
    return radius * radius * 3.14

  • Automatic Row Processing - Preset a value with value from other page

    Hi everybody,
    I have created a form on a table with report. I added a dropdown field to a sidebar region on the first page the groups and selects only a couple of these entries. (Think: only people for the department selected in the drop down field). Now when I click on the normal create button the id field for the department should be filled automatically with the value from the page before, where something was already selected in the drop down field. The id field is a hidden field on the actual create page. Maybe it is not working because the field is linked to the database column to make the automatic row processing work or something. I tried computions on both pages and setting the values. Nothing seems to do the trick.
    Any help would be greatly appreciated.
    Thanks,
    Henrik

    Hi,
    these are the values I currently see:
    108 14 P14_SELECTEDSS Display as Text (escape special characters, does not save state) No
    108 14 P14_CHARACTERISTIC_ID Hidden and Protected Reset to Null No
    108 14 P14_SHAREDSERVICE_ID Text Field 30 Inserted No
    108 14 P14_CAPTION Text Field No
    108 14 P14_CATEGORY_ID Select List No
    108 14 P14_WEIGHING Text Field No
    108 14 P14_DESCRIPTION Textarea No
    I also have to say that I deleted the computations I created earlier again cause they did not work and I had the same values for these variables. I am trying to (pre)set P14_SHAREDSEVICE_ID to P13_SELSS when I click the create button on page 13.
    Thanks again,
    Henrik

  • Accessing public variables from other classes

    Probably a simple questions, but how can I access a variable from another class. My exact situation is as follows.
    A class called WorldCalender has a variable which is defined: public int hour; (the value is given to it elsewhere).
    I want to access this variable and increase it by one in a subroutine in the class Hour. In this class I have put: WorldCalender.hour++; but it doesn't seem to work. How should I do it?

    don't expose the hour variable at all.
    have a method eg addToHourBy( int hrs )
    Probably a simple questions, but how can I access a
    variable from another class. My exact situation is as
    follows.
    A class called WorldCalender has a variable which is
    defined: public int hour; (the value is given to it
    elsewhere).
    I want to access this variable and increase it by one
    in a subroutine in the class Hour. In this class I
    have put: WorldCalender.hour++; but it doesn't seem to
    work. How should I do it?

  • How to access variables from other class

        public boolean inIn(Person p)
            if  (name == p.name && natInsceNo == p.natInsceNo && dateOfBirth == p.dateOfBirth)
                 return true;
            else
                 return false;
        }//returns true if Person with same name/natInsceNo/dateOfBirth as phello,
    here am trying to compare the existing object with another object.
    could you please tell me how to access the variables of other class because i meet this error?
    name cannot be resolved!
    thank you!

    public class Person
        protected String name; 
        protected char gender;      //protected attributes are visible in the subclass
        protected int dateOfBirth;
        protected String address;
        protected String natInsceNo;
        protected String phoneNo;
        protected static int counter;//class variable
    //Constractor Starts, (returns a new object, may set an object's initial state)
    public Person(String nme,String addr, char sex, int howOld, String ins,String phone)
        dateOfBirth = howOld;
        gender = sex;
        name = nme;
        address = addr;
        natInsceNo = ins;
        phoneNo = phone;
        counter++;
    public class Store
        //Declaration of variables
        private Person[] list;
        private int count;
        private int maxSize;
    //constructor starts
        public Store(int max)
             list = new Person[max];//size array with parameters
             maxSize = max;
             count = 0;
        }//end of store
    //constructor ends
    //accessor starts  
        public boolean inIn(Person p)
           return (name == p.name && address == p.address && natInsceNo == p.natInsceNo);
        }//returns true if Person with same name/natInsceNo/dateOfBirth as phope it helps now!

  • How do you pass a variable from one page to another thru a button

    I have a page that has a button that goes to another page and allows the user to create a new record related to the data on the previous page.
    The first page is a master, while the second page is a detail. I need the primary key from the first page to update a column in the detail page.
    How do I get the primary key in the second page and how do in put the data in the correct column?

    Hi Nielsen,
    The master detail form should handle everything for you already...Select all rows in each table but only display the records besides the primary keys. Try creating a new master-detail form with this idea, don't bother trying to change some other page.
    Mike

  • Fill Variable from other variable

    Hi all,
    I 'm using a characteristic structure in my BEX report.
    It has two selection.
    In one selection I 'm using a variable.
    In second selection I want to use a variable that get data  from the firt one.I mean I want to fill a variable from the other one at query runtime.
    How can I handle it?
    Thanks.

    Sample code....to copy values from variable "ZFISPER" to variable "FST_PERI".
    WHEN 'FST_PERI'.
    DATA : WA_FPER LIKE LINE OF I_T_VAR_RANGE,
           L_S_RANGERFPER TYPE rrrangesid.
    DATA : L_FPR TYPE rrrangesid-LOW.
    *break-point.
    CLEAR : WA_FPER,L_S_RANGERFPER.
    IF i_step = 2.
       LOOP AT i_t_var_range INTO WA_FPER WHERE vnam = 'ZFISPER'.
            EXIT.
       ENDLOOP.
       IF sy-subrc EQ 0.
           CONCATENATE WA_FPER-LOW+0(4) '001' INTO L_FPR.
       ENDIF.
          L_S_RANGERFPER-LOW = L_FPR.
          L_S_RANGERFPER-SIGN   = 'I'.
          L_S_RANGERFPER-OPT    = 'EQ'.
       APPEND L_S_RANGERFPER TO e_t_range.
    ENDIF.
    Srini

  • How do I carry over database variables from one page to another?

    I have a MySQL database displayed in a table on one page, with a link in each row pointing to a DETAILS.php page where I want to show the end-user all the details of that record or line item in a different format. After I link to the new page, how do I address the variables for "that particular record" clicked on in the 1st page? Will the system automatically knew which record from the table row I linked from?

    lesliebrownadobe wrote:
    I have a MySQL database displayed in a table on one page, with a link in each row pointing to a DETAILS.php page where I want to show the end-user all the details of that record or line item in a different format. After I link to the new page, how do I address the variables for "that particular record" clicked on in the 1st page? Will the system automatically knew which record from the table row I linked from?
    Each record in your database should have a 'unique' identifier (primary key) tying the record to it.
    You then pass that 'unique' identifier to the details page in the link which you create using php to loop through each record found in the database, which presumably you have already done.
    <a href="details.php?id="<?php echo $row['id']; ?>
    On the details page you then use php to get the 'id' of the record passed to the page via the link:
    $id = $_GET['id'];
    Once you have the id you are in business and can create a mysql query of the database to get the record associated with the id
    SELECT * FROM table WHERE id = '$id'
    'id' being the 'unique' field in the database that identifies the records and '$id' being the variable passed from the link

  • Use of variables from other class

    hallo,
    i have two classes A and B
    i would like to access a variable of the class B out of A class
    without class A extends B or
    A classA = new A();
    to use
    i attempted it with a constructor
    class A{
        B klb;
        public A(B b1){
        this.klb = b1;
       int a;
       a= klb.varausB;
    }with that I get, however, a NullPointerException
    in a similar form i saw it already once and it functioned
    somebody can help me?

    that is it what I mean
    public class ClassA {
    ClassB clb;
    public ClassA (ClassB cb){
    this.clb = cb;
    public static void main(String[] args) {
    System.out.println("Var from class B:
    class B: "+clb.varb1);// there is an error, i know
    but how it is right?
    public class ClassB {
    public String varb1 ="var b1";
    }nevertheless so similarly it should function, or?So if you create an instance of ClassA, clb will be initialized. But you don't do that in main. Hence your errors:
    1) You're not calling the constructor, so clb is null
    2) You're trying to access an instance variable without having an instance, so clb is not only null, it actually doesn't exist.
    public static void main(String[] args) {
      Class A myA = new ClassA();
      System.out.println("Var from class B: "+ myA.clb.varb1);
    }You're outside of any object, ehnce you need to address clb through an instance of ClassA.

  • How do you use the windows User32.dll Library functions to read variables from other applications that are running

    I am trying to read a text box from a programme running at the same time as my Labview application using calls to the Windows
    User32.dll. I believe I need to find the window handle for the 'form' containing this text string and use this together with
    various other defined input variables to access the sting.
    I have no experience of using this 'Call Library Function Node', but have an understanding of the 'C' programming language. Does anyone have
    example Labview code showing how this might be done.
    Thanks

    If you're trying to access information that's being displayed in the window of another application and that application has no ActiveX interface, then yes, Windows calls can be used. There's a very good example on calling DLLs that ship with LabVIEW. Open the Example Finder (Help->Find Examples) and switch to the Search tab. Enter "Call" in the search box and open the VI "Call DLL". Run the VI, select any of the examples, and click the "Open Example VI..." button. That shows you how to call a DLL.
    Now, given that you have no experience in calling DLLs, have only an "understanding" of C (which to me means you have never written something like a DLL), and don't seem to know that much about what Windows functions you may need, you're going to find this route pretty difficult, especially since you have to deal with Windows API calls, which are not always that easy to do from LabVIEW.
    Let me propose an alternate solution. Go over to http://www.autoitscript.com/autoit3/ and download AutoIt. This is an automation tool that allows you to automate just about anything you want. It has an ActiveX interface that you can call from LabVIEW. I've attached an example VI that shows you how to use it to get the value of a text box from one of the tabs in the computer "System Properties" control panel applet.
    Attachments:
    AutoIt Example (v7).vi ‏25 KB

Maybe you are looking for