My methods aren't called!!!!!!

Hi!
Some of my methods aren't called by my other classes. here are some piece of my codes and my different classes. I don't know the reason of my faults. can u help me?
my first class:
public class dbManager
  public dbManager()
public Vector PatentBilgi  = new Vector();
private Vector Countryname = new Vector() ;
private Vector Cityname = new Vector();
public Vector getFromPatentTableRegisterDate(String year)
int result = 0;
String sql ="select PTAPPNO,APPLICATIONTYPE,PATENTTYPE,REGISTERDATE,PATENTDATE from patent.patent "+
"where to_char(registerdate,'yyyy')='" + year + " ' order by PTAPPNO";
  Connection conn = getConnection();
  Statement stmt = null;
  ResultSet rs = null;
  System.out.println(sql);
try
    stmt = conn.createStatement();
    rs = stmt.executeQuery(sql);
     while(rs.next())
    Patent patent = new Patent();
    patent.setBa�vuruNo(rs.getString("ptappno"));
    patent.setBasvuruBicimi(rs.getString("applicationtype"));
    patent.setKorumaTipi(rs.getString("patenttype"));
    patent.setBasvuruTarihi(rs.getString("registerdate"));
    patent.setTescilTarihi(rs.getString("patentdate"));
    patent.setUlke(getFromAddressTableCountry(patent.getBasvuruNo(),conn));
    patent.setSehir(getFromAddressTableCity(patent.getBasvuruNo(),conn));
    patent.setIPCID(getFromPtpatentclassificationTable(patent.getBasvuruNo(),conn));
    PatentBilgi.add(patent);
    result = rs.getInt(1);
return  PatentBilgi;  
public String getFromAddressTableCountry(String no,Connection conn)
String result = "";
String sql ="SELECT PATENT.ADDRESS.countrycode "+
" FROM PATENT.V_PTHOLDERS,PATENT.ADDRESS "+
" WHERE PATENT.V_PTHOLDERS.ADDRESSNO = PATENT.ADDRESS.ADDRESSNO"+
" AND PATENT.V_PTHOLDERS.ptappno = '"+no+"'";
  Statement stmt = null;
  ResultSet rs = null;
try
    stmt = conn.createStatement();
    rs = stmt.executeQuery(sql);
    if(rs.next())
     result = rs.getString(1);
return result;  
}my second class:
public class PatentHesaplamalar
  public PatentHesaplamalar()
  public void YerliTPEPatentBasvuruSayisi(Vector v)
  int sayac1=0;
  System.out.println("hesap");
    for (int j = 0; j < v.size(); j++)
  Patent obj = (Patent) v.get(j);
  String ulke=obj.getUlke();
  String basvuruBicimi=obj.getBasvuruBicimi();
  String korumaTipi=obj.getKorumaTipi();
  if(ulke.equalsIgnoreCase("TR"))
         sayac1++;
System.out.println(sayac1);
  }my frame:
public class PatentFrame extends JFrame
  dbManager manager = new dbManager();
  PatentHesaplamalar ph=new PatentHesaplamalar();
  Vector Countries = manager.getFromCountryTable();
jButton1.addActionListener(new ActionListener()
        public void actionPerformed(ActionEvent e)
          jButton1_actionPerformed(e);
private void jButton1_actionPerformed(ActionEvent e)
setSelectedYear((String)ComboBoxSelectionYear.getSelectedItem());
manager.getFromPatentTableRegisterDate(getSelectedYear());
System.out.println(getSelectedYear()+" y�l�"+" Yerli TPE Patent Basvuru Sayisi");
ph.YerliTPEPatentBasvuruSayisi(manager.PatentBilgi);
..........my output:
select PTAPPNO,APPLICATIONTYPE,PATENTTYPE,REGISTERDATE,PATENTDATE from patent.patent where to_char(registerdate,'yyyy')='2006 ' order by PTAPPNO
2006 yili Yerli TPE Patent Basvuru Sayisi
hesap
0
the methods
manager.getFromPatentTableRegisterDate(getSelectedYear());and
ph.YerliTPEPatentBasvuruSay�s�(manager.PatentBilgi);aren't called and counter sayac1 can't be calculated.
I hope my explanations are quite clear:)))
thank u for your help:))
Message was edited by:
a5x

Firstly, I took some elements from database and put in a vector PatentBilgi.
public Vector getFromPatentTableRegisterDate(String year)
int result = 0;
String sql ="select PTAPPNO,APPLICATIONTYPE,PATENTTYPE,REGISTERDATE,PATENTDATE from patent.patent "+
"where to_char(registerdate,'yyyy')='" + year + " ' order by PTAPPNO";
  Connection conn = getConnection();
  Statement stmt = null;
  ResultSet rs = null;
  System.out.println(sql);
try
    stmt = conn.createStatement();
    rs = stmt.executeQuery(sql);
     while(rs.next())
    Patent patent = new Patent();
    patent.setBa�vuruNo(rs.getString("ptappno"));
    patent.setBasvuruBicimi(rs.getString("applicationtype"));
    patent.setKorumaTipi(rs.getString("patenttype"));
    patent.setBasvuruTarihi(rs.getString("registerdate"));
    patent.setTescilTarihi(rs.getString("patentdate"));
    patent.setUlke(getFromAddressTableCountry(patent.getBasvuruNo(),conn));
    patent.setSehir(getFromAddressTableCity(patent.getBasvuruNo(),conn));
    patent.setIPCID(getFromPtpatentclassificationTable(patent.getBasvuruNo(),conn));
    PatentBilgi.add(patent);
    result = rs.getInt(1);
return  PatentBilgi;  ---------------------------------------------------------------------
then I created one of the methods:
public void YerliTPEPatentBasvuruSay&#305;s&#305;(Vector v)
  int sayac1=0;
  System.out.println("sepetim :"+v.size());
  System.out.println("hesap");
    for (int j = 0; j < v.size(); j++)
  Patent obj = (Patent) v.get(j);
  String ulke=obj.getUlke();
  String basvuruBicimi=obj.getBasvuruBicimi();
  String korumaTipi=obj.getKorumaTipi();
  System.out.println("ph if d�ng�");
  if(ulke.equalsIgnoreCase("TR"))
         sayac1++;
System.out.println(sayac1);
And I called these methods:
private void jButton1_actionPerformed(ActionEvent e)
setSelectedYear((String)ComboBoxSelectionYear.getSelectedItem());
manager.getFromPatentTableRegisterDate(getSelectedYear());
System.out.println(getSelectedYear()+" y&#305;l&#305;"+" Yerli TPE Patent Basvuru Say&#305;s&#305;");
ph.YerliTPEPatentBasvuruSay&#305;s&#305;(manager.PatentBilgi);
  }Message was edited by:
a5x

Similar Messages

  • Set methods aren't called

    For some of my managed beans, the set methods are not being called for the properties. Instead, it appears that the get methods are being called, and it modifies the reference in order to modify the stored property. I am using Facelets 1.1.12, MyFaces 1.1.4, and tomcat 5.5.17 (the one bundled with netbeans). The bean is a Spring managed being, which JSF accesses through Spring's DelegatingVariableResolver.

    I have a Java object which has a field which references another object. On my jsf page, I have:
    <h:inputText value="#{myBean.innerObj.val}" />When the form is submitted, the setVal method in innerObj is called, but the setInnerObj method in myBean is not called. Instead, it calls getInnerObj and probably uses the reference to modify the object.

  • How to know that a method has been called and returning value of a method

    Hi, everyone! I have two questions. One is about making judgment about whether a method has been called or not; another one is about how to return "String value+newline character+String value" with a return statement.
    Here are the two original problems that I tried to solve.
    Write a class definition of a class named 'Value' with the following:
    a boolean instance variable named 'modified', initialized to false
    an integer instance variable named 'val'
    a constructor accepting a single paramter whose value is assigned to the instance variable 'val'
    a method 'getVal' that returns the current value of the instance variable 'val'
    a method 'setVal' that accepts a single parameter, assigns its value to 'val', and sets the 'modified' instance variable to true, and
    a boolean method, 'wasModified' that returns true if setVal was ever called.
    And I wrote my code this way:
    public class Value
    boolean modified=false;
    int val;
    public Value(int x)
    {val=x;}
      public int getVal()
      {return val;}
       public void setVal(int y)
        val = y;
        modified = true;
         public boolean wasModified()
          if(val==y&&modified==true)
          return true;
    }I tried to let the "wasModified" method know that the "setVal" has been called by writing:
    if(val==y&&modified==true)
    or
    if(x.setVal(y))
    I supposed that only when the "setVal" is called, the "modified" variable will be true(it's false by default) and val=y, don't either of this two conditions can prove that the method "setVal" has been called?
    I also have some questions about the feedback I got
    class Value is public, should be declared in a file named Value.java
    public class Value
    cannot find symbol
    symbol  : variable y
    location: class Value
    if(val==y&&modified==true)
    *^*
    *2 errors*
    I gave the class a name Value, doesn't that mean the class has been declared in a file named Value.java*?
    I have declared the variable y, why the compiler cann't find it? is it because y has been out of scale?
    The other problem is:
    Write a class named  Book containing:
    Two instance variables named  title and  author of type String.
    A constructor that accepts two String parameters. The value of the first is used to initialize the value of  title and the value of the second is used to initialize  author .
    A method named  toString that accepts no parameters.  toString returns a String consisting of the value of  title , followed by a newline character, followed by the value of  author .
    And this is my response:
    public class Book
    String title;
    String author;
      public Book(String x, String y)
       { title=x; author=y; }
       public String toString()
       {return title;
        return author;
    }I want to know that is it ok to have two return statements in a single method? Because when I add the return author; to the method toString, the compiler returns a complain which says it's an unreachable statement.
    Thank you very much!

    Lets take this slow and easy. First of all, you need to learn how to format your code for readability. Read and take to heart
    {color:0000ff}http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html{color}
    Now as to your first exercise, most of it is OK but not this:   public boolean wasModified()
          if (val == y && modified == true)
                return true;
    y being a parmeter to the setValue method exists only within the scope of that method. And why would you want to test that anyways? If modified evaluates to true, that's all you need to know that the value has been modified. So you could have   public boolean wasModified()
          if (modified == true)
                return true;
       }But even that is unnecessarily verbose, as the if condition evaluates to true, and the same is returned. So in the final analysis, all you need is   public boolean wasModified()
          return modified;
       }And a public class has to be declared in a file named for the class, yes.
    As for your second assignment, NO you cannot "return" two variables fom a method. return means just that: when the return statement is encountered, control returns to the calling routine. That's why the compiler is complaining that the statement following the (first) return statement is unreachable.
    Do you know how to string Strings together? (it's called concatenation.) And how to represent a newline in a String literal?
    db

  • Setter method not getitng called in the custom tag

    Hi,
    I have written a custom tag and I have declared an attribute in the tld file and have specified the setter method for the same in the java tag file but that setter method is not getting called...for rest of the attributes, the methods are getting called and not just for one!! any idea what could be the problem....
    Regards
    Deepak Saini

    Do you have a getter method to match that property?
    Post some example code - what does your tld define for this property, and what get/set methods have you defined for it?

  • TelemetryClient.TrackException Does Not Include Method Name Or Call Stack (Windows Store App)

    We are attempting to use Application Insights (v0.12.0-build17386) for our Windows Store App.  When we use TelemetryClient.TrackException, no details appear in the azure portal.  The Failed Method is "Could Not Parse" and the Call Stack
    is empty. If we click on the "..." it gives more details but still no method name or call stack information to help us determine where the exception was thrown.  Is this by design, not implemented, or did we miss something obvious?  The
    code is very simple:
    public static void LogException(Exception exception)
    TelemetryClient telemetryClient = new TelemetryClient();
    telemetryClient.TrackException(exception);

    This is a known limitation of this version. It is in the backlog to fix. Note though that 0.13 is out already and fix should be included in the next version (0.14)
    Anastasia

  • Value Change event is not working. Html Panel Grid get method is not called

    Hi,
    I'm creating components dynamically.
    I have a dropdown. Based on the selection of dropdown, the panel grid is getting called.
    First time the panel grid getmethod is getting called. But when i change the value of drop down, panel grid get method is not getting called and its not rendering.
    This is the code:
    JSF:
    <h:panelGroup>
    <t:selectOneMenu id="selectProjectTypes" onchange="sbmitform();" immediate="true" valueChangeListener="#{ProjectController.projectTypeChanged}" value="#{ProjectController.project.selectProjectTypes}">
    <f:selectItem itemLabel="--------------------" itemValue="-1"/>               
    <f:selectItems value="#{ProjectController.projectTypesList}"/>                         
    </t:selectOneMenu>
    </h:panelGroup>
    <h:panelGrid columns="2" rendered="#{ProjectController.projects}" id="test" binding="#{ProjectController.defaultValues}" columnClasses="hunderadfifty"                                         cellpadding="5" />     
    Controller:
    public void projectTypeChanged(ValueChangeEvent event) throws AbortProcessingException,Exception {
              String nodeTypeId = null;
         String selectedValue = (String)event.getNewValue();
         getSessionCache().addValue("test", 0, "1");
         if(selectedValue.equalsIgnoreCase(nodeTypeId)){
         try
         // this.getDefaultValues().setRendered(true);
         // defaultValues=this.getDefaultValues();
         } catch (Exception e)
         e.printStackTrace();
         FacesContext.getCurrentInstance().renderResponse();
    Panel Grid Method
    public HtmlPanelGrid getDefaultValues() throws Exception {
         String devlues = (String)getSessionCache().getValue("test");
         Application app = FacesContext.getCurrentInstance().getApplication();
              labelList = nodeTypeFieldsService.getFixedFields(this.getRpUserData(), this.getAuthUser());
              HtmlPanelGrid panelGrid = (HtmlPanelGrid)app.createComponent(HtmlPanelGrid.COMPONENT_TYPE);
              for(int i = 0; i<labelList.size(); i++)
              HtmlOutputText heading = (HtmlOutputText)app.createComponent(HtmlOutputText.COMPONENT_TYPE);
              HtmlPanelGroup panelGroup = (HtmlPanelGroup)app.createComponent(HtmlPanelGroup.COMPONENT_TYPE);
              HtmlInputText inputText = (HtmlInputText)app.createComponent(HtmlInputText.COMPONENT_TYPE);               
              String fieldHeading =((ProjectField)labelList.get(i)).getFieldHeading();
              int fieldLength = ((ProjectField)labelList.get(i)).getFieldLength();
              String fieldDescription = ((ProjectField)labelList.get(i)).getFieldDescription();
              String fieldType = ((ProjectField)labelList.get(i)).getFieldType();     
              inputText.setValueBinding("value", (ValueBinding) app.createValueBinding("#{ProjectController.newProj}"));
              if(fieldType.equalsIgnoreCase("3"))
                   heading.setValue(fieldHeading);
                   heading.setTitle(fieldDescription);
                   inputText.setMaxlength(fieldLength);
                   inputText.setSize(fieldLength);     
                   UIRDDialog dialog = (UIRDDialog)app.createComponent(UIRDDialog.COMPONENT_TYPE);
                   dialog.setTitle("Object Type Dialog");
                   dialog.setHeight("370");
                   dialog.setWidth("350");
                   dialog.setUrl("searchObjectTypeDialog.jsf");                              
                   UIRDIconButton iconButton = (UIRDIconButton)app.createComponent(UIRDIconButton.COMPONENT_TYPE);
                   iconButton.setType("button");
                   iconButton.setTitle("Search for Object Types");
                   iconButton.setIcon("/image/icon/portalicon_search.gif");
                   iconButton.setActivateDialog("searchObjectTypeDialog");               
                   panelGroup.getChildren().add(inputText);          
                   panelGroup.getChildren().add(iconButton);
                   panelGroup.getChildren().add(dialog);
                   panelGrid.getChildren().add(panelGroup);
              }else
                   panelGroup.getChildren().add(inputText);
                   heading.setValue(fieldHeading);
                   inputText.setMaxlength(fieldLength);
                   inputText.setSize(fieldLength);
                   heading.setTitle(fieldDescription);
                   panelGrid.getChildren().add(panelGroup);
              panelGrid.getChildren().add(heading);          
              panelGrid.getChildren().add(panelGroup);
              HtmlCommandButton createButton = (HtmlCommandButton)app.createComponent(HtmlCommandButton.COMPONENT_TYPE);
              createButton.setId("create");
              createButton.setTitle("Create");
              createButton.setValue("Skapa");          
              createButton.setAction(app.createMethodBinding("#{ProjectController.saveProject}", null));
              HtmlCommandButton backButton = (HtmlCommandButton)app.createComponent(HtmlCommandButton.COMPONENT_TYPE);
              backButton.setId("back");
              backButton.setTitle("Cancel");
              backButton.setValue("Avbryt");
              backButton.setAction(app.createMethodBinding("#{ProjectController.cancel}", null));     
              panelGrid.getChildren().add(createButton);
              panelGrid.getChildren().add(backButton);
              return panelGrid;
         /* } else {
              return null;
    }

    Hi,
    I'm having the exact same problem, and it's freaking me out!!! The setGridPanel method is always called but not the getGridPanel. This one is only called the first time the page is rendered, and when I change a drodpdownlist it never gets the gridPanel again! I'm using an HtmlPanelGrid. Anyone can help please?
    Thanks in advance,
    Raquel

  • Region Monitoring iOS 7 : didEnterRegion method is not calling when app is killed by user or by OS in iOS 7 only. It is working fine when it is in background. and the same code is working fine with iOS 6 for both app in suspended mode and background mode.

    Region Monitoring iOS 7 : didEnterRegion method is not calling when app is killed by user or by OS in iOS 7 only. It is working fine when it is in background. and the same code is working fine with iOS 6 for both app in suspended mode and background mode. What changes I have to made to work great in iOS 7 also.

    I rewrote code for debugging purpose and tried to catch error using GetLastError();  method,
    but it only printed 0. Below is code snippet; I think Create() throw an exception
    and code goes to catch block. 
    LONG ConnectTS(CString strIP, UINT n_Port)
    try{
              ErrorLog(0,0,"ConnectTS is calling Create [is going to call]","");
              if(!Create())
    // Exception Line
    n_Err = GetLastError();
    return NET_INIT;
    catch(...)
                       DWORD errorCode = GetLastError();
                       CString errorMessage
                       errorMessage.Format("%lu",errorCode);
                       ErrorLog (0, 0, "Image
    System", (LPTSTR)(LPCTSTR)errorMessage);
                       return  IS_ERR_WINDOWS;
    Output: -
    ConnectTS is calling Create [is going to call]
    Image System
    0

  • A way to set a flag in java layer when native method has been called?

    Hi,
    I'm calling a native method from the java layer through to a native c function. Is there a way I can set a flag in the java layer when this native method has been called?
    Thanks!

    1. Create a wrapper method. The wrapper method is the only exposed method. It calls the native method. It sets the flag.
    2. Set the flag in the native method itself.
    3. You might be able to use the debugging API to do this however it is going to require quite a bit of work. And it injects itself at runtime.
    Is there a reason for this request? There might be other solutions if a general problem was posed.

  • GET_V Method is not called for custom field

    Hi,
    We are using CRM 7.0
    I have enhanced component BT120H_CPL and added custom fields into view Details with AET. I am trying to implement search help which depends on another field. I have created V-GETTER for my field and tried to implement search help in this method. However, this method is not called in the program scope.
    I have debugged the application and result is :
    V_GETTER method GET_V_ZZAFLD00000D is created in class ZL_BT120H_C_DETAILS_CN00. It should be called from GET_V_S_EXT method but this method is called in class CL_BT120H_C_DETAILS_CN00 and exception occurs since GET_V_ZZAFLD00000D doesnu2019t exist in class CL_BT120H_C_DETAILS_CN00.
    I tried similar scenario : add search help to existing field of another component. However I couldnu2019t able to run GET_V method again.
    ( It works when I write search help id in the AET but in this way I cannot pass import parameter to it )
    Is there anything I am missing ? Thanks in advance for helps.
    Regards
    Abdul.

    Hi,
        Then, the next possible thing is checking the "enhancement set". Press F2 keeping the cursor on any field and check if the view is showing up as enhanced. Find this information under "Active Enhancement set" in the popup details. If this does not happen, then your enhanced view is not being used. You may want to check the COMPONENT_LOADING BADI if you are using more than one assignment set. You may also want to look at this WIKI.
    [http://wiki.sdn.sap.com/wiki/display/CRM/HowToEnhanceaWebUIComponentinSAP+CRM]
    Regards,
    Arun Prakash

  • DoFilter() method is being called only at the second request

    Hi,
    I have implemented a simple Filter class
    Here is the code
    public class BasicFilter implements Filter
    FilterConfig config;
    public void init(FilterConfig config)
    System.out.println("Filter Initialised");
    this.config = config;
    public void doFilter(ServletRequest request,ServletResponse response,FilterChain chain) throws ServletException,
    IOException
    System.out.println("In The doFilter() method");
    ServletContext sc = config.getServletContext();
    sc.setAttribute("Hello","Hell");
    chain.doFilter(request,response);
    public void destroy()
    System.out.println("In the destroy method");
    and a simple servlet
    public class FilteredServlet extends HttpServlet
    public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.println("<HTML>");
    out.println("<HEAD><TITLE>Filter Demo</TITLE></HEAD>");
    out.println("<BODY>");
    out.println(getServletContext().getAttribute("Hello"));
    out.println("</BODY>");
    out.println("</HTML>");
    Now when i start the server (Tomcat 4.0) i find that the filter's init() method is being called which is fine. But when i request the servlet (FilteredServlet) the doFilter() method is not called and only when i "refresh" it or call it a second time that the doFilter() method is actually called. What could be the reason for this.
    Help will be greatly appreciated.
    Thank You,
    Phani Kanuri

    Hi jleech,
    Thanks for the reply. But deleting all the temporary internet files as also the history files does not seem to have an effect. the doFilter is being called only at the second request. or did i miss anything??
    Please help. unable to complete the assignment because of this.
    Thank You,
    Phani Kanuri

  • Action method not being called

    Using jdev 10.1.3.4 with jsf/adf bc. I have two af:table components on a jsf page. I'll call them table A and table B. In table B, I have an input text with autosubmit=true and hooked up to a valuechangelistener. One of the columns in table B is a command button. Initially, I was having problems when the user changed the input value in table B and then immediately clicked the button in table B. Sometimes when the button was clicked, the backing bean method associated with it was not executing. Thanks to Didier's advice in this forum (Re: PPR and submit I was able to get this functionality working consistently.
    I still have a problem though. Table A has a command LINK as one of the columns, which executes a method in the backing bean when clicked. However, as in the scenario above, if the user changes a value in the input text in table B and in this case immediately clicks the LINK in table A, it seems that the action method behind the button in table A executes the first time but if user repeats steps (changes value of input in table B and immediately clicks LINK in table A) the action method is not called after the first time. For testing, there is no real code in the backing bean method. The only code in the action method is an sop so I can tell if the method was executed. Likewise, the value change listener method, for testing purposes, has a sop so I can tell if/when it is executed and the thread.sleep(400) code needed per Didier's workaround. I'll include the code from jspx:
    In the jspx -
    <afh:body firstClickPassed="true">
    <h:form>
    <!-- table A -->
    <af:table value="#{bindings.Summary.collectionModel}" var="row"
    rows="#{bindings.Summary.rangeSize}"
    first="#{bindings.Summary.rangeStart}">
    <af:column headerText="#{bindings.Summary.labels.PositionNbr}">
    <af:inputText value="#{row.PositionNbr}"/>
    </af:column>
    <af:column>
    <af:commandLink text="Click" action="#{backing_levelone_untitled2.buttonClicked}"/>
    </af:column>
    </af:table>
    <!-- Table B -->
    <af:table value="#{bindings.BdCommentsView.collectionModel}" var="row"
    rows="#{bindings.BdCommentsView.rangeSize}"
    first="#{bindings.BdCommentsView.rangeStart}">
    <af:column headerText="#{bindings.BdCommentsView.labels.CommentId}">
    <af:inputText value="#{row.CommentId}"
    required="false" />
    </af:column>
    <af:column headerText="#{bindings.BdCommentsView.labels.Comments}">
    <af:inputText value="#{row.Comments}"
    required="false" autoSubmit="true" valueChangeListener="#{backing_levelone_untitled2.isValid}"/>
    </af:column>
    <af:column>
    <af:commandButton text="Click" action="#{backing_levelone_untitled2.buttonClicked}"/>
    </af:column>
    </af:table>
    </h:form>
    </afh:body>
    I need the backing bean method behind the LINK in table A to be fired consistently, every time user makes a change to input of table B and immediately clicks LINK in table A. It works the first time, but all subsequent attempts will not result in the action method being executed. Hope someone can help.
    Edited by: user12341229 on Dec 11, 2009 3:24 PM

    I'm not sure if this is considered a bug, but I found that if I use a commandLink in table A, my code doesn't work as expected. However, I found that by using a commandButton in table A the functionality works as expected. I still would like to hear some feedback on this if anyone is interested in recreating the scenario. Thanks.

  • Why the method can be called in this way?

    Hi all,
    The following is JAVA SWING TREE custom data models program. There are two files in the program: one is TestFrame.java, and the other is MyDataModel.java. I only posted the important part on the Forum.My question is how method getChild(...) in MyDataModel.java was called in the program? Why I couldn't see the statement like tree.getChild(..) in TestFrame.java? After adding PRINT statements, I know the method getChild(..) was called automatically when object tree was initialized , but I don't know why. Thank you in advance.
    ======
    TestFrame.java
    // Imports
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    class TestFrame extends JFrame
    // Instance attributes used in this example
    private JPanel topPanel;
    private JTree tree;
    private JScrollPane scrollPane;
    // Constructor of main frame
    public TestFrame()
    // Create a new tree control
    MyDataModel treeModel = new MyDataModel( root );
    tree = new JTree(treeModel);
    =========
    ==========
    MyDataModel.java
    import javax.swing.tree.*;
    class MyDataModel extends DefaultTreeModel
    private DefaultMutableTreeNode root;
    private String rootName = "";
    public MyDataModel( TreeNode root )
    super( root );
    DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode)root;
    rootName = (String)parentNode.getUserObject();
    System.out.println("rootName is: "+rootName);
    public Object getChild( Object parent, int index )
    DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode)parent;
    String parentName = (String)parentNode.getUserObject();
    System.out.println("parentName is: "+parentName);
    if( parentName.equals( rootName ) )
    return super.getChild( parent, index );
    else
    return new DefaultMutableTreeNode( cardArray[index] );
    }

    This is the first time I saw this usage. I understood it now, but I was afraid I missed some important concepts on "interface as parameter in the constructor". Therefore, I am wondering where I can find some online document about it in order to understand the usage clearly.
    For example, if there are a few method implementations of interface TreeModel in MyDataModel.java, which methods will it call after calling JTree constructor? all methods or only part of them?
    Thanks

  • What method will be called when an javabean terminates?

    Hi,
    I am using a java bean in my jsp application with scope "application". I know that this java bean will be terminated only when the server stops or shuts down.
    I need to cleanup something manually when the server shuts down. Can anyone tell me what method will be called, or that I can override, to clean up?
    Please advise.
    Damien

    Hi,
    I tried to implement the ServletContextListener, the ServletContextAttributeListener and the finalize methods, but I find that all of them are not called when I shut down the server manually.
    I am using an Apache Tomcat 4.0 server. I implement the methods as follows:
    public class RTPMainServer implements ServletContextListener, ServletContextAttributeListener
    public void contextDestroyed(ServletContextEvent scb)
    System.out.println("Server shutdown");
    System.out.println(scb.getServletContext());
    sourceSwitch.Cleanup();
    public void contextInitialized (ServletContextEvent scb)
    System.out.println("Server initialized");
    public void attributeAdded (ServletContextAttributeEvent scab)
    System.out.println("Mainserver added");
    public void attributeRemoved (ServletContextAttributeEvent scab)
    System.out.println("MainServer removed");
    public void attributeReplaced (ServletContextAttributeEvent scab)
    System.out.println("Attribute replaced");
    protected void finalize()
    System.out.println("Mainserver garbage collected");
    Can anyone help? Thanks
    Damien

  • GetGroupMembersInternal method never been called

    Hello,
    Regard to my custom realm, I notice that my getGroupMembersInternal method
    has never been called although I set weblogic.security.groupCacheTTL=1.
    I'm sure I implemented my group by subclassing from FlatGroup and implement
    necessary methods for it and it works fine for authentication and
    authorization. But it can't use group member refresh feature 'cos
    getGroupMembersInternal method never been called.
    Could you tell me what I've done wrong ?
    I uses WLS 5.1 with service pack 3 on Win2K. Do I need the new patch ??
    Thanks in advance,
    Siros

    "Benny" <[email protected]> wrote:
    I have resolved my problem , It was a spelling mistake for the method name !!!!
    Now the method is getting called and all the group members are loading , I use
    secure way as my ldap security store .
    Benny
    >
    Hi ,
    I have similar problem , I am using weblogic server6.0sp1
    , wrote a customRealm as per documentation provided in weblogic site
    , I can see
    users and groups in the console , because
    getGroupmembersInternal never been executed group members are not loading
    with
    the group name , could any one post an explanation
    Thanks
    Benny
    "Siros Supavita" <[email protected]> wrote:
    Hello,
    Regard to my custom realm, I notice that my getGroupMembersInternalmethod
    has never been called although I set weblogic.security.groupCacheTTL=1.
    I'm sure I implemented my group by subclassing from FlatGroup and implement
    necessary methods for it and it works fine for authentication and
    authorization. But it can't use group member refresh feature 'cos
    getGroupMembersInternal method never been called.
    Could you tell me what I've done wrong ?
    I uses WLS 5.1 with service pack 3 on Win2K. Do I need the new patch
    Thanks in advance,
    Siros

  • Which method will be called, when invoking home.create() ?

    Hi,
    In a Stateless session Bean, I want initialize some variables, whenever a bean is created or retrieved from the pool. So I used the ejbCreate() method to initialize the variables, but it is called only first time when I call the home.create(). If I call the home.create() method next time it doesn't call the ejbCreate().
    Which method will be called, whenever I call home.create();.

    hi siva,
    first of all Ejbcontainers maintain a pool of stateless sessionbeans .when you call home.create() the ejbCreate () method is definitely called and you said you are initializing some variable and may be you are trying to retrive that value after home.create() method.. when you try to retrive the value thee value may be same as you have initialized or different depending upon the no of stateless session beans in the container. you have created a bean and there is no guarantee that the same bean will be called when you invoke retrieval method..
    i hope you understood.
    cheers

Maybe you are looking for

  • Unable to attach PDF to email (Outlook for Mac 2011)

    We are pushing out software upgrades for CS5 and MS Office 2011 for Mac. We've discoverd that we can't use the Attach to email feature in Acrobat. The spinning rainbow wheel pops up for about a minute, and then Acrobat is non-responsive and we have t

  • Can you stream from BBCi Player using Apple TV?

    Hi All, Looking into getting the apple TV for my dad but want to know if it will actually come in handy so please tell me ... Can you stream from BBCi Player/ITV Player from laptop to TV via the Apple TV? Many Thanks

  • AR Invoice forms

    Hi,   How can we get to print multiple AR Invoice multiple items on the same form. The standard form in correspondence type SAP19 shows the total receivable amount. kindly provide your inputs., thanks very much.

  • Why my docking station doesn't works with iphone 4

    I HAVE 2 DOCKING STATIONS (JBL AND YAMAHA) none of them works, does any one know how to solve this problem. Best regards

  • TS2830 I need help. Trying to open iTunes and get a 13010 error???

    I'm trying to access itunes so I can put more songs on my ipod. I can't even get to itunes because I keep getting a 13010 error. Can anyone please help? Thanks, petpatrolkitty