Variable not getting set?

'elo!
I have a slight problem when it comes to setting a variable. I guess it's some kind of variable-not-being-global-or-something-else-I-can't-figure-out-problem.
Anyway. What I have are two classes.
The first one is an extended JFrame that holds my GUI and some variables that I wanted to make sure every class could access. And that's what I thought I did.
Variable outside constructor, so that other methods can access it:
     String characterName = "";Methods modifying that variable.
     // Set char name
     public void setCharName(String name) {
          String characterName = name;
          System.out.println("Char. name: " + characterName);
     public String getCharName() {
          System.out.println("Char. name: " + characterName);
          return characterName;
     }When this class creates an instance of the other class a reference to the JFrame is passed to what is actually an extend JPanel. In that JPanel is a JTextField. When enter is pushed getText() grabs the text and sends it to pf.setCharName() (pf = parent frame). That works, the print gives me a correct result in the console. However when I do pf.getCharName() I only get the "Char. name: " output. The variable characterName is empty. (and it doesnt't return anything.)
So what am I doing wrong here? I'm stuck!
/Simon

   String characterName = "";The 'characterName' String has already been defined in the object
        // Set char name
     public void setCharName(String name) {
          String characterName = name;
          System.out.println("Char. name: " + characterName);
     }.In the 'setCharName' method, you are declaring another String 'characterName' again. This is considered as a local variable in the 'setCharName' method. That is the reason why it is not getting reflected in the getCharName method.
So, try this:
        // Set char name
     public void setCharName(String name) {
          this.characterName = name;
          System.out.println("Char. name: " + characterName);
     }Now, since characterName is no longer a local variable in the 'setCharName' method, it should get reflected in the getCharName method.

Similar Messages

  • Variable value is not getting set in BEx / WAD

    Hi,
    We have a WAD report where we have selection on Comp Code which is restricted to a variable Var1. In the same WAD, a button group is used to execute a Planning Sequence, it has a filter for Comp Code which is restricted to a mandatory variable Var2.
    Idea is unless the user selects a value for Comp Code in WAD selection screen(Var1), the button group to execute the Planning Sequence will not be visible. When this button group is visible and user clicks to execute the Planning Sequence, the value for Var2 is supposed to get the same value as Var1 since in the underlying BEx query of WAD, we have restricted Comp Code InfoObject with Var1 in Default Values region.
    This was working absolutely fine in BW 7.3. But recently we upgraded to BW 7.4 and now the value for Var2 is not getting set if user selects the value for Var1.
    Appreciate any help on this.
    Note: The issue will resolve if we use the same variable in BEx query as well as the Planning Sequence, but this is not feasible in our case.
    Thanks and Regards,
    Shravan Marathe

    Hi Suman,
    As the issue came up with the latest BW 7.4 upgrade, we are looking for a work around may be implementation of Notes instead of going for an alternative.
    Thanks and Regards,
    Shravan Marathe

  • Value is not getting set in messageTextInput item after PPR action

    Hi everyone,
    I have a page in which On selecting a value from a lov, the next messageTextInput item should be set to "dummy"(I am using setText() method for this). However its not getting set at that time . But if I apply the same code in click event of submitbutton, its getting set. i.e. some kind of page refresh event is required for this.
    Plz suggest me the way of achieving this through PPR.
    My code of controller is like this :
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am =
    (OAApplicationModule)pageContext.getApplicationModule(webBean);
    /* validation code for Preffered ordering Method LOV */
    if (pageContext.isLovEvent())
    String lovInputSourceId = pageContext.getLovInputSourceId();
    if(lovInputSourceId.equals("PreferredOrderingMethodLOV"))
    if(!selectedPrefferedOrderingMethod.matches("URL"))
    String v_ani = pageContext.getParameter("AribaNetworkId");
    if(!v_ani.matches("dummy") || v_ani.length()==0)
    OAMessageTextInputBean aribaNetworkIDTextInputBean =
    (OAMessageTextInputBean)webBean.findIndexedChildRecursive ("AribaNetworkId");
    String dummy = "dummy";
    aribaNetworkIDTextInputBean.setText(pageContext, dummy);//.setText(pageContext,"dummy"); // here its not getting set on page
    String s = aribaNetworkIDTextInputBean.getText(pageContext); // however its showing "dummy"here
    }

    Hi,
    OAMessageTextInputBean aribaNetworkIDTextInputBean =
    (OAMessageTextInputBean)webBean.findIndexedChildRecursive ("AribaNetworkId");
    String dummy = "dummy";
    aribaNetworkIDTextInputBean.setText(pageContext, dummy);//.setText(pageContext,"dummy"); // here its not >getting set on page
    String s = aribaNetworkIDTextInputBean.getText(pageContext); // however its showing "dummy"here
    In processFormRequest() method we should not change bean properties.
    Instead, achieve your requirement using
    row.setAttribute() method.
    -Anand

  • Page items not getting set upon login in APEX 4.0.2

    We just upgraded our APEX in development from 4.0.1 to 4.0.2.00.07. While testing found that in APEX developer, unless we press one of the buttons (Debug/View Debus/Show Edit Links) in the tool bar on the login page, the application/page items are not getting set to display the conditional items (page regions/buttons/Tabs etc,.) Could this be some setting within APEX Developer?
    But the display is fine when the application is run directly in a browser, as an end user.
    Is anybody else having this issue? We are holding off our production upgrade because of this issue.
    Any help is appreciated.
    Thanks
    Radhika

    Hi,
    Could you please explain what you mean by
    Running 4.0.2 version...need to know how to remove the pop-up login and go straight to welcome/splash page?Do you mean application builder or your application login page ?
    If you mean application builder, you can not remove login page. You need always login to builder.
    If you mean your own application then change authentication scheme
    http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/sec.htm#sthref2297
    Regards,
    Jari

  • Value not getting set in NETValue field in Oppurtunities

    Hi,
    I have requirement to
    make the "Net value"  field in Products assignment block  of new Oppurtunity editable.
    method GET_I_NETVALUE.
        rv_disabled = 'TRUE'.
    endmethod.
    by making rv_disabled = "FALSE" i am able to make it to editable, but i have an issue while entering some value to this field
    for eg: if I give 10.00 and  press enter its getting changed to 0.00. ( value is not getting set )
    Any suggestion will be highly appreciated.
    Regards,
    Sijo...........
    Edited by: sijokjohn85 on Aug 17, 2009 12:04 PM
    Edited by: sijokjohn85 on Aug 17, 2009 9:18 PM
    Edited by: sijokjohn85 on Aug 18, 2009 1:32 PM

    Thread closed

  • In solaris oracle env not getting set always i hv to compile .profile

    In solaris 10 intel version oracle ,listener everything is working but problem is in terminal for each session i hv to compile . .profile where is the exact problem ? why my profile is not getting set permanently.

    Dude wrote:
    Bash looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. (man page) In other words, it's not reading .profile if ./bash_profile or .bash_login exists. However, the OP might not be using bash.OK, I was wrong again, again, again today.
    I am going to quit while I am behind so as to not make it any worse.

  • [ADF] Focus not getting set on second level dialog/popup

    Hi,
    While working on a related bug, I've discovered that for every second level dialog/popup(a popup that is invoked from another popup), the focus does not get set to the second level dialog if the first component in that popup is an inputText, unless a user explicitly clicks on it. By focus I mean that on pressing tab, the fields on the previous popup still get selected/highlighted.
    This does not happen if the first UI Component is any other; everything else kept the same. I suspect this is an ADF bug; does anyone know of a workaround?
    Thanks,
    Ravikiran Sastry
    Edited by: 911228 on Jan 30, 2012 11:59 PM

    Hello,
    we are having the same issue using JDeveloper 11.1.1.4 and Internet Explorer 8.
    The code is really simple: just a regular popup with an inputListOfValues component inside. Open the popup, open the inputListOfValue's "Search and Select" popup and if you press the Esc key, the first one will be closed, while the "Search and select" popup will remain there.
    Jordi

  • Context attributes Not getting set

    Hi,
    I have created a Webservice model from a WSDL file, created a service controller and bound the same to the model. I have also created a view and bound my view to my controller.
    The problem I am facing right now is that certain fields of my request are not getting set.
    The structure of my context is as shown below
    Context
      |-OrderWS
          |- RequestNode
              |-NodeA
                 |-Item1
                 |-Item2
                 |-Item3
              |-NodeB
                 |-ItemA
                 |-ItemB
           |-ResponseNode
    Even though I have created Item 1,Item2,Item 3 elements of Node A as input fields in my View, they cannot be edited, when I run my application.
    Item1,Item2,Item3 have min occurance "0", max occurance "unbounded" , set in the WSDL file.
    Is there any way by which I can set these values?
    Why are only the Item1,2,3 fields not editable? (I have made sure that readonly =false,editable=true are set for these fields as they are for the other fields.)
    -Ashwini.

    Hello Ashwini,
    If I understand you correctly, your problem is, the input fields that you've bound to a model node is
    not open for editing. If yes then,I guess you are not setting the modelObject reference to the model node.
    So use this code in the appropriate method (<i>according to your requirement</i>) to make the input fields editable.
          I<yourView>.IOrderWSElement el
              = wdContext.nodeOrderWSElement()
                     .createOrderWSElementElement(new <i><b>correspondingInterface</b></i>());
         wdContext.nodeOrderWSElement().addElement(el);
             wdContext.nodeRequestNode().bind(new <i><b>correspondingInterface</b></i>());
             wdContext.nodeNodeA().bind(new <i><b>correspondingStructure</b></i>()());
    If this is not the exact problem, then please give an eloborate picture of the scenario.
    Bala

  • [ADF] Focus does not get set on a second level dialog/popup

    Hi,
    While working on a related bug, I've discovered that for every second level dialog/popup(a popup that is invoked from another popup), the focus does not get set to the second level dialog if the first component in that popup is an inputText, unless a user explicitly clicks on it. By focus I mean that on pressing tab, the fields on the previous popup still get selected/highlighted.
    This does not happen if the first UI Component is any other; everything else kept the same. I suspect this is an ADF bug; does anyone know of a workaround?
    Thanks,
    Ravikiran Sastry
    Edited by: 911228 on Jan 30, 2012 11:59 PM

    Hello,
    we are having the same issue using JDeveloper 11.1.1.4 and Internet Explorer 8.
    The code is really simple: just a regular popup with an inputListOfValues component inside. Open the popup, open the inputListOfValue's "Search and Select" popup and if you press the Esc key, the first one will be closed, while the "Search and select" popup will remain there.
    Jordi

  • Variable not getting updated by output from a PL

    We have a PL that has the same xsd element as both input and output. So we used the same variable for both input and output operations while invoking this PL assuming that the output from the PL will overwrite the data already present in the variable.
    But this is not happening rather the data is persisting in that the data that was there in the variable before the invoke is there after the invoke also and is not getting overwritten by the PL output data.Is there any properties to set to change this behaviour or will this not happen at all.

    did you check the audit trail for the response data? can you please file a SR and upload your bpel processs? could you please post your sr number?

  • Sy-batch is not getting set in background?

    Hi Experts,
    I have a scenario in which we are processing Inbound Idocs via standard FM to create EDI orders from the inbound Idoc data.
    We have a requirement in which we implemented enhancement for a Popup screen for user to select a particular material from the list of materials shown on the screen. While background instead of popup we are determining the record progmatically vai customer exit(Function module exit).
    The logic for foreground & background is perfectly fine but the problem is SY-BATCH value is not being set to "X" in background. So our background logic does not come into picture & IDOC fails in background.
    Just to analyze this issue , I have tried to store value of sy-batch in some variable & then put an infinite loop to check in background debugging(VIA SM50) whether that variable contains an "X" or not, That variable was not set to "X".
    Can anybody tell me is there any other way by which we can programatically distinguish whether something is running in foreground or in background?

    Hi,
    Also test the field sy-binpt ( Batch input ) which is set when a call transaction is made in the program. Usually the IDoc processing functions do a call transaction.
    Also at times the IDoc processing function sets a variable and exports it to the memory so you migh want to check for "export" statements in the IDoc processing function as well and import it in your program and test that imported variable.
    Br,
    Advait

  • Not getting sets for jsp:useBean bean when in request scope

    I have a JSF (JSP) page in which I have a bean that I declare using jsp:useBean.
    The bean implements Map. I have a h:inputText and an h:inputHidden with a value referencing the bean.
    The odd thing is that if in jsp:useBean, I set the scope to session, everything works as I expect. However, if I change the scope to request, the put method on the bean never gets called.
    Can anyone explain why this is happening?
    Thanks,
    ken clark

    Yes, I understand that old data I had is gone -- that is fine, I expect that.
    My question is, why do I not get calls on the put method of my Map implementation when the screen is submitted? (I have a breakpoint in the method in the debugger, so I know when I get hit.)
    If the scope is session, I get put calls (yes, the old data is there, it gets overwritten).
    If the scope is request though, I simply never see the calls made at all, and my application errors out for lack of data.

  • Copying or exporting an application - bug?  LOVs not getting set in reports

    Hi all, I apologize if this has been on here before, I thought I may have seen something about it before, but my search turned up empty.
    When I copy an application, or export/import it -- it seems all the LOV based items in my reports (IR or otherwise I think) don't get set. For example if I have a query returning a data value back as 1 or 2, and I have an LOV to translate that to 1 = Male, 2 = Female -- and I have it set to display the value of the LOV for the value -- that is seemingly getting lost in the copy.
    It's extremely painful to have to go to my new copied app and set everything manually again. And this is horrendous for an import/export from dev/test/production moving.
    Any thoughts/ideas how to resolve? Is it an APEX bug?
    Thanks
    David

    I just upgrade to 4.0.2 in hopes it would solve my problem, but unfortunately it doesn't. What could it be about my app? Again, here's what is happening: it seems that anywhere I'm using a "display based on LOV" column in a report (maybe just on IRs, can't find any on non IR reports) -- when I either export/import my app, or simply copy it in the same workspace, the Named LOV attribute is not set in the copy/import -- so the reports don't show my display values.
    Could it be something about my LOVs? Maybe I should try to recreate some of them?
    I wonder is there somewhere in the export file that I could look to see what's missing/going on? Weird thing is that when I ran a copy of my app, there was at least ONE report column that as showing correctly, but when I go and edit that column, I can see the LOV is NOT selected, and I can't save it without selecting one! So it's very strange, and unfortunately 4.0.2 doesn't solve it.
    I'll have to try to create a new lov and do a test. But this is a big deal because I can't move my app to from DEV to TEST or PROD if I have to go into it afterwards and change all the LOV based columns. I suppose a work-around would be to change all my queries to get the display value themselves instead of relying on the LOVs....I wonder if that would be more or less efficient?
    No one else has seen this issue?
    Thanks
    David

  • Alert variable not getting populated

    Hi ,
    I have configured alerts in my PI interface. I am getting alerts messages in my alert inbox(RWB), if there is some application error. But thr container variable ERRORMESSAGE is not getting pupulated. In Moni, I could see the trace where all the variables are populated. But, in my inbox, I am getting alert text empty.
    Please help.
    Thanks

    Hi,
    I think you you should use SXMS_ERROR_CAT, SXMS_ERROR_CODE while creating alert category. I am not able to find the variable ERRORMESSAGE in alert category creation.
    Regards
    Aashish Sinha

  • Query:  Customer Exit variable not getting populated

    Hello Experts,  I created a Customer Exit variable (ZPREV_MTH_OPS) in the query designer (7.0).  I also put the necessary code in the function module "Z_BWFI_QUERY_CELL_MANIPULTN", but the query variable is not getting populated when I run the query using RSRT.  The boxes for "Variable is ready for input" and "variable is without context" boxes when defining the variable.
    This is my code in the exit:
    case i_vnam.
        when 'ZPREV_MTH_OPS'.
         break-point.
          if i_step = 2.
            clear l_s_range.
            if sy-datum+4(2) = '01'.
              wa_prev_month = '12'.
              wa_prev_year = sy-datum+0(4).
              wa_prev_year = wa_prev_year - 1.
            else.
              wa_prev_month = sy-datum+4(2) - 1.
              wa_prev_year = sy-datum+0(4).
            endif.
            concatenate wa_prev_year wa_prev_month '01' into wa_datum.
            call function 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
              exporting
                day_in            = wa_datum
              importing
                last_day_of_month = wa_datum2.
            concatenate wa_prev_year wa_prev_month '01' into wa_datum.
    *        l_s_range-low = wa_datum.
    *        l_s_range-sign = 'I'.
    *        l_s_range-opt = 'BT'.
    *        l_s_range-high = wa_datum2.
    *        l_s_range-sign = 'I'.
    *        append l_s_range to e_t_range.
            l_s_range-low = '20080901'.
            l_s_range-sign = 'I'.
            l_s_range-opt = 'BT'.
            l_s_range-high = '20080930'.
            l_s_range-sign = 'I'.
            append l_s_range to e_t_range.
          endif.
      endcase.
    I also put a break point the exit, but it's not coming to the breakpoint. 
    Any suggestions?
    Thanks.

    Josh,  the link you provided reminded me to include the code in the include ZXRSRU01 also, instead of just changing the function module.  Thanks for your help and all those who tried to help me.
    case i_vnam.
       when 'ZREL12MTH' or 'ZPREV_MTH_OPS'.
         call function 'Z_BWFI_QUERY_CELL_MANIPULTN'
           EXPORTING
             i_vnam        = i_vnam
             i_vartyp      = i_vartyp
             i_iobjnm      = i_iobjnm
             i_s_cob_pro   = i_s_cob_pro
             i_s_rkb1d     = i_s_rkb1d
             i_periv       = i_periv
             i_t_var_range = i_t_var_range
             i_step        = i_step
           IMPORTING
             e_t_range     = e_t_range
             e_meeht       = e_meeht
             e_mefac       = e_mefac
             e_waers       = e_waers
             e_whfac       = e_whfac
           CHANGING
             c_s_customer  = c_s_customer.
    endcase.

Maybe you are looking for

  • Can`t get MacBook Pro game App`s in Brazil! Why?

    I`ve been trying to buy game app`s in Mac App Store but they are not available in Brazil`s Apple site. Why? Is it possible to do it through US or Canadian Mac App Stores?

  • JCOP tools activation!

    Since JCOP tools was moved to NXP by IBM, I can't get activation code from NXP. It is said that JCOP sample card can be used to activate JCOP tools. Can all of JCOP family cards(10,20,30 or else) be useful for JCOP activation? How is the activation p

  • RAC : User equivalence  check failed

    Hi All, Platform linux CentOS 4.5 and oracle 10g. I facing an issue with " user equivalence failed" while executing cluvfy command. On accessing node 2 from node 1 using ssh it is asking for password(oracle user) after configuring SSH. I have configu

  • OEL-5 finally released but with many desktop packages missing

    Hi, OEL-5 GA has just been released but with many client (desktop) packages missing (as opposed to CENTOS-5 where all RHEL-5 categories are bundled into only one distribution). Namely, three months ago RHEL-5 has been released in three basic categori

  • I can't open anything in my Downloads list

    I can't open anything in my Downloads list. I've tried resetting firefox and I've also tried everything in your article "What to do if you can't download or save files" but nothing helps. I tried to upgrade to the latest firefox to see if this helps