Variables declared in .JSPF flagged as error in .JSP

I am using version 11.1.1.2.0
On the website that I develop we make use of a few JSP segments (.jspf extensions). These segments declare variables that are used in the JSPs that include them. In this new version (11.1.1.2.0), those variables are now marked as an error with the message "Name <variableName> not found." In JDev 10.1.3, this was not an issue at all.
For example, the .JSPF would have:
String testString = "This is a test";The .JSP that includes the the above segment would make use of that, but testString would be highlighted as an error:
<html>
  <body>
    <%@ include file = "includedSegment.jspf"%>
    Hello World and <%=testString%>
  </body>
</html>This is does not cause any problems after deploying the site, but it is a nuisance seeing all the "errors" highlighted when there really isn't anything wrong. Is there a way to fix this problem?
Thank you.

This issue still has not been corrected as of JDEV 11.1.2.3.
If the included fragment (in my example) also includes stylesheets, then the references in that file appear to not be resolved correctly (design time), but work ok at runtime. So, the IDE would show warnings for things like:
Reference JSPError.jsp not found
Reference styles/MyApp.css not found
Reference js/utility.js not found
Then, the main page would have any errors for any static includes that introduce variables (and call methods on them), and don't have the styles displayed properly. This DEFINITELY worked in JDeveloper 10.1.3.4, as I am in the process of migrating a VERY old application (2002-2003) vintage and noticed all these errors in the JSPs, and corrected all of them in that version of JDEV. Now, in JDEV 11.1.2.3, I have a whole list of errors that shouldn't even appear. The <% @include file="page.jspf" %> directive is not fully functional as it was in the prior version.
Any help would be appreciated.
Eric

Similar Messages

  • Template declaration error when variable assigned is the same as variable declared

    Hi Fedor,
    In comm-central repository, when compiling mozilla/mfbt/Compression.cpp using -std=c++11, it results in an error as follows:
    "../dist/include/mozilla/CheckedInt.h", line 400: Error: Unexpected type name "T" encountered.
    "../dist/include/mozilla/CheckedInt.h", line 400: Error: value is not defined.
    "../dist/include/mozilla/CheckedInt.h", line 400: Error: No direct declarator preceding ">".
    "../dist/include/mozilla/CheckedInt.h", line 400: Error: A declaration does not specify a tag or an identifier.
    "../dist/include/mozilla/CheckedInt.h", line 400: Error: Default template argument cannot be specified on the definition of a class template member that appears outside of its class.
    "../dist/include/mozilla/CheckedInt.h", line 400: Error: Templates can only declare classes or functions.
    "../dist/include/mozilla/CheckedInt.h", line 413: Error: No primary specialization for partial specialization NegateImpl<T, 0>.
    "../dist/include/mozilla/CheckedInt.h", line 416: Error: Too many arguments for template mozilla::detail::NegateImpl<T>.
    8 Error(s) detected.
    After a check on the file CheckedInt.h, it was narrowed down to the following code that resulted in the failure (the variable assigned, isSigned is the same as variable being declared) :
    template<typename T, bool IsSigned = IsSigned<T>::value>
    struct NegateImpl;
    This code, however compiles without problems in gcc-4.8.
    A workaround was to use a different variable declared in the template (e.g. bool IsTSigned = IsSigned<T>). But I just wanted to be sure whether is this a bug in 12.4 Beta or whether coding rules in templates do allow this kind of declaration? Kindly advise. Thanks.
    Regards,
    Brian

    Hi Steve,
    The declaration made below is not valid when -std=c++11 is not used (it causes the same compile-time errors when using July Refresh):
    template<typename U> class IsSigned;
    template<typename T, bool IsSigned = IsSigned<T>::value>
    struct NegateImpl;
    So far, the workaround was to use a different variable declared in the template (e.g. bool IsTSigned = IsSigned<T>).
    Regards,
    Brian

  • Unexpected Fortran compiler behavior on variable declarations.

    There are several problems concerning Sun Fortran compiler for Linux, concerning variable declarations:
    (1) A variable can be declared two or more times within the same
    program scope. Surprisingly, the compiler accepts this, without any error or
    warning message. This is clearly a bug.
    (2) There is no warning message if a variable is used but never set, even if the -w4 flag is used. This is a serious bug.
    (3) There is no warning message if a variable is declared but never
    used.
    To illustrate the bugs, compile the following simple program:
    module fooModule
    implicit none
    public :: add
    contains
    function add(x,y)
    real, intent(in) :: x,y
    real :: unused ! This variable is never used and never set; no warning message.
    real :: add
    add=x+y
    end function add
    end module fooModule
    program TryProg
    use fooModule
    implicit none
    real :: x
    integer :: i
    integer :: i ! Duplicated declaration. The compiler accepts this!
    i=3
    print*,i
    print*,add(x,2.0) ! Variable x is used but not set; no warning message.
    end program TryProg
    EXPECTED BEHAVIOR:
    (1) Something like "ERROR: Duplicate declaration of 'i'" or "ERROR:
    Symbol 'i' already has basic type of INTEGER."
    (2) WARNING: Variable 'x' is used but not set.
    (3) WARNING: Variable 'unused' is never used and never set.
    ACTUAL BEHAVIOR:
    No error or warning messages; expected one error and two warnings.
    The bugs appear in all Fortran compilers for Linux, including latest release, SSX2.

    There are several problems concerning Sun Fortran
    compiler for Linux, concerning variable
    declarations:
    (1) A variable can be declared two or more times
    within the same
    program scope. Surprisingly, the compiler accepts
    this, without any error or
    warning message. This is clearly a bug.
    The bugs appear in all Fortran compilers for Linux,
    including latest release, SSX2.You have cited a number of constraint violations. The
    Fortran standard states
    A processor conforms to this standard if
    (3) It contains the capability to detect and report the
    use within a sumitted program unit of an
    additional form or relationship that is not
    permitted by the numbered syntax rules or
    constraints, including the deleted features
    described in Annex B;
    In English, this statement means that a conforming
    implementation must be able to detect and report
    syntax errors and constraint violations. It does not
    mean that it must detect and report them by default.
    Sun f95, like most other Fortran compilers, does not
    give errors or warnings for the use of common
    extensions by default. The option -ansi enables
    the compilation mode that reports such uses.
    For example, when I compile the program
    PROGRAM MAIN
    REAL X
    REAL X
    END
    with the option -ansi, I get
    REAL X
    ^
    "t.f", Line = 2, Column = 1: ANSI: Use of the tab character is an extension of the Fortran standard.
    REAL X
    ^
    "t.f", Line = 3, Column = 7: ANSI: "X" has been given the REAL attribute more than once. This is nonstandard.
    f90comp: 4 SOURCE LINES
    f90comp: 0 ERRORS, 0 WARNINGS, 0 OTHER MESSAGES, 2 ANSI
    The caret lines up with the identifer X in the output. The column
    number is given as column 7, because the letter X is the seventh
    character in the line.

  • Using a static variable declared in an applet in another class

    Hi guys,
    I created an applet and i want to use one of the static variables declared in teh applet class in another class i have. however i get an error when i try to do that...
    in my Return2 class i try to call the variable infoPanel (declared as a static JPanel in myApplet...myApplet is set up like so:
    public class myApplet extends JApplet implements ActionListener, ListSelectionListener
    here are some of the lines causing a problem in the Return2 class:
    myApplet.infoPanel.removeAll();
    myApplet.infoPanel.add(functionForm2.smgframeold);
    myApplet.infoPanel.validate();
    myApplet.infoPanel.repaint();
    here are some of the errors i get
    dummy/Return2.java [211:1] package myApplet does not exist
    myApplet.infoPanel.removeAll();
    ^
    dummy/Return2.java [212:1] package myApplet does not exist
    myApplet.infoPanel.add(functionForm2.smgframeold);
    ^
    dummy/Return2.java [213:1] package myApplet does not exist
    myApplet.infoPanel.validate();
    ^
    dummy/Return2.java [214:1] package myApplet does not exist
    myApplet.infoPanel.repaint();
    ^
    please help! thanks :)

    I don't declare any packages though....i think it just doesn't recognize myApplet for some reason..
    other errors i got compiling are:
    dummy/Return2.java [82:1] cannot resolve symbol
    symbol : variable myApplet
    location: class Return2
    updateDesc.setString(3, myApplet.staticName);
    I Don't get why i'm getting this error cuase they worked fine when myApplet was a standalone application, not an applet.
    myApplet is in the same folder as Return2 and it compiles properly.

  • Bind Variable popup when no bind variable declared

    I am writing a fairly complex SQL (FYI, I want to keep this all in one step and not split out with multiple sub-selects) and I am getting the bind variable popup and an error message ("The requested URL /apex/wwv_flow.show was not found on this server ") and I am not sure why and could definitely use some help. From what I see there is no issue with the SQL syntax written and when I try to break it down, everything goes well until the point where I write a case statement with an OR and checking for 'BLOCK'.
    The issue comes when using the bolded line.
    I am using "10g Release 2 (10.2)" and querying from the SQL commands area inside it.
    The goal is to identify the area of the court broken down by the x and y dimension, home and away team has different logic to be used and if it is a block there is different logic.
    Your help would be greatly appreciated, and I am leaning towards it is a bug in the SQL Commands section of the tool:
    The full query is below:
    case when E.YEAR IS NOT NULL then
    *(case when x_dimension < 12.5 then 'A' when x_dimension <= 25 then 'B' when x_dimension < 37.5 then 'C' else 'D' end ||*
    case when ((a.action_team=c.awayname3 and A.ACTION_TYPE = 'BLOCK') or (a.action_team=c.homename3 and A.ACTION_TYPE <> 'BLOCK')) then (case when y_dimension < 9.5 then '4' when y_dimension <= 19 then '3' when y_dimension < 28.5 then '2' when y_dimension <= 38 then '1' else '0' end) else (case when y_dimension > 84.5 then '4' when y_dimension >= 75 then '3' when y_dimension < 65.5 then '2' when y_dimension <= 56 then '1' else '0' end) end) else 'NA' end as COURT_LOC
    It would not allow to enter the full SQL but please know that there is no issue with any declaration of the columns.
    Edited by: user10615520 on Feb 29, 2012 10:29 AM
    It seems that it is an issue with the in house SQL client of XE as I downloaded SQL Developer and ran same query there and the result was no issues. Is anyone aware of a bug for something like this?
    Edited by: user10615520 on Feb 29, 2012 10:43 AM

    So I am running Oracle Database Express version 10g. When you login through the default web interface, there is a SQL command line option. When I utilize the SQL below, can't insert whole SQL statement for some reason it won't let me, in that SQL command line I get a pop up window asking about values for bind variables... But as you can see from the code below there is no declaration of a bind variable. I also get the error message from the original post.
    When I use the same query in Oracle SQL Developer, not express (mistake in previous note), the query runs without any issues.
    My question is if anyone is aware of the oracle database express sql command line module having a bug where this is occurring. When I remove the line below from the query it runs fine in the Oracle Database Express command line module.
    Thank you for your help, I hope this is clear.
    case when E.YEAR IS NOT NULL then
    (case when x_dimension < 12.5 then 'A' when x_dimension <= 25 then 'B' when x_dimension < 37.5 then 'C' else 'D' end ||
    case when ((a.action_team=c.awayname3 and A.ACTION_TYPE = 'BLOCK') or (a.action_team=c.homename3 and A.ACTION_TYPE <> 'BLOCK'))
    then
    (case when y_dimension < 9.5 then '4' when y_dimension <= 19 then '3' when y_dimension < 28.5 then '2' when y_dimension <= 38 then '1' else '0' end)
    else
    (case when y_dimension > 84.5 then '4' when y_dimension >= 75 then '3' when y_dimension < 65.5 then '2' when y_dimension <= 56 then '1' else '0' end)
    end) else 'NA' end as COURT_LOC

  • JAXB Flags an Error in XML Doc Related to a Choice of Elements

    With a fairly complex DTD, an error results when JAXB unmarshalls a valid XML document. Here is the relevant DTD fragment:
    <!ELEMENT Declaration (Variable+, (typeList | Drelation))>
    The elements Variable and Drelation are complex, and contain other elements. Element typeList contains only #PCDATA. If Varaible is followed by Drelation, everything is fine, but if Variable is follwed by typeList, then unmarshall reports the following error:
    Exception in thread "main" javax.xml.bind.UnrecognizedElementNameException: typeList
    I know there is not a real error, because I have validated the XML document against the DTD using Xeena, from IBM's Alphaworks.

    By way of additional information, I tried to circumvent the problem with the following change.
    <!ELEMENT Declaration (Variable+, DecType)>
    <!ATTLIST Declaration dpower (PowerSet) #IMPLIED>
    <!ELEMENT DecType (typeList | Drelation)>
    Now, each element is either a sequence or a choice, but not both. The result was the same problem. The unmarshall reports the same error when it gets to the DecType element, saying the typeList element is unexpected. Again, IBM's Xeena tool reports that the XML document is valid for the DTD.
    Here is the relevant XML fragment.
    <Declaration dpower="PowerSet">
    <Variable> members </Variable>
    <DecType> <typeList> Person </typeList> </DecType>
    </Declaration>
    Is this a JAXB error?

  • How do I stop ODI if my DOS BATCH file flags an error?

    I have a DOS batch file as the first step in my ODI package. How do I send a code to ODI to tell it that it has failed and to stop processing the rest of the package? I was told I could use an ODI variable to accomplish this but not sure how.
    Also, how do I pass a semaphore/flag an error in my DOS batch file to ODI ?
    Thanks in advance for your help.
    I tried to search for this info in John's blog: http://john-goodwin.blogspot.com/search?q=error
    but was not able to find it.
    :)

    In your package 1st step is OS Command then some other steps involved, right ?
    In that case you can have your package like this
    OS Command (first step) ---------OK--------------> 2nd step -------------------> 3rd step
    So your 2nd step will run only when the 1st step is successful, it will not start 2nd step as 1st itself has failed .
    Thanks,
    Sutirtha

  • Invalid variable declaration:  object 'TIMESTAMP' must be a type or subtype

    Message 1: ORA-06550: line 91, column 14:
    PL/SQL: ORA-06552: PL/SQL: Compilation unit analysis terminated
    ORA-06553: PLS-488: invalid variable declaration: object 'TIMESTAMP' must be a type or subtype
    ORA-06550: line 89, column 1:
    PL/SQL: SQL Statement ignored
    I'm getting above error message when i'm trying to define one cursor from a table which has a column with data timestamp(3) in a cursor i'm not even using a column with data type timestamp .( this tables i created by importing sybase tables into oracle )
    SELECT to_char(sysdate) -- trunc(act.date_posted)
    INTO v__Data
    from cedb.cr_ar_debit_activity act
    where rownum < 2 ;
    for testing purpose i even removed the cursor and make it shor to above query then also it dosent work and gave the above error . if you know the solution then please let me know . i think i've to do/change database settings but i'm not sure .

    the above code is not working but the following code is working if i open cursor from assiging select to variable , why this is happening .
    DECLARE
         v_A_REPORT_DT VARCHAR2(100);
    ls_sel VARCHAR2(900);
    i INTEGER := 1;
    TYPE dynamic_cur IS REF CURSOR;
    tb_test_cur dynamic_cur ;
    TYPE array_date_type IS TABLE OF DATE INDEX BY PLS_INTEGER;
    v1 array_date_type ;
    BEGIN
         v_A_REPORT_DT := '01-01-2007'/* VARCHAR2(2000) */;
    -- this one is not working
    SELECT to_char(sysdate) -- trunc(act.date_posted)
    INTO v_A_REPORT_DT
    from cedb.cr_ar_debit_activity act
    where rownum < 2 ;
    ls_sel := 'SELECT trunc(act.date_posted)
    from cedb.cr_ar_debit_activity act
    where rownum < 3 ' ;
    OPEN tb_test_cur FOR ls_sel;
    LOOP
    FETCH tb_test_cur INTO v1(i) ;
    EXIT WHEN tb_test_cur%notfound;
    dbms_output.put_line(to_char(v1(i)));
    i := i + 1 ;
    END LOOP;
    CLOSE tb_test_cur;
    END;

  • URGENT: problem with variable-declaration while precompiling

              Hi,
              i got a problem while precompiling my webapplication.
              i got some jsp-pages, each containing following code
              <%@ include file="/header.jsp" %>
              <% button = true; %>
              [...some code...]
              <%@ include file="/footer.jsp" %>
              The variable 'button' is defined in header.jsp and
              evaluated in footer.jsp. When i run through my application without precompiling
              it, there appear NO errors, but when i try to precompile my pages, the jsp-compiler
              reports an error in footer.jsp, because in footer.jsp is the 'button'-Variable
              used, but not defined and not included (because all other pages include footer.jsp)
              How can I tell the jsp-Compiler not to check for variable declarations, or what
              else can i do to work around this problem ?
              thanks,
              Dirk Bade
              

    Thanks for the sample. Changed it to look this way. Still getting the error message from above. Any clue?
    [ BTW: you can see the auto-fixits that Netbeans used to resolve the exception thrown errors from earlier.  Ugly ... I used Netbeans for the ease of interface generation, but I am spending a lot time chasing down little stuff like this. ]
    public class DesktopApplication1View extends FrameView {
        public DesktopApplication1View(SingleFrameApplication app) throws PortInUseException, UnsupportedCommOperationException, IOException, NoSuchPortException {
            super(app);
          initComponents();  //interface code follows this until the variables below ...
            String      defaultPort = "/dev/ttyS0";
            String      portName;
            ByteBuffer  asciiBytes = null;
            CommPort    commPort = null;
            byte[] h = new byte[asciiBytes.capacity()];
            asciiBytes.get(h, 0, h.length);
            CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(defaultPort);
                System.out.println("Default port" + defaultPort + "found.");
            if ( portIdentifier.isCurrentlyOwned() )
                System.out.println("Error: Port is currently in use");
            try {
                 commPort = portIdentifier.open(this.getClass().getName(), 200);
            } catch (NoSuchPortException e) {
            System.out.println("Whoops! Cannot identify the port.");
            }

  • Tab character in variable declaration

    Hello,
    I have a little problem with declaration of variables in scripts. I get an error when there is a TAB character between the variable name and its data type:
    VARIABLE var_name     number;
    Bind Variable "var_name     number" is NOT DECLARED
    This error occur only when I try it in SQL Developer - other tools accept it. Any suggestions how to get rid of this error?

    Couldn't find any prior bug for this, so I logged it:
    Bug 12409565 - TAB CHARACTER NOT RECOGNIZED AS WHITESPACE IN SQL*PLUS BIND VARIABLE DECLARATION
    It seems limited to SQL*Plus syntax, perhaps just the VARIABLE command, and does not replicate in PL/SQL blocks.
    Adding a blank after the tab works around the error, but won't be enough if the tab remains as part of the variable name.
    -Gary Graham, SQL Developer Team

  • How to avoid variable declaration dublication in a script?

    Hello to everyone!
    I have a business rule which calls twice same script. But in this sript there is a variable declaration (MethodOpl).
    Rule:
    FIX (&CashFlowPlanningMonths, &PlanningYear, {SelScenario}, {SelVersion})
        %Script(name:="Distribution 100",application:="workapp3",plantype:="Plan1");
    ENDFIX;
    FIX (Jan:Dec, &NextYear, {SelScenario}, {SelVersion})
        %Script(name:="Distribution 100",application:="workapp3",plantype:="Plan1");
    ENDFIX;
    Script:
    VAR MethodOpl = 0;
    FIX (@DESCENDANTS("TotalLocations"), "NoAnalytics", @DESCENDANTS("100000"))
      AmountByPay(
          IF ( NOT @ISMBR(@LIST("114100","115110","115120","115130")) )
            MethodOpl = "BegBalance"->WorkVersion->"NoFRC"->"DistributionByPay";
            IF ( MethodOpl == #Missing )
               MethodOpl = "NoLocation"->WorkVersion->"BegBalance"->"NoFRC"->"DistributionByPay";
            ENDIF;
            ... (some calculations)
          ENDIF;
    ENDFIX;
    If I try to validate rule I get error like this:
    An error occurred in: Rule:workapp3.Plan1.TestOTN
    A validation error was received from the Planning server 'http://ohp:80/HyperionPlanning/servlet/HspAppManagerServlet?appname=workapp3'.
    'Error:Переопределение имени переменной [MethodOpl]. Rule workapp3.Plan1.TestOTN'.
    Error text can be translated as "Error: Redeclaring variable name [MethodOpl]"
    Can you advice me how to avoid second declaration?
    May be somehow like this?
    #IF !DEFINED(MethodOpl)
      VAR MethodOpl;
    #ENDIF
    MethodOpl = 0;

    Try creating a separate script for variable declaration & declare all the variables inside it.Add this script as first statement in the rule
    SCRIPT:  "Var Declaration"
    VAR MethodOpl = 0;
    RULE
    %Script(name:="Var Declaration",application:="workapp3",plantype:="Plan1");
    FIX (&CashFlowPlanningMonths, &PlanningYear, {SelScenario}, {SelVersion})
    %Script(name:="Distribution 100",application:="workapp3",plantype:="Plan1");
    ENDFIX;
    FIX (Jan:Dec, &NextYear, {SelScenario}, {SelVersion})
    %Script(name:="Distribution 100",application:="workapp3",plantype:="Plan1");
    ENDFIX;
    remove the "MethodOpl" variable declaration from the script -"Distribution 100".

  • Binding done at variable declaration

    What is difference between
        int x;
        x=5;
    and
    int x=5;
    What are different binding takes place?
    How Binding differs in both the cases?
    Can anybody please tell me about it.

    Hello Tomasz,
    welcome in the SAP GUI Scripting forum.
    You add at first the SAP GUI Scripting API library as reference to your VBA project from the Tools menu.
    Now you can use this code with explicit variable declaration:
    Option Explicit
    Sub Test()
      On Error Resume Next
      Dim SapGuiAuto As Object
      Dim SAPGUIApp As SAPFEWSELib.GuiApplication
      Dim Connection As SAPFEWSELib.GuiConnection
      Dim Session As SAPFEWSELib.GuiSession
      Set SapGuiAuto = GetObject("SAPGUI")
      If SapGuiAuto Is Nothing Then
        Exit Sub
      End If
      Set SAPGUIApp = SapGuiAuto.GetScriptingEngine
      If SAPGUIApp Is Nothing Then
        Exit Sub
      End If
      Set Connection = SAPGUIApp.Children(0)
      If Connection Is Nothing Then
        Exit Sub
      End If
      Set Session = Connection.Children(0)
      If Session Is Nothing Then
        Exit Sub
      End If
      'Your Code here
    End Sub
    Good luck.
    Cheers
    Stefan

  • Netbean variable declaration help

    I've been trying to crank out yet another mortgage program. The problem I have is with the declaration of the following
    double loan = Double.parseDouble(loanField.getText());
    double rate = Double.parseDouble(rateField.getText());
    double years_due = Double.parseDouble(years_dueField.getText());
    I'm not quite certain if it's the declaration itself, or if I didn't set up the GUI properly. I've been tinkering with this for 3 days so I figured I'd ask for help. I can't seem to find a post that suitably answers my question. Any help would be appreciated. Here is the code. I'm using Netbean IDE 6.0.1 if that is of any use to you.
    * week2_herbieGUI.java
    * Created on August 1, 2008, 6:45 PM
    * @author  archon
    public class week2_herbieGUI extends javax.swing.JFrame {
        /** Creates new form week2_herbieGUI */
        public week2_herbieGUI() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
            loanfield = new javax.swing.JTextField();
            ratefield = new javax.swing.JTextField();
            years_duefield = new javax.swing.JTextField();
            jLabel1 = new javax.swing.JLabel();
            jLabel2 = new javax.swing.JLabel();
            jLabel3 = new javax.swing.JLabel();
            jButton1 = new javax.swing.JButton();
            PaymentLabel = new javax.swing.JLabel();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            setTitle("PaymentCalculatorGUI");
            loanfield.setName("loanField"); // NOI18N
            ratefield.setText("jTextField2");
            ratefield.setName("rateField"); // NOI18N
            years_duefield.setName("years_dueField"); // NOI18N
            jLabel1.setText("Principle Loan");
            jLabel1.setName("Principle Loan"); // NOI18N
            jLabel2.setText("Interest Rate");
            jLabel2.setName("Interest Rate"); // NOI18N
            jLabel3.setText("Years of Mortgage");
            jLabel3.setName("Years of Mortgage"); // NOI18N
            jButton1.setText("Calculate");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            PaymentLabel.setText("Monthly Payment");
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(22, 22, 22)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jButton1)
                            .addGap(31, 31, 31)
                            .addComponent(PaymentLabel))
                        .addGroup(layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel1)
                                .addComponent(jLabel2)
                                .addComponent(jLabel3))
                            .addGap(25, 25, 25)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(ratefield, javax.swing.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE)
                                .addComponent(loanfield)
                                .addComponent(years_duefield, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addContainerGap(180, Short.MAX_VALUE))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(18, 18, 18)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel1)
                        .addComponent(loanfield, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel2)
                        .addComponent(ratefield, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel3)
                        .addComponent(years_duefield, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(26, 26, 26)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jButton1)
                        .addComponent(PaymentLabel))
                    .addContainerGap(25, Short.MAX_VALUE))
            pack();
        }// </editor-fold>
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
          //gather necessary variables from user
            double loan = Double.parseDouble(loanField.getText());
            double rate = Double.parseDouble(rateField.getText());
            double years_due = Double.parseDouble(years_dueField.getText());
          //Variables derived from user input
            double rate_total = rate/100; //Converts interest rate to decimal form
            double rate_monthly = rate_total/12; //converts to monthly interest rate
            double payment_year = years_due * 12; //Number of payments during course of mortgage.
            double payment = (loan * rate_monthly) / (1 - Math.pow(1 + rate_monthly, - payment_year)); //Calculates monthly payment
            PaymentLabel.setText("Your monthly payment is $" +payment);
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new week2_herbieGUI().setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JLabel PaymentLabel;
        private javax.swing.JButton jButton1;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JTextField loanfield;
        private javax.swing.JTextField ratefield;
        private javax.swing.JTextField years_duefield;
        // End of variables declaration
    }

    ThousandSon wrote:
    Here is what the computer says:
    Cannot find symbol
    symbol: variable loanField
    location: class week2_herbieGUI
    Cannot find Symbol
    Symbol: method getText()
    location: class loanField
    And it says the same thing for rateField and years_dueFieldThank you for finally posting the error message--it didn't hurt a bit did it. Had you posted it in the first place you would have had your answer 6 posts ago and probably a lot more planely.
    Please take special note of how this autocode has been generated and especially close attention to naming conventions:
        // Variables declaration - do not modify
        private javax.swing.JLabel PaymentLabel;
        private javax.swing.JButton jButton1;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JTextField loanfield;
        private javax.swing.JTextField ratefield;
        private javax.swing.JTextField years_duefield;
        // End of variables declarationThere in lay your problems, please look this block of code over very carefully and compare it to the errors you are getting and the code you have cut based on this autocode.
    Look very very closely. The same error exists in every one of your problems. If that doesn't do it for you, then you can look in the initComponents method and how each of these variables are referenced there. Do you see the difference? (Hint: it is the error.)
    BTW: does it show that I really despise when someone chooses to use autogenerated code and then asks how to correct errors from using it--and especially when they don't want to give the exact errors so we don't have to fish through all of the autocode to find out what is happening?

  • Variable declaration in BEx - Business scenario's

    Hi,
        I need some documents about all kind of variable declaration with some example business scenarios in MM, FI-CO modules.
    will assign you a reasonable points
    Regards,
    Pooja.S

    Hi Pooja,
    The processing type of a variable may be varies from business requirement.
    In general we will use the processing type:
    Replacement Path : If you specify a variable as a characteristic value, you do not have to specify a text for the characteristic value right away. Instead, you can fill the text field dynamically and specifically for the characteristic that you use for the variable when you execute the query. To do this, define a text variable with automatic replacement.
    [http://help.sap.com/saphelp_nw70/helpdata/EN/bd/589b3c494d8e15e10000000a114084/content.htm]
    Authorisations: If the user belongs to Asia PAciffic region and he must see only details of his region then we can create a variable Region vt Processing type Authorisations so that he vl able to see only that region's data.
    [http://help.sap.com/saphelp_nw70/helpdata/EN/44/599b3c494d8e15e10000000a114084/content.htm]
    SAP EXIT: If you want to define a query that only ever displays the data from the current month, drag the delivered variable “current month” (technical name 0CMONTH) for the characteristic “calendar year/month” (technical name 0CMONTH) into the query filter.
    [http://help.sap.com/saphelp_nw70/helpdata/EN/f1/0a5702e09411d2acb90000e829fbfe/content.htm]
    Customer Exit: You want to use one characteristic value to calculate a second characteristic value. The InfoProvider only contains the calendar day. However, you now also want to display the cumulated value for the relevant period (beginning with the first day of a quarter) in a query.
    For the first day of the quarter, use a variable with customer exit processing. If you now enter the current calendar day (for example, 06/19/2000), a start date of 06/01/2000 appears in the customer exit, and the cumulated value of this period can be displayed.
    [http://help.sap.com/saphelp_nw70/helpdata/EN/f1/0a56f5e09411d2acb90000e829fbfe/content.htm]
    I hope this helps you.

  • Why can't I move a variable declaration from inside a Sub to the Declarations area?

    I'm writing an app and so far, so good. But I need wider access to an array defined in my "Form_Load" sub.
    Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    ' Assign checkboxes to an array.
    Dim Checkboxes() As CheckBox = {chkThumb01, chkThumb02, chkThumb03, chkThumb04, _
    chkThumb05, chkThumb06, chkThumb07, chkThumb08, chkThumb09, chkThumb10}
    Moving the declaration ("Dim Checkboxes()...") from "Sub frmMain_Load" up into the Declarations space just above it breaks my program. :(
    I tried putting it in a Module and that fails too. The ONLY place it work's is in Form_Load (it's not related to being an array because at least one standard integer variable declaration has this problem too.)
    I have other variables in the Declarations area that work fine (eg: "Dim bolChanges as Boolean"), but for some reason, I can't move others out into what
    should be a more global namespace.
    Anyone know what's going on? Thx.

    No, because this makes no difference.
    Background #1: If you do not write your own constructor (=Sub New), the VB compiler adds a default constructor. It contains a call to Sub InitializeComponent. In this Sub, the controls are created and assigned to chkThumb01 etc. You see it if you type "Sub
    New[Enter]":
    Sub New()
    InitializeComponent()
    End Sub
    Background #2: If you write
    Public Class Test
    Private values As Integer() = {1, 2, 3}
    End Class
    it is identical to
    Public Class Test
    Private values As Integer()
    Sub New()
    values = New Integer() {1, 2, 3}
    End Sub
    End Class
    As you can see, the assignments that you do to fields of the class in the declaration line are actually executed in the constructor (sub new).
    Now put both backgrounds together. Consequently, this code
    Public Class Form1
    Private buttons As Button() = {Button1, Button2, Button3}
    End Class
    is identical to this one:
    Public Class Form1
    Private buttons As Button()
    Sub New()
    buttons = New Button() {Button1, Button2, Button3}
    InitializeComponent()
    End Sub
    End Class
    Obviously, the assignment to variable "buttons" is done before the call to Sub InitializeComponent. At this point, variables Button1, Button2 and  Button3 are still empty (Nothing) because they will be set in Sub InitializeComponent. Consequently,
    the array buttons contains just {Nothing, Nothing, Nothing}
    In opposite, if the array buttons is set in the Load event, Button1, Button2 and Button3 have already been set before, Consequently, the array buttons correctly contains references to the three buttons.
    Armin

Maybe you are looking for