TreeTable - null bean

I have page, where is TreeTable, which contains informations about included nodes - companies...Under the table is selectOneChoice component, which contains all others
companies, which arent included and addButton, whit wich can user add companies from not included (selectOneChoiceComponent) to TreeTable component...When i am entering
this site for first time and there are no included companies - treeTable is empty, there is no problem.I am adding some companies from selectOneChoice component - with
addButton to treeTable.then i am going out from this page without saving data.When i am entering this site second time - there are no included companies in treeTable,
it is ok, but when i try to add some company to treeTable with addButton, exception appears. When i remove treeTable binding, the problem disappears. It seems to be a problem with treeTable state?
editCalculationFourthSubview.jsp // editCalculation subview
  <af:treeTable value="#{editCalculationBean.treeNodesModel}" var="node" partialTriggers="addButton"
    inlineStyle="width:100%" binding="#{editCalculationBean.treeNodesTable}"
    expandAllEnabled="true" id="table" bandingInterval="1" banding="row" >
    <f:facet name="nodeStamp">
      <af:column>
        <f:facet name="header">
           <h:outputText value="#{res.level}"/>
        </f:facet>
        <af:objectImage width="16" height="16"
        source="/imageServlet?id=#{node.nodeLevel}&type=nodeLevel"/>
        <af:outputText value="#{node.name}" />
      </af:column>
    </f:facet>
    <af:column>
      <f:facet name="header">
        <h:outputText value="#{res.id}" />
      </f:facet>
      <h:outputText value="#{node.id}" />
    </af:column>
    <af:column formatType="icon">
      <f:facet name="header">
        <h:outputText value="#{res.included}" />
      </f:facet>
        <af:selectBooleanCheckbox value="#{node.include}" readOnly="false" autoSubmit="true"
        valueChangeListener="#{editCalculationBean.updateSelectedNodes}" />
    </af:column>
      </af:treeTable>
      <af:selectOneChoice id="selectNode"
        value="#{editCalculationBean.otherScopeNodeSelected}"
       partialTriggers="addButton">
        <f:selectItems value="#{editCalculationBean.otherNodesMap}" />
      </af:selectOneChoice>
    </afh:cellFormat>
    <afh:cellFormat>
      <af:commandButton id="addButton" text="#{res.add}"
        shortDesc="#{res.addToSelectedDescription}"
        action="#{editCalculationBean.addNodeToSelected}"
        />
...part of EditCalculationBean.java -> session scope
private List<ScopeNodeData> selectedAllScopeNodes, selectedRootScopeNodes, otherScopeNodes;
private TreeModel treeNodesModel;
private CoreTreeTable treeNodesTable;
public String getRequestCall() {
  initSubview();
private void initSubview() {
    List<GbcNode> nodes = serviceProvider.getNodeService().getAllNodes();
...initialize arrays
    List<GbcScopeNode> scopeNodes = serviceProvider.getScopesService().getGbcScopeNodes();
    for(GbcScopeNode sn:scopeNodes){
      scopeNodesData.add(new ScopeNodeData(sn.getIdNode().getId(), sn.getIdNode().getNameK(), true, sn.getIdNode().getIdNodeLevel().getId(), sn.getIdNode()));
    selectedRootScopeNodes = scopeNodesData;
    selectedAllScopeNodes = scopeNodesData;
    selectedAllScopeNodes = loadNodes();
    for(GbcNode n : nodes){
      Boolean included = false;
      for(ScopeNodeData snd:selectedAllScopeNodes){
        if(n.getId().equals(snd.getNode().getId())){
          included = true;
          break;
      if (!included){
        otherScopeNodes.add(new ScopeNodeData(n.getId(), n.getNameK(), false, n.getIdNodeLevel().getId(), n));
    otherScopeNodeSelected = otherScopeNodes.get(0).getId();
public void addNodeToTree(ScopeNodeData treeNode, List<ScopeNodeData> newSelectedScopeNodes){
  List<GbcNode> nodes = serviceProvider.getNodeService().getAllNodesById(treeNode.getNode().getId());
  boolean included;
  for(GbcNode node: nodes) {
    for(ScopeNodeData rootNode:selectedRootScopeNodes){
      if(rootNode.getNode().getId().equals(node.getId())){
        selectedRootScopeNodes.remove(rootNode);
        break;
    included = treeNode.getInclude();
    if(!included){
      for(ScopeNodeData ssnd : selectedAllScopeNodes){
        if(node.getId().equals(ssnd.getNode().getId())){
          included = ssnd.getInclude();
    ScopeNodeData childTreeNode = new ScopeNodeData(node.getId(), node.getNameK(), included, node.getIdNodeLevel().getId(), node);
    addNodeToTree(childTreeNode, newSelectedScopeNodes);
    newSelectedScopeNodes.add(childTreeNode);
    for(ScopeNodeData treeNodeData : treeNode.getChildNodes()){
      if(treeNodeData.getNode().getId().equals(childTreeNode.getNode().getId())) return;
    treeNode.addChildNode(childTreeNode);
public List<ScopeNodeData> loadNodes(){
    List<ScopeNodeData> treeNodes = new ArrayList<ScopeNodeData>();
    List<ScopeNodeData> newSelectedScopeNodes = new ArrayList<ScopeNodeData>();
    ScopeNodeData rootData = new ScopeNodeData(new Long(0), "Nodes", true, new Long(1), null);
    boolean included;
    for(ScopeNodeData rsnd : selectedRootScopeNodes){
      included = true;
      for(ScopeNodeData ssnd : selectedAllScopeNodes){
        if(rsnd.getNode().getId().equals(ssnd.getNode().getId())){
          included = ssnd.getInclude();
      rsnd.setInclude(included);
      addNodeToTree(rsnd, newSelectedScopeNodes);
      rootData.addChildNode(rsnd);
      newSelectedScopeNodes.add(rsnd);
   if(rootData.getChildNodes().size()>0){
      treeNodesModel = new ChildPropertyTreeModel(rootData, "childNodes");
    }else{
      treeNodesModel = new ChildPropertyTreeModel(treeNodes, "childNodes");
    return newSelectedScopeNodes;
public class ScopeNodeData{
...declarations
  private Collection<ScopeNodeData> childNodes;
  public ScopeNodeData(Long id, String name, Boolean include, Long nodeLevel, GbcNode node){
...initializations
    this.childNodes = new ArrayList<ScopeNodeData>();
... setters and getters
  public Collection<ScopeNodeData> getChildNodes(){
    return childNodes;
  public void setChildNodes(Collection<ScopeNodeData> childNodes){
    this.childNodes = childNodes;
public TreeModel getTreeNodesModel(){
  return treeNodesModel;
public List<ScopeNodeData> getSelectedScopeNodes(){
  return selectedAllScopeNodes;
public void setSelectedScopeNodes(List<ScopeNodeData> scopeNodes){
  this.selectedAllScopeNodes = scopeNodes;
public CoreTreeTable getTreeNodesTable(){
  return treeNodesTable;
public void setTreeNodesTable(CoreTreeTable treeNodesTable){
  this.treeNodesTable = treeNodesTable;
}Exc:
javax.faces.el.PropertyNotFoundException: Error testing property 'include' in bean of type null
at com.sun.faces.el.PropertyResolverImpl.isReadOnly(PropertyResolverImpl.java:274)

Hi,
what if you set the managed bean scope to session? Look as if the treetable and select list it populated by the bean. The exception seems to indicate a problem with a property it cannot find
Frank

Similar Messages

  • Uncaught Java Exception while persisting the null bean at e-biz suite login

    Dear Friends,
    Recently, there was a java upgrade in my system and after that when i login to E-Biz suite, i get the following Jinitiator error and many Jinitiator windows open up with this error.
    Uncaught Java Exception while persisting the null bean
    Java.io.NotSerializableException:java.lang.thread
        at.java.io.ObjectOutputStream.outputObject(Compiled Code)
        at.java.io.ObjectOutputStream.writeObject(Compiled Code)
        at.java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:369)
        at.java.io.ObjectOutputStream.outputObject(Compiled Code)
        at.java.io.ObjectOutputStream.writeObject(Compiled Code)
        at sun.beans.ole.OleBeanInterface.saveBean(OleBeanInterface.java.508)It is very difficult to deal with many jinitiator error windows opening up.
    Could any one tell the reason for this issue and its resolution as well?
    Regards,
    Sreekanth
    Edited by: Sreekanth Munagala on Jun 14, 2012 8:49 AM
    Edited by: Sreekanth Munagala on Jun 14, 2012 8:51 AM

    Please post the details of the application release, database version and OS.
    Recently, there was a java upgrade in my system What is this upgrade? From what version to what version?
    What is your client OS/Browser?
    What is the Jinitiator version?
    and after that when i login to E-Biz suite, i get the following Jinitiator error and many Jinitiator windows open up with this error.
    Uncaught Java Exception while persisting the null bean
    Java.io.NotSerializableException:java.lang.thread
    at.java.io.ObjectOutputStream.outputObject(Compiled Code)
    at.java.io.ObjectOutputStream.writeObject(Compiled Code)
    at.java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:369)
    at.java.io.ObjectOutputStream.outputObject(Compiled Code)
    at.java.io.ObjectOutputStream.writeObject(Compiled Code)
    at sun.beans.ole.OleBeanInterface.saveBean(OleBeanInterface.java.508)It is very difficult to deal with many jinitiator error windows opening up.
    Could any one tell the reason for this issue and its resolution as well?Is the issue with all clients and all browsers?
    Have you tried to clear the jcache and the browser history files?
    Thanks,
    Hussein

  • Attempt to access a null bean.

    Hi,
    When i run my program it says,
    "Attempted a bean operation on a null object".
    <jsp :useBean id="myCar"class="com.wrox.cars.CarBean" />
    I have a <jsp:getProperty name="myCar" property="make" />
    <jsp:setProperty name="myCar" property="make" value="Ferrari" />
    Now I have a <jsp:getProperty name="myCar" property="make" /
    Any suggestions.
    Thanks.

    Hi Annie,
    I am totaly new to jsp.
    all i have is two files.
    1)package com.wrox.cars;
    import java.io.Serializable;
    public class CarBean implements Serializable
    private String make="Ford";
    public CarBean()
    public String getMake()
    return make;
    public void setMake(String make)
    this.make=make;
    then 2)
    <html>
    <head>
    <title>Using a JAVA BEAN</title>
    </head>
    <body>
    <h2>Using a JAVA BEAN</h2>
    <jsp :useBean id="myCar"class="com.wrox.cars.CarBean" />
    I have a <jsp:getProperty name="myCar" property="make" />
    <jsp:setProperty name="myCar" property="make" value="Ferrari" />
    Now I have a <jsp:getProperty name="myCar" property="make" />
    </body>
    </html>
    I did complie the java file before running this.

  • Problem with beans in session scope

    Hello,
    I developped a website using JSP/Tomcat and I can't figure out how to fix this problem.
    I am using beans in session scope to know when a user is actualy logged in or not and to make some basic informations about him avaible to the pages. I then add those beans to an application scope bean that manages the users, letting me know how many are logged in, etc... I store the user beans in a Vector list.
    The problem is that the session beans never seem to be destroyed. I made a logout page which use <jsp:remove/> but all it does is to remove the bean from the scope and not actualy destroying it. I have to notify the application bean that the session is terminated so I manualy remove it from its vector list.
    But when a user just leave the site without using the logout option, it becomes a problem. Is there a way to actualy tell when a session bean is being destroyed ? I tried to check with my application bean if there are null beans in the list but it never happens, the user bean always stays in memory.
    Is there actualy a way for me to notify the application bean when the user quits the website without using the logout link ? Or is the whole design flawed ?
    Thanks in advance.
    Nicolas Jaccard

    I understand I could create a listener even with my current setup Correct, you configure listeners in web.xml and they are applicable to a whole web application irrespective of whether you use jsp or servlets or both. SessionListeners would fire when a session was created or when a session is about to be dropped.
    but I do not know how I could get a reference of the application bean in >question. Any hint ?From your earlier post, I understand that you add a UserBean to a session and then the UserBean to a vector stoed in application scope.
    Something like below,
    UserBean user = new UserBean();
    //set  bean in session scope.
    session.setAttribute("user", user);
    //add bean to a Vector stored in application scope.
    Vector v = (Vector)(getServletContext().getAttribute("userList"));
    v.add(user);If you have done it in the above fashion, you realize, dont you, that its the same object that's added to both the session and to the vector stored in application scope.
    So in your sessionDestroyed() method of your HttpSessionListener implementation,
    void sessionDestroyed(HttpSessionEvent event){
         //get a handle to the session
         HttpSession session = event.getSession();
          //get a handle to the user object
          UserBean user = (UserBean)session.getAttribute("user");
           //get a handle to the application object
          ServletContext ctx = session.getServletContext();
           //get a handle to the Vector storing the user objs in application scope
            Vector v = (Vector)ctx.getAttribute("userList");
           //now remove the object from the Vector passing in the reference to the object retrieved from the Session.
            v.removeElement(user);
    }That's it.
    Another approach would be to remove the User based on a unique identifier. Let's assume each User has a unique id (If your User has no such feature, you could still add one and set the user id to the session id that the user is associated with)
    void sessionDestroyed(HttpSessionEvent event){
         //get a handle to the session
         HttpSession session = event.getSession();
          //get a handle to the user object
          UserBean user = (UserBean)session.getAttribute("user");
           //get the unique id of the user object
           String id = user.getId();
           //get a handle to the application object
          ServletContext ctx = session.getServletContext();
           //get a handle to the Vector storing the user objs in application scope
            Vector v = (Vector)ctx.getAttribute("userList");
           //now iterate all user objects in the Vector
           for(Iterator itr = v.iterator(); itr.hasNext()) {
                   User user = (User)itr.next();               
                    if(user.getId().equals(id)) {
                           //if user's id is same as id of user retrieved from session
                           //remove the object
                           itr.remove();
    }Hope that helps,
    ram.

  • How to get the owning bean given a java object

    Hi, is there any way - for a just-created bean instance - to know on behalf of which bean this object has been created ?
    In other words, going back from the java object to the bean symbolic name, as described in a faces-config managed-bean chunk (just the opposite of resolveVariable) ?

    You want to get the definied managed bean name inside the backing bean?
    If so, call this inside the backing bean: private String getManagedBeanName() {
        String managedBeanName = null;
        HttpServletRequest request =
            (HttpServletRequest) FacesContext
                .getCurrentInstance()
                    .getExternalContext()
                        .getRequest();
        // Lookup bean in request scope.
        Enumeration requestAttributeNames = request.getAttributeNames();
        while (requestAttributeNames.hasMoreElements()) {
            String requestAttribute = (String) requestAttributeNames.nextElement();
            Object object = request.getAttribute(requestAttribute);
            if (this.equals(object)) {
                managedBeanName = requestAttribute;
                break;
        if (managedBeanName == null) {
            // Bean is not in the request scope. Lookup it in session scope.
            Enumeration sessionAttributeNames = request.getSession().getAttributeNames();
            while (sessionAttributeNames.hasMoreElements()) {
                String sessionAttribute = (String) sessionAttributeNames.nextElement();
                Object object = request.getSession().getAttribute(sessionAttribute);
                if (this.equals(object)) {
                    managedBeanName = sessionAttribute;
                    break;
        return managedBeanName;
    }

  • Cannot reset bean properties bound to UIX elements

    In a UIX page there are a messageChoice and two messageTextInput that are boud to three bean properties. Here is the code:
    <messageChoice model="${bindings.farmaco}"
    selectedValue="${bindings.farmaco}"
    prompt="Tipo di scheda (farmaco):">
    <contents>
    <option value="-1"/>
    <dataScope>
    <contents childData="${bindings.farmaco.displayData}">
    <option model="${uix.current}"/>
    </contents>
    </dataScope>
    </contents>
    </messageChoice>
    <messageTextInput model="${bindings.anno}"
    prompt="Anno di compilazione"/>
    <messageTextInput model="${bindings.reparto}"
    text="${bindings.reparto}"
    prompt="Unità operativa:"/>
    <submitButton text="Cerca" event="cerca"/>
    <resetButton text="Reset">
    <primaryClientAction>
    <fireAction event="reset"/>
    </primaryClientAction>
    </resetButton>
    the onReset method resets the bean properties:
    vars bean=(vars)actionContext.getBindingContext().findDataControl("varsDataControl").getDataProvider();
    //reset search criteria
    bean.setFarmaco(null);
    bean.setAnno(null);
    bean.setReparto(null);
    But somewhere else the value of these bean properties is set again to the value of the UIX page components. I want just the opposite to happen: when I reset the bean properties, I expect to see (the event causes a refresh) the UIX component reset too.
    Why does this not happen?

    I chaneged the code inside UIX page to accomplish what you wrote:
    <messageChoice
    prompt="Tipo di scheda (farmaco):"> <contents>
    <option value="-1"/>
    <dataScope>
    <contents childData="${bindings.farmaco.displayData}">
    <option model="${uix.current}"/>
    </contents>
    </dataScope>
    </contents>
    </messageChoice>
    <messageTextInput
    text="${bindings.anno}"
    prompt="Anno di compilazione"/> <messageTextInput text="${bindings.reparto}" prompt="Unità operativa:"/>
    <resetButton text="Reset">
    </resetButton>
    I also deleted the code for the "onReset" method, but the reset doesn't work. Before the changes, I added some prints to setter and getter methods of the bean properties: during the reset they are set to null, but then they are set again to the previous value before loading the page and I cannot understand where it happens. Any ideas?

  • JSP Dynpage and Bean

    Hi there,
    I have developed a portal application using JSP Dynpage which calls R/3 BAPI but I have a strange issue here.
    This application calls BAPI and displays it using HTMLB table control.
    When returned values from R/3 are small, it is OK. The problem is when large amount of data comes from R/3, data is correctly displayed but Bean seems to be cleared after displaying it. Therefore if one clicks any button on the applicaiton, NullPointerException occurs due to null bean.
    Bean scope is "Application".
    Do you have any experience like this? Any input is appreciated!
    Regards,
    Kazuya

    At the moment there is a lot of ambigious information about this, and I've asked for some weblog tying it all together (see Bean scope storage confussion)
    You problem is that beans in the application scope can be deleted at anytime if the SAP J2EE needs memory. Try the session scope (or search the forums, lots of people have had the same problem before)

  • Array of Beans with DII

    I've succeeded in sending over a Bean with Dynamic Invocation Interface with this code:
              private static String Endpointaddress = "http://p12nick:8080/MiniInternetbank/MiniInternetbankKlant";
              private static String qnameService = "MiniInternetBankKlant";
              private static String qnamePort = "MiniInternetbankKlantIF";
              private static String BODY_NAMESPACE_VALUE = "urn:Foo";
              private static String ENCODING_STYLE_PROPERTY = "javax.xml.rpc.encodingstyle.namespace.uri";
              private static String NS_XSD = "http://www.w3.org/2001/XMLSchema";
              private static String URI_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/";
              private static final QName QNAME_TYPE_INT = new QName(NS_XSD, "int");
              private static final QName QNAME_TYPE_STRING = new QName(NS_XSD, "string");
              private static final QName QNAME_TYPE_PERSOONBEAN = new QName("urn:Foo", "PersoonBean");
              public PersoonBean isKlant(int id, String ww){
            try {
                   ServiceFactory factory = ServiceFactory.newInstance();
                   Service service = factory.createService(new QName(qnameService));
                   QName port = new QName(qnamePort);
                   Call call = service.createCall(port);
                   call.setTargetEndpointAddress(Endpointaddress);
                   call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
                   call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");
                   call.setProperty(ENCODING_STYLE_PROPERTY, URI_ENCODING);
                call.setReturnType(QNAME_TYPE_PERSOONBEAN, beans.PersoonBean.class);
                call.setOperationName(new QName(BODY_NAMESPACE_VALUE, "isKlant"));
                call.addParameter("int_1", QNAME_TYPE_INT, ParameterMode.IN);
                call.addParameter("String_2", QNAME_TYPE_STRING, ParameterMode.IN);
                Object[] params = {new Integer(id), ww };
                Object result = call.invoke(params);
                if(result!=null){
                     return (beans.PersoonBean) result;
                   }else{
                        return null;
            } catch (Exception ex) {
                ex.printStackTrace();
        }Can someone tell me how to adjust this to create an array of Beans?
    [code[
    public PersoonBean[] isFamilie(int id, String ww){

    I've been busy with this problem, but I can't find out the solution. So I hope someone can help me.
    Some more information what I've got (and done)
    My WSDL contains the following complextypes:
        <schema targetNamespace="urn:Foo" xmlns:tns="urn:Foo" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://www.w3.org/2001/XMLSchema">
          <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
          <complexType name="ArrayOfRekeningBean">
            <complexContent>
              <restriction base="soap11-enc:Array">
                <attribute ref="soap11-enc:arrayType" wsdl:arrayType="tns:RekeningBean[]"/></restriction></complexContent></complexType>
          <complexType name="RekeningBean">
            <sequence>
              <element name="nummer" type="string"/>
              <element name="persoonID" type="int"/>
              <element name="rekeningType" type="string"/>
              <element name="rente" type="double"/>
              <element name="saldo" type="double"/></sequence></complexType>
          <complexType name="PersoonBean">
            <sequence>
              <element name="ID" type="int"/>
              <element name="achternaam" type="string"/>
              <element name="geboortedag" type="int"/>
              <element name="geboortejaar" type="int"/>
              <element name="geboorteland" type="string"/>
              <element name="geboortemaand" type="int"/>
              <element name="huisnummer" type="string"/>
              <element name="land" type="string"/>
              <element name="postcode" type="string"/>
              <element name="sofinummer" type="string"/>
              <element name="straatnaam" type="string"/>
              <element name="tussenvoegsel" type="string"/>
              <element name="voorletters" type="string"/>
              <element name="woonplaats" type="string"/>
            </sequence>
          </complexType>
      </schema>The code on the server side is, besides the Rekeningbean (Simply getters and setters):
    public RekeningBean[] getRekeningen(int id, String ww) throws RemoteException{
         try{
              Context ictx = new InitialContext();
              obj = ictx.lookup("java:comp/env/ejb/DatabaseEJB");
              DatabaseHome databaseHome = (DatabaseHome ) PortableRemoteObject.narrow(obj, DatabaseHome.class);
              Database databaseBean = (Database)databaseHome.create();
              return databaseBean.getRekeningBeans(id);
         }catch(RemoteException re){
              System.out.println("RemoteException caught: " + re.getMessage());
         }catch(NamingException ne){
              System.out.println("NamingException caught: " + ne.getMessage());
         }catch(EJBException ee){
              System.out.println("EJBException caught: " + ee.getMessage());
         }catch(CreateException ce){
              System.out.println( "CreateException caught: " + ce.getMessage());
         return null;
    }This compiles, so there are no big errors in it (Databasebean is a working Enterprise Bean).
    My client code as following:
    public class MiniInternetbankClient {
         private static String Endpointaddress = "http://p12nick:8080/MiniInternetbank/MiniInternetbankKlant";
         private static String qnameService = "MiniInternetBankKlant";
         private static String qnamePort = "MiniInternetbankKlantIF";
         private static String BODY_NAMESPACE_VALUE = "urn:Foo";
         private static String ENCODING_STYLE_PROPERTY = "javax.xml.rpc.encodingstyle.namespace.uri";
         private static String NS_XSD = "http://www.w3.org/2001/XMLSchema";
         private static String URI_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/";
         private static final QName QNAME_TYPE_INT = new QName(NS_XSD, "int");
         private static final QName QNAME_TYPE_STRING = new QName(NS_XSD, "string");
         private static final QName QNAME_TYPE_PERSOONBEAN = new QName("urn:Foo", "PersoonBean");
         //private static final QName QNAME_TYPE_REKENINGBEAN = new QName("urn:Foo", "RekeningBean");
         private static final QName QNAME_TYPE_REKENINGBEAN_ARRAY = new QName("urn:Foo", "ArrayOfRekeningBean");
         public RekeningBean[] getRekeningen(int id, String ww){
              try {
                   ServiceFactory factory = ServiceFactory.newInstance();
                   Service service = factory.createService(new QName(qnameService));
                   QName port = new QName(qnamePort);
                   Call call = service.createCall(port);
                   call.setTargetEndpointAddress(Endpointaddress);
                   call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
                   call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");
                   call.setProperty(ENCODING_STYLE_PROPERTY, URI_ENCODING);
                   call.setReturnType(QNAME_TYPE_REKENINGBEAN_ARRAY, beans.RekeningBean.class);
                   call.setOperationName(new QName(BODY_NAMESPACE_VALUE, "getRekeningen"));
                   call.addParameter("int_1", QNAME_TYPE_INT, ParameterMode.IN);
                   call.addParameter("String_2", QNAME_TYPE_STRING, ParameterMode.IN);
                Object o = call.invoke(params);
                Object result[] = call.getOutputValues().toArray();
                System.out.println(result.getClass() + " " + result.length);
                if(result!=null){
                     beans.RekeningBean[] rb = new RekeningBean[result.length];
                     for(int i=0;i<result.length;i++){
                          rb[i] = (beans.RekeningBean)result;
              System.out.println(rb[i].getSaldo());
         return rb;
         }else{
              return null;
    } catch (Exception ex) {
    ex.printStackTrace();
    This code doesn't generate an error, and the output of the system.out.println is: "class [Ljava.lang.Object; 0"
    I don't know what I'm doing wrong, but can someone help me with this?

  • How to set the name for an 'unknown' file extension?

    Specifics:
    I have various file extensions that are recognized by my mac. I would like to know how to create a list of applications that can open it so I do not get a 'There is no Default Application to open this file' error. I would also like to be able to give these file extensions names recognized by the mac.
    Just like .txt is a "Textedit Document" and .html is a "HTML Document," I'd like to be able to change the name and assosication of a file and give it its own .icns if possible.
    As for the default applications, I know how to set a default application. However, if a mac does not recognize a file extension, adding a new default application to run the file wil actually erase the old one, which is a big pain, especially when your file can be opened with ANY text editor.
    I understand that this may involve hacking into the operating system's databases, but if anyone can help, it would be greatly appreciated.

    Hi Timo,
    My jdev version is 10.1.3.3.0, this is for R12. By PR i mean to say process request and PFR process form request in the controller.
    In the Process request of the controller, i am finding the checkbox bean and assigning the firepartialaction for it.
    Later in the process form request for the fired event, i am trying to handle the rendered property of the messagetextinput. Is this a right approach?
    my code below
    public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    super.processRequest(oapagecontext, oawebbean);
    OAApplicationModule oaapplicationmodule = oapagecontext.getApplicationModule(oawebbean);
    OAMessageCheckBoxBean oamessagecheckboxbean = (OAMessageCheckBoxBean)oawebbean.findChildRecursive("X_FLAG");
    if(oamessagecheckboxbean != null)
    oapagecontext.writeDiagnostics(this, "Message check box Bean found:", 1);
    FirePartialAction firepartialaction = new FirePartialAction("change");
    oamessagecheckboxbean.setAttributeValue(PRIMARY_CLIENT_ACTION_ATTR, firepartialaction);
    oamessagecheckboxbean.setFireActionForSubmit("change", null, null, true);
    oapagecontext.writeDiagnostics(this, "setting fire event", 1);
    public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    super.processFormRequest(oapagecontext, oawebbean);
    oapagecontext.writeDiagnostics(this, "Inside Process Form Request", 1);
    if("change".equals(oapagecontext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
    OAMessageTextInputBean bean = (OAMessageTextInputBean)oawebbean.findChildRecursive("X_NUMBER");
    if(bean!=null){
    bean.setRendered(Boolean.TRUE);}
    Thanks,
    Malar

  • How to set the CLASSPATH for an  Sql Server 2005 database... help me please

    Hello! Guys I want to access a Sql Server 2005 database from Java.I've downloaded the JDBC 2.0 driver from Microsoft.I've copied the sqljdbc4.jar file to C:\Java\jdk1.6.0_14\db\lib.And I've added this to the classpath C:\Java\jdk1.6.0_14\db\lib\sqljdbc4.jar.The classpath variable is defined as a user variable.Well the point is that I get that nasty exception:Exception in thread "main" java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver.So if you know how to help me,please do so.Thank you :)

    Hi Timo,
    My jdev version is 10.1.3.3.0, this is for R12. By PR i mean to say process request and PFR process form request in the controller.
    In the Process request of the controller, i am finding the checkbox bean and assigning the firepartialaction for it.
    Later in the process form request for the fired event, i am trying to handle the rendered property of the messagetextinput. Is this a right approach?
    my code below
    public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    super.processRequest(oapagecontext, oawebbean);
    OAApplicationModule oaapplicationmodule = oapagecontext.getApplicationModule(oawebbean);
    OAMessageCheckBoxBean oamessagecheckboxbean = (OAMessageCheckBoxBean)oawebbean.findChildRecursive("X_FLAG");
    if(oamessagecheckboxbean != null)
    oapagecontext.writeDiagnostics(this, "Message check box Bean found:", 1);
    FirePartialAction firepartialaction = new FirePartialAction("change");
    oamessagecheckboxbean.setAttributeValue(PRIMARY_CLIENT_ACTION_ATTR, firepartialaction);
    oamessagecheckboxbean.setFireActionForSubmit("change", null, null, true);
    oapagecontext.writeDiagnostics(this, "setting fire event", 1);
    public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    super.processFormRequest(oapagecontext, oawebbean);
    oapagecontext.writeDiagnostics(this, "Inside Process Form Request", 1);
    if("change".equals(oapagecontext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
    OAMessageTextInputBean bean = (OAMessageTextInputBean)oawebbean.findChildRecursive("X_NUMBER");
    if(bean!=null){
    bean.setRendered(Boolean.TRUE);}
    Thanks,
    Malar

  • Component level message are not coming up for the declarative component.

    Hie
    i am using ADF faces with jdev 11g.
    i have created a declarative component and dropped it in my web application.
    This component provides an action listener to write some app specific code.
    in the listener i wrote a component level error message.
    on running the app i can see that it is going to that error but it is not showing it up on the ui. same code works for other adf faces components that comes by default in the component pellete.
    I tried setting the clientComponent attribute to true as well but no luck.
    any idea if something wrong with declarative components?

    Frank,
    My declarative component is dropped on my jsff. In this pages i have dropped a af:messages as well.
    There is a small button in my component on which i have bound an action listner.
    In the action listener i have a validation on the failure condition of which i have the code like:
    if(bean == null || bean.isAuthenticated() == false){
    FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, null, "You must be logged in to vote up");
    FacesContext context = FacesContext.getCurrentInstance();
    context.addMessage(getVotingQuesComponent().getClientId(context), msg);
    AdfFacesContext.getCurrentInstance().addPartialTarget(getVotingQuesComponent());
    return;
    So, i m sure my flow is going in this part of code but i dont see the message coming up marking my declarative component.
    However, if i replace this message by a page level error message then that comes up fine.

  • Java.lang.NoSuchMethodError with JDeveloepr 10g

    HI,
    I have a problem with java.lang.NoSuchMethodError in Jdeveloper 10g. The code works fine in Jdeveloper 9iAS. I just migrated them to 10g.
    Here is the error:
    java.lang.NoSuchMethodError: java.util.ArrayList com.ncilp.intranet.CourseHelperBean.getAllCoursesByPosition(int, int)     at com.ncilp.intranet.SelectCourseForm.getCourseSelection(SelectCourseForm.java:72)     at com.ncilp.intranet.SelectCourseForm.reset(SelectCourseForm.java:55)     at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:640)     at selectcourse.jspService(_selectcourse.java:74)     [selectcourse.jsp]     at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.0.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:60)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:416)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)     at java.lang.Thread.run(Thread.java:595)
    This is source code for SelectCourseForm.java
    package com.ncilp.intranet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionError;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import java.util.*;
    public class SelectCourseForm extends ActionForm {
    private String _courseName = new String();
    public String getCourseName() {
    return _courseName;
    public void setCourseName(String courseName) {
    _courseName = courseName;
    private int _courseId = 0;
    public int getCourseId() {
    return _courseId;
    public void setCourseId(int courseId){
    _courseId = courseId;
    private Hashtable pageMap = new Hashtable();
    public Hashtable getPageMap() {
    return this.pageMap;
    public void setPageMap(Hashtable pgMap) { this.pageMap = pgMap; }
    private ArrayList courseLists;
    public ArrayList getCourseLists()
    return this.courseLists;
    public void setCourseLists(ArrayList courses)
    this.courseLists = courses;
    public void reset(ActionMapping mapping, HttpServletRequest request) {
    UserEntityBean userDB = (UserEntityBean)request.getSession().getAttribute("userDB");
    getCourseSelection(request, userDB.getPositionid());
    super.reset(mapping, request);
    public ActionErrors validate(ActionMapping mapping,
    HttpServletRequest request) {
    return super.validate(mapping, request);
    private void getCourseSelection(HttpServletRequest request,int positionId)
    try{
    CourseHelperBean courseBean = new CourseHelperBean();
    Integer userId = (Integer)request.getSession().getAttribute("UserId");
    ArrayList courseList;
    courseList = courseBean.getAllCoursesByPosition(positionId, userId.intValue()); this.courseLists = courseList;
    request.getSession().setAttribute("courseOptions", courseList);
    catch(Exception ex)
    ex.printStackTrace();
    This is part of source code of CourseHelperBean.java
    package com.ncilp.intranet;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    import java.io.*;
    import java.util.*;
    import java.text.*;
    import java.sql.*;
    import javax.sql.*;
    import javax.naming.*;
    public class CourseHelperBean
    public CourseHelperBean()
    * get course info by courseid
    public CourseEntityBean getCourse(int courseid)
    throws IOException, SQLException, NamingException {
    CourseEntityBean object = null;
    // Get a connection.
    Connection conn = DBUtil.getConnection(jdbcEntry);
    StringBuffer st = new StringBuffer( "select title, course_order, description, language from intra_course where courseid = :1 ");
    // Create the prepared statement.
    PreparedStatement stmt = conn.prepareStatement( st.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY );
    //Bind variable
    stmt.setInt(1, courseid);
    // Execute the query.
    ResultSet rs = stmt.executeQuery();
    String title = null;
    String number = null;
    String description = null;
    String language = null;
    if( rs != null && rs.first() )
    title = rs.getString( 1 );
    title = rs.getString( 2 );
    description = rs.getString( 3 );
    language = rs.getString( 4 );
    object = new CourseEntityBean( courseid,
    title,
    number,
    description,
    language,
    null
    rs.close();
    stmt.close();
    conn.close();
    return object;
    * get all courses needed to be taken for positionid
    public ArrayList getAllCoursesByPosition(int positionid, int userid)
    throws IOException, SQLException, NamingException {
    ArrayList beans = null;
    SectionHelperBean sectionBean = new SectionHelperBean();
    // Get the connection
    Connection conn = DBUtil.getConnection(jdbcEntry);
    StringBuffer st = new StringBuffer( "select a.courseid, a.title, a.course_order, a.description, a.language ");
    st.append( " from intra_course a, intra_position_course b ");
    st.append( " where b.course_id = a.courseid and b.position_id = :1 ");
    st.append( " order by course_order ");
    // Create the prepared statement.
    PreparedStatement stmt = conn.prepareStatement( st.toString() );
    // Bind the params.
    stmt.setInt( 1, positionid );
    // Execute the query.
    ResultSet rs = stmt.executeQuery();
    int courseid = 0;
    String title = null;
    String number = null;
    String description = null;
    String language = null;
    String status = null;
    ArrayList sections = null;
    beans = new ArrayList( rs.getFetchSize() );
    if( rs != null )
    while( rs.next() ) {
    courseid = rs.getInt( 1 );
    title = rs.getString( 2 );
    number = rs.getString( 3 );
    description = rs.getString( 4 );
    language = rs.getString( 5 );
    sections = sectionBean.getAllSectionByCourse(courseid, userid);
    if( sections.size() == 0 )
    status = "Done";
    else
    status = "Not Done";
    beans.add(new CourseEntityBean( courseid,
    title,
    number,
    description,
    language,
    status
    rs.close();
    stmt.close();
    conn.close();
    return beans;
    These two classes are in the same directory, same package. Can anyone tell me what's wrong? How to fix it?
    Thank you very much.
    Juan

    Hi,
    did you recompile the application ?
    Frank

  • How do I get the rowid or the DataModel from a DataTable inside a DataTable

    Hi,
    I have a simple application which I cannot get to work.
    I have two entity classes: Parent and Child.
    I want to create a page which lists all of the Parents, and in a column of the Parent row has an inner dataTable which displays the Children of the Parent. I then want to click on the Child and link to a view of that Child. What is happening is that I cannot resolve which child was clicked inside my row. I don't seem to be able to get the datamodel for the List children, so it always defaults to the first child in the list.
    Goal: drill down to a specific child from a list of parents with a sublist of children belonging to each parent.
    I have tried creating a new method called prepareChildView() in ParentController like this below but it always returns the first child. I figure I need to create the DataModel earlier but cannot figure out how to do this. Perhaps the auto generated pattern makes it difficult to achieve what I want to - not sure.
    public String prepareChildView() {
            current = (Parent)getItems().getRowData();
            DataModel d = new ListDataModel(current.getChildren());
            Child child = (Child)d.getRowData();
            //child is always the first child!
            return "\children\View";
        }I may be going about this completely wrong so am open to suggestions. I am using JSF2, Glassfish3.0.
    Parent.java
    @Entity
    public class Parent implements Serializable {
        @OneToMany(mappedBy = "parent", cascade = CascadeType.ALL)
        private List<Child> children;
        public List<Child> getChildren() {
            return children;
        public void setChildren(List<Child> children) {
            this.children = children;
    }Child.java
    @Entity
    public class Child implements Serializable {
        @ManyToOne
        @JoinColumn(name = "parent")
        private Parent parent;
        public Parent getParent() {
            return parent;
        public void setParent(Parent parent) {
            this.parent = parent;
    }ParentFacade and ChildFacade are auto generated from NetBeans, as are ParentController and ChildController.
    ParentController:
    Code doen't fit in the post.
    List.xhtml
    <h:form styleClass="jsfcrud_list_form">
                <h:panelGroup id="messagePanel" layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                </h:panelGroup>
                <h:outputText escape="false" value="#{bundle.ListParentEmpty}" rendered="#{parentController.items.rowCount == 0}"/>
                <h:panelGroup rendered="#{parentController.items.rowCount > 0}">
                    <h:outputText value="#{parentController.pagination.pageFirstItem + 1}..#{parentController.pagination.pageLastItem + 1}/#{parentController.pagination.itemsCount}"/> 
                    <h:commandLink action="#{parentController.previous}" value="#{bundle.Previous} #{parentController.pagination.pageSize}" rendered="#{parentController.pagination.hasPreviousPage}"/> 
                    <h:commandLink action="#{parentController.next}" value="#{bundle.Next} #{parentController.pagination.pageSize}" rendered="#{parentController.pagination.hasNextPage}"/> 
                    <h:dataTable value="#{parentController.items}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Id"/>
                            </f:facet>
                            <h:outputText value="#{item.id}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Name"/>
                            </f:facet>
                            <h:outputText value="#{item.name}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Children" />
                            </f:facet>
                            <h:dataTable value="#{item.children}" var="child" >
                                <h:column>
                                    <h:commandLink action="#{parentController.prepareView}" value="#{child.name}" />
                                </h:column>
                            </h:dataTable>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value=" "/>
                            </f:facet>
                            <h:commandLink action="#{parentController.prepareView}" value="#{bundle.ListParentViewLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{parentController.prepareEdit}" value="#{bundle.ListParentEditLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{parentController.destroy}" value="#{bundle.ListParentDestroyLink}"/>
                        </h:column>
                    </h:dataTable>
                </h:panelGroup>
                <br />
                <h:commandLink action="#{parentController.prepareCreate}" value="#{bundle.ListParentCreateLink}"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.ListParentIndexLink}" action="/index" immediate="true" />
            </h:form>

    Hi,
    It will help to resolve your issue:
        public String processChildView(){
            UIComponent component = null;
            String  componentId = null;
            Parent parent = null; //Bean class
            Child child = null; //Bean Class
            FacesContext context = FacesContext.getCurrentInstance();
            UIViewRoot root = context.getViewRoot();
            String childView = "childView";
            //Parent Table UIData
            componentId = "parentChildTable";
            component = findComponent(root, componentId);               
            UIData parentTable = (UIData) component;
            //Child Table UIData
            componentId = "childTable";
            component = findComponent(root, componentId);               
            UIData childTable = (UIData) component;
            //Perform Parent Child operation
            if(parentTable != null && childTable != null){
                if(parentTable.getRowData() instanceof Parent){
                    //Get Parent Object from parentTable
                    parent = (Parent) parentTable.getRowData();
                    //Get child object by parent object using childTable's Row Index
                    parent = (Parent) parentTable.getRowData();
                    child = (Child) parent.getChild().get(childTable.getRowIndex());
                    System.out.println("Parent Name " + parent.getName() + "Child Name " + child.getName());
            return childView;
        //Utility method to get component by passing component id in requested view
        public static UIComponent findComponent(UIComponent c, String id) {
             if (id.equals(c.getId())) {
               return c;
             Iterator kids = c.getFacetsAndChildren();
             while (kids.hasNext()) {
               UIComponent found = (UIComponent) findComponent((UIComponent)kids.next(), id);
               if (found != null) {
                 return found;
             return null;
      } Regards,
    Manish Paliwal
    "Life is beautifull."

  • Creating new Auto-Suggest Component

    Hi,
    I am new to ADF and looking for Auto-Suggest options. Found Franks code and it was really heplful.
    We tried to create a new component based on this but not able to use multiple components of the type on the same page/form.The problem we are thinking of is because of the popup having the same id for all the components we embed in.If we attach 3 components of this type to a form then one of the random ones work as per logic and other 2 not doing any pop ups at all.
    Could you please help us to resolve this please?
    Thanks
    Subha
    CODE
    suggestComponentModel.java
    package com.dstintl.ic.ui.component.suggestbox;
    import java.util.List;
    public interface SuggestComponentModel{
    * Method called to filter data shown in the suggest list. Initial
    * request is made with inMemory = false. If in memory sorting is
    * enabled then all subsequent calls are made passing trues as the
    * value for the inMemory parameter. Implementations may decid to
    * ignore the inMemory argument and always query the data source.
    public List<String> filteredValues(String filterCriteria,
    boolean inMemory);
    SuggestBoxTag.java+
    package com.dstintl.ic.ui.component.suggestbox;
    import javax.el.ValueExpression;
    import oracle.adf.view.rich.component.rich.fragment.RichDeclarativeComponent;
    import oracle.adfinternal.view.faces.taglib.region.RichDeclarativeComponentTag;
    import org.apache.myfaces.trinidad.bean.FacesBean;
    * ICDateComponent tag class.
    public class SuggestBoxTag extends RichDeclarativeComponentTag {
         /*input text properties*/
    private ValueExpression styleClass;
    private ValueExpression label;
    private ValueExpression required;
    private ValueExpression displayWidth;
    private ValueExpression maximumLength;
    private ValueExpression tooltip;
    private ValueExpression disabled;
    /*popup properties*/
    private ValueExpression itemList;
    * {@inheritDoc}
    @Override
    protected String getViewId() {
    return "/component/SuggestBox.jspx";
    * {@inheritDoc}
    @Override
    protected RichDeclarativeComponent createComponent() {
    return new SuggestBox();
    * {@inheritDoc}
    @Override
    public void release() {
    super.release();
    label = null;
    * {@inheritDoc}
    @Override
    protected void setProperties(final FacesBean bean) {
    super.setProperties(bean);
    /*Input text box properties*/
    if (label != null) {
    bean.setValueExpression(SuggestBox.LABEL_KEY, label);
    if (styleClass != null) {
    bean.setValueExpression(SuggestBox.STYLE_CLASS_KEY, styleClass);
    if (required != null) {
    bean.setValueExpression(SuggestBox.REQUIRED_KEY, required);
    if (displayWidth != null) {
    bean.setValueExpression(SuggestBox.DISPLAY_WIDTH_KEY, displayWidth);
    if (maximumLength != null) {
    bean.setValueExpression(SuggestBox.MAXIMUM_LENGTH_KEY, maximumLength);
    if (tooltip != null) {
    bean.setValueExpression(SuggestBox.TOOLTIP_KEY, tooltip);
    if (disabled != null) {
    bean.setValueExpression(SuggestBox.DISABLED_KEY, disabled);
    if (itemList != null) {
    bean.setValueExpression(SuggestBox.POPUP_SELECTITEMLIST_KEY, itemList);
    * @return label
    public ValueExpression getLabel() {
    return label;
    * @param label
    * label
    public void setLabel(ValueExpression label) {
    this.label = label;
    * @return style class.
    public ValueExpression getStyleClass() {
    return styleClass;
    * @param styleClass
    * style class.
    public void setStyleClass(ValueExpression styleClass) {
    this.styleClass = styleClass;
    * @param required
    * required.
         public void setrequired(ValueExpression required) {
              this.required = required;
    * @return required .
         public ValueExpression getrequired() {
              return required;
    * @param displayWidth
    * displayWidth.
         public void setDisplayWidth(ValueExpression displayWidth) {
              this.displayWidth = displayWidth;
    * @return displayWidth .
         public ValueExpression getDisplayWidth() {
              return displayWidth;
    * @param maximumLength
    * maximumLength.
         public void setmaximumLength(ValueExpression maximumLength) {
              this.maximumLength = maximumLength;
    * @return maximumLength .
         public ValueExpression getmaximumLength() {
              return maximumLength;
    * @param tooltip
    * tooltip.
         public void setTooltip(ValueExpression tooltip) {
              this.tooltip = tooltip;
    * @return tooltip .
         public ValueExpression getTooltip() {
              return tooltip;
    * @param disabled
    * disabled.
         public void setDisabled(ValueExpression disabled) {
              this.disabled = disabled;
    * @return disabled .
         public ValueExpression getDisabled() {
              return disabled;
    * @param itemList
    * itemList.
         public void setItemList(ValueExpression itemList) {
              this.itemList = itemList;
    * @return itemList .
         public ValueExpression getItemList() {
              return itemList;
    SuggestBox.java+
    package com.dstintl.ic.ui.component.suggestbox;
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.component.UIComponent;
    import javax.faces.model.SelectItem;
    import oracle.adf.view.rich.component.rich.fragment.RichDeclarativeComponent;
    import oracle.adf.view.rich.component.rich.input.RichSelectOneListbox;
    import oracle.adf.view.rich.context.AdfFacesContext;
    import oracle.adf.view.rich.render.ClientEvent;
    import org.apache.myfaces.trinidad.bean.PropertyKey;
    * suggestBox.
    public class SuggestBox extends RichDeclarativeComponent {
    /** label. **/
    public static final PropertyKey LABEL_KEY = PropertyKey.createPropertyKey("label");
    /** styleClass **/
    public static final PropertyKey STYLE_CLASS_KEY = PropertyKey.createPropertyKey("styleClass");
    /** required **/
    public static final PropertyKey REQUIRED_KEY = PropertyKey.createPropertyKey("required");
    /** displayWidth **/
    public static final PropertyKey DISPLAY_WIDTH_KEY = PropertyKey.createPropertyKey("displayWidth");
    /** precision **/
    public static final PropertyKey MAXIMUM_LENGTH_KEY = PropertyKey.createPropertyKey("maximumLength");
    /** toolTip **/
    public static final PropertyKey TOOLTIP_KEY = PropertyKey.createPropertyKey("tooltip");
    /**disabled **/
    public static final PropertyKey DISABLED_KEY = PropertyKey.createPropertyKey("disabled");
    /** itemList **/
    public static final PropertyKey POPUP_SELECTITEMLIST_KEY = PropertyKey.createPropertyKey("itemList");
    * Constructor.
    public SuggestBox() {
    * Gets the value set to the <code>label</code> attribute.
    * @return String label.
    public String getLabel() {
    String t = (String) getAttributes().get("label");
    return t;
    * Gets the value set to the <code>styleClass</code> attribute.
    * @return String styleClass.
    public String getStyleClass() {
    String t = (String) getAttributes().get("styleClass");
    return t;
    * Gets the value set to the <code>required</code> attribute.
    * @return b.
    public boolean getrequired() {
    Boolean b = (Boolean) getAttributes().get("required");
    return b;
    * Gets the value set to the <code>displayWidth</code> attribute.
    * @return String displayWidth.
    public String getDisplayWidth() {
    String t = (String) getAttributes().get("displayWidth");
    return t;
    * Gets the value set to the <code>precision</code> attribute.
    * @return String precision.
    public String getMaximumLength() {
    String t = (String) getAttributes().get("maximumLength");
    return t;
    * Gets the value set to the <code>toolTip</code> attribute.
    * @return String styleClass.
    public String getToolTip() {
    String t = (String) getAttributes().get("tooltip");
    return t;
    * Gets the value set to the <code>disabled</code> attribute.
    * @return b.
    public boolean getDisabled() {
    Boolean b = (Boolean) getAttributes().get("disabled");
    return b;
    * Main popUp functionality.
         /**Get popUpId label */
    private String popUpLabel;
    public void setPopUpLabel(String popUpLabel) {
              this.popUpLabel = popUpLabel;
         public String getPopUpLabel() {
              this.popUpLabel =(String) getAttributes().get("label");
              return popUpLabel;
    /** fullitemList from the binding **/
    private List<SelectItem> fullitemList;
    /** suggestedList - to populate list of suggestions squeezed from the fullitemList **/
    private List<SelectItem> suggestedList = new ArrayList<SelectItem>();
    /** suggestListBox - attached to the Main popUp RichSelectOneListbox**/
    private RichSelectOneListbox suggestListBox;
    * sets suggestListBox
         public void setSuggestListBox(RichSelectOneListbox suggestListBox) {
              this.suggestListBox = suggestListBox;
    * gets suggestListBox
    * @return suggestListBox
         public RichSelectOneListbox getSuggestListBox() {
              return suggestListBox;
    * Sets suggested list on the selectOneListbox component
    * @param suggestedList
    * suggestedList.
         public void setSuggestedList(List<SelectItem> suggestedList) {
              this.suggestedList = suggestedList;
    * Retrieves the list from the bindings and
    * initialise suggestedList with the full list(only done during initialisation)
    * @return suggestedList.
         public List<SelectItem> getSuggestedList() {
              if(fullitemList == null){
                   fullitemList = new ArrayList<SelectItem>();
         List<SelectItem> result = (List<SelectItem>) getAttributes().get("itemList");
         this.fullitemList.addAll(result);
         this.suggestedList.addAll(result);
              return suggestedList;
    * doFilterList - On Every user keystroke in the suggest input field, the browser client calls
    * the doFilterList method through the af:serverListerner component
    * af:selectoneListbox (popup) is refreshed at the end of each call to the doFileterList so that
    * new list value is populated.
    * @param clientEvent
    public void doFilterList(ClientEvent clientEvent) {
         if(suggestListBox == null) {
              UIComponent uic = clientEvent.getComponent();
              suggestListBox = (RichSelectOneListbox) uic.getChildren().get(0);
    // set the content for the suggest list
    String srchString = (String)clientEvent.getParameters().get("filterString");
    this.suggestedList.clear();
    for(SelectItem item : fullitemList) {
         if( item.getLabel().contains(srchString)){
         this.suggestedList.add(item);
    AdfFacesContext.getCurrentInstance().addPartialTarget(suggestListBox);
    SuggestBox.jspx+
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
         <jsp:directive.page contentType="text/html;charset=windows-1252" />
         <af:componentDef var="attrs" componentVar="component">
    <af:document>
    <f:facet name="metaContainer">
    <af:group>
    <![CDATA[
    <script>
    function handleKeyUpOnSuggestField(evt){
    // start the popup aligned to the component that launched it
    suggestPopup = evt.getSource().findComponent("suggestPopup");
    inputField = evt.getSource();
    //don't open when user "tabs" into field
    if (suggestPopup.isShowing() == false &&
    evt.getKeyCode()!= AdfKeyStroke.TAB_KEY){
    hints = {align:AdfRichPopup.ALIGN_AFTER_START, alignId:evt.getSource().getClientId()+"::content"};
    suggestPopup.show(hints);
    //disable popup hide to avoid popup to flicker on
    //key press
    suggestPopup.hide = function(){}
    //suppress server access for the following keys
    //for better performance
    if (evt.getKeyCode() == AdfKeyStroke.ARROWLEFT_KEY ||
    evt.getKeyCode() == AdfKeyStroke.ARROWRIGHT_KEY ||
    evt.getKeyCode() == AdfKeyStroke.ARROWDOWN_KEY ||
    evt.getKeyCode() == AdfKeyStroke.SHIFT_MASK ||
    evt.getKeyCode() == AdfKeyStroke.END_KEY ||
    evt.getKeyCode() == AdfKeyStroke.ALT_KEY ||
    evt.getKeyCode() == AdfKeyStroke.HOME_KEY) {
    return false;
    if (evt.getKeyCode() == AdfKeyStroke.ESC_KEY){
    hidePopup(evt);
    return false;
    // get the user typed values
    valueStr = inputField.getSubmittedValue();
    // query suggest list on the server
    AdfCustomEvent.queue(suggestPopup,"suggestServerListener",
    // Send single parameter
    {filterString:valueStr},true);
    // put focus back to the input text field
    setTimeout("inputField.focus();",400);
    //TAB and ARROW DOWN keys navigate to the suggest popup
    //we need to handle this in the key down event as otherwise
    //the TAB doesn't work
    function handleKeyDownOnSuggestField(evt){               
    if (evt.getKeyCode() == AdfKeyStroke.ARROWDOWN_KEY) {                   
    selectList = evt.getSource().findComponent("suggestListBox");
    selectList.focus();
    return false;
    else{
    return false;
    //method called when pressing a key or a mouse button
    //on the list
    function handleListSelection(evt){
    if(evt.getKeyCode() == AdfKeyStroke.ENTER_KEY ||
    evt.getType() == AdfUIInputEvent.CLICK_EVENT_TYPE){                                          
    var list = evt.getSource();
    evt.cancel();
    var listValue = list.getProperty("value");
    hidePopup(evt);
    inputField = evt.getSource().findComponent("suggestField");
    inputField.setValue(listValue);
    //cancel dialog
    else if (evt.getKeyCode() == AdfKeyStroke.ESC_KEY){
    hidePopup(evt);
    //function that re-implements the node functionality for the
    //popup to then call it
    function hidePopup(evt){
    var suggestPopup = evt.getSource().findComponent("suggestPopup");
    //re-implement close functionality
    suggestPopup.hide = AdfRichPopup.prototype.hide;
    suggestPopup.hide();
    </script>
    ]]>
    </af:group>
    </f:facet>
    <af:messages/>
    </af:document>
         <!-- START Suggest Field -->
         <af:inputText id="suggestField"
         clientComponent="true"
         disabled="#{attrs.disabled}"
         label="#{attrs.label}"
         required="#{attrs.required}"
         columns="#{attrs.displayWidth}"
         maximumLength="#{attrs.maximumLength}"
         styleClass="#{attrs.styleClass}"
         shortDesc="#{attrs.tooltip}">
         <af:clientListener method="handleKeyUpOnSuggestField"
                             type="keyUp"/>
         <af:clientListener method="handleKeyDownOnSuggestField"
         type="keyDown"/>
         </af:inputText>
         <!-- END Suggest Field -->
         <!-- START Suggest popUp -->
    <af:popup id="suggestPopup" contentDelivery="immediate" animate="false" clientComponent="true" >
         <af:selectOneListbox id="suggestListBox" contentStyle="width: 250px;"
         size="5" valuePassThru="true">
         <f:selectItems value="#{component.suggestedList}"/>
         <af:clientListener method="handleListSelection" type="keyUp"/>
         <af:clientListener method="handleListSelection" type="click"/>
         </af:selectOneListbox>
         <af:serverListener type="suggestServerListener"
         method="#{component.doFilterList}"/>
    </af:popup>
         <!-- END Suggest popUp -->
    <af:xmlContent>
                   <component xmlns="http://xmlns.oracle.com/adf/faces/rich/component">
    <display-name>suggestBox</display-name>
    <attribute>
    <attribute-name>id</attribute-name>
    </attribute>
                        <attribute>
    <attribute-name>label</attribute-name>
    </attribute>
    <component-extension>
    <component-tag-namespace>com.dstintl.ic.ui.component</component-tag-namespace>
    <component-taglib-uri>/com/dstintl/ic/ui/component</component-taglib-uri>
    </component-extension>
    </component>
    </af:xmlContent>
    </af:componentDef>
    </jsp:root>
    component.tld+
    <?xml version="1.0" encoding="windows-1252"?>
    <taglib xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd" version="2.1" xmlns="http://java.sun.com/xml/ns/javaee">
         <display-name>component</display-name>
         <tlib-version>1.0</tlib-version>
         <short-name>component</short-name>
         <uri>/com/dstintl/ic/ui/component</uri>
         <!--
              Component Name: SuggestBox Description: AutoSuggest or AutoComplete - shows a list of vales
              in a drop down list that is filtered by the user input in the input text field.
         -->
         <tag>
              <name>SuggestBox</name>
              <tag-class>com.dstintl.ic.ui.component.suggestbox.SuggestBoxTag</tag-class>
              <body-content>JSP</body-content>
              <attribute>
                   <name>label</name>
                   <required>false</required>
                   <deferred-value/>
              </attribute>
              <attribute>
                   <name>styleClass</name>
                   <required>false</required>
                   <deferred-value/>
              </attribute>
              <attribute>
                   <name>disabled</name>
                   <required>false</required>
                   <deferred-value/>
              </attribute>
              <attribute>
                   <name>required</name>
                   <required>false</required>
                   <deferred-value>
                        <type>boolean</type>
                   </deferred-value>
              </attribute>
              <attribute>
                   <name>displayWidth</name>
                   <required>false</required>
                   <deferred-value/>
              </attribute>
              <attribute>
                   <name>maximumLength</name>
                   <required>false</required>
                   <deferred-value/>
              </attribute>
              <attribute>
                   <name>tooltip</name>
                   <required>false</required>
                   <deferred-value/>
              </attribute>
              <attribute>
                   <name>itemList</name>
                   <required>false</required>
                   <deferred-value/>
              </attribute>
         </tag>
    </taglib>

    Hi Subha,
    you can distinct the different components using clientAttribute tag with clientListener
    <af:inputText id="suggestField" .....>
    <af:clientListener method="handleKeyUpOnSuggestField" type="keyUp"/>
    <af:clientListener ......"/>
    <af:*clientAttribute* name="eventName" value="myCustomEvent"/>
    <af:*clientAttribute* name="popupId" value="......"/>
    </af:inputText>
    in javascript you get the eventName or PopuId from the attribute
    component = event.getSource();
    var eventName = component.*getProperty* ("eventName");
    // Call the server
    AdfCustomEvent.queue(popup, *eventName*, ......);
    var popupId = component.*getProperty* ("popuId");
    var popup = AdfPage.PAGE.findComponent(popupId);
    Hope this help,
    Maroun

  • Parser-independent document creation with JAXP?

    Is it possible to do the following in a parser-independent
    way with JAXP apis? Thanks
    DOMImplementation domImpl =
    new org.apache.xerces.dom.DOMImplementationImpl();
    org.apache.xerces.dom.DocumentTypeImpl docTypeImpl
    = new org.apache.xerces.dom.DocumentTypeImpl(null, "bean", null, null);
    docTypeImpl.setInternalSubset(
    "<!ELEMENT bean (property*)>" + NL +
    "<!ELEMENT property (#PCDATA)>" + Format.NL +
    "<!ATTLIST bean className CDATA #REQUIRED>" + NL +
    "<!ATTLIST property type CDATA #REQUIRED>" + NL +
    "<!ATTLIST property name CDATA #REQUIRED>"
    Document doc = domImpl.createDocument(null, "bean", docTypeImpl);
    Element root = doc.getDocumentElement();
    // add elements etc.

    Hi,
    Its is possible thru the following code.
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setValidating(true);
    dbf.setNamespaceAware(true);
    DocumentBuilder db = dbf.newDocumentBuilder();
    DOMImplementation domImpl = db.getDOMImplementation();
    DocumentType docType = domImpl.createDocumentType("PERSON",null,strSystemID);
    document = domImpl.createDocument(null,"STUDENT",docType);and use the javax.xml.transformer api to transform this in memory java dom object to xml.
    Regards / Rajan Kumar

Maybe you are looking for

  • Is there a way to track application use on the iPad?

    Is there is a way to track use of application on iPad devices? For example, using the iPad to play games during business and/or client meetings. The only thing I could find were crash dumps in the diagnostics & usage section, but my superiors would l

  • JRE jar caching - is there any trick to ignore IP address?

    Hello, I'm a developer of GUI solutions for TV and Radio transmitter networks. In a current project TV-Stations are accessible via Web Browser with (relatively large) applets embedded in HTML pages. We are using JRE Plugin V6.x, the applets are the k

  • I lost my apps and can't open my files

    OMG I'm driving myself crazy, someone please help me imac, Processor 3.2 GHZ Intel Core i3, Memomry 16 GB 1333 MHz DDR3 My father gave his imac for christmas which was very exciting and joyful I decided to change the username of the administrator acc

  • How do I view folders in the aperture library through finder?

    How do I view folders in the aperture library. If I look in my pictures I have the applibrary there but can't access it. If I click on it it opens Aperture and I can't find a way to find the info throught aperture either.

  • Import videos from extension .mod (MPEG-2)

    I´m a new Mac user. I have a JVC digital video camera (JVC GZ-MC200), whose video extensions are .mod, and according to the manual are MPEG.2 files. The camera comes with a drive for Windows but not for Mac. iPhoto recognised and imported all the pho