This discussion is archived
1 2 3 4 Previous Next 55 Replies Latest reply: Dec 18, 2012 1:52 AM by adf009 Go to original post RSS
  • 45. Re: cascading lov using bean not passing selected parameter value
    adf009 Explorer
    Currently Being Moderated
    i deburg my code,i found out somewhere how the second for loop is not geting PRIV code from iterator,but i don't know why because i do have PRIV code in my table database
        public TestBean() {
            
            OrgTypeList = new ArrayList<OrgTypeBean>();
            OrgSubList = new ArrayList<OrgSubType>();
           
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
            BindingContainer bindings2 = BindingContext.getCurrent().getCurrentBindingsEntry();
            //access the name of the iterator the table is bound to. 
            DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("LutOrgsubtypesView1Iterator");
            DCIteratorBinding dciter2 = (DCIteratorBinding) bindings2.get("LutOrganisationtypesView1Iterator");
           // List<SelectItem> selectItems = new ArrayList<SelectItem>();
           for (Row r1 : dciter2.getAllRowsInRange()){
              
                   OrgTypeBean otype = new OrgTypeBean();
                                otype.setOrgType((String)r1.getAttribute("Organisationtypecode")); 
                                System.out.println("Orgtype " + otype.getOrgType());
                                otype.setDescription((String)r1.getAttribute("Description"));                                    
                    OrgTypeList.add(otype);
           }
                              
                                    for (Row r : dciter.getAllRowsInRange()){                
                    OrgSubType org = new OrgSubType();
                               //otype.setOrgType((String)r1.getAttribute("Organisationtypecode")); 
                                org.setOrgSubType((String)r.getAttribute("Organisationtypecode"));
                                System.out.println("Orgtypefromsub " + org.getSubOrgType());        
                                org.setOrgSubTypeName((String)r.getAttribute("Orgsubtypename"));                           
                                org.setOrgSubCode((String)r.getAttribute("Orgsubtypecode"));
            OrgSubList.add(org);
                                }
           
           
        }
    when i debug i got this print out
    Orgtype GOVT
    Orgtype PRIV
    Orgtypefromsub GOVT
    Orgtypefromsub GOVT
    Orgtypefromsub GOVT
    Orgtypefromsub GOVT
    Orgtypefromsub GOVT
    Orgtypefromsub GOVT
    Orgtypefromsub GOVT
    Orgtypefromsub GOVT
    Orgtypefromsub GOVT
    Orgtypefromsub GOVT

    hi can someone recreate the problem and insert some sample data and use my bean and see where am geting it wrong,this are table i used,i just what to make cascading LOV BASED ON the first table selection using a bean,my previous post got a bean code
    CREATE TABLE LUT_ORGSUBTYPES
      (
        ORGSUBTYPECODE       CHAR(50 BYTE) NOT NULL ENABLE,
        ORGSUBTYPENAME       VARCHAR2(60 BYTE) NOT NULL ENABLE,
        ORGANISATIONTYPECODE CHAR(5 BYTE) NOT NULL ENABLE,
        CONSTRAINT LUT_ORGSUBTYPE_PK PRIMARY KEY (ORGSUBTYPECODE)
        CONSTRAINT ORGANISATIONTYPE_ORGSUB_FK FOREIGN KEY (ORGANISATIONTYPECODE) REFERENCES LUT_ORGANISATIONTYPES (ORGANISATIONTYPECODE) ENABLE
      )
      
      CREATE TABLE LUT_ORGANISATIONTYPES
      (
        ORGANISATIONTYPECODE CHAR(5 BYTE) NOT NULL ENABLE,
        DESCRIPTION         VARCHAR2(66 BYTE) NOT NULL ENABLE,
        CONSTRAINT LUT_ORGANISATIONTYPE_PK PRIMARY KEY (ORGANISATIONTYPECODE)
      )
    CREATE TABLE ORGSUBTYPES
      (
        ORGSUBTYPECODE       CHAR(50 BYTE) NOT NULL ENABLE,
        ORGSUBTYPENAME       VARCHAR2(60 BYTE) NOT NULL ENABLE,
        ORGANISATIONTYPECODE CHAR(5 BYTE) NOT NULL ENABLE,
        CONSTRAINT ORGSUBTYPE_PK PRIMARY KEY (ORGSUBTYPECODE)
        CONSTRAINT ORGANISATIONTYPE_ORGSUB_FK FOREIGN KEY (ORGANISATIONTYPECODE) REFERENCES ORGANISATIONTYPES (ORGANISATIONTYPECODE) ENABLE
      )
      
      CREATE TABLE ORGANISATIONTYPES
      (
        ORGANISATIONTYPECODE CHAR(5 BYTE) NOT NULL ENABLE,
        DESCRIPTION         VARCHAR2(66 BYTE) NOT NULL ENABLE,
        CONSTRAINT ORGANISATIONTYPE_PK PRIMARY KEY (ORGANISATIONTYPECODE)
      )
      
    Insert into ORGSUBTYPES (ORGSUBTYPECODE,ORGSUBTYPENAME,ORGANISATIONTYPECODE) values ('Sole Proprietorship                               ','Agriculture, Forestry & Fisheries','GOVT ');
    Insert into ORGSUBTYPES (ORGSUBTYPECODE,ORGSUBTYPENAME,ORGANISATIONTYPECODE) values ('DAC                                               ','Arts & Culture','GOVT ');
    Insert into ORGSUBTYPES (ORGSUBTYPECODE,ORGSUBTYPENAME,ORGANISATIONTYPECODE) values ('DBE                                               ','Basic Education','GOVT ');
    Insert into ORGSUBTYPES (ORGSUBTYPECODE,ORGSUBTYPENAME,ORGANISATIONTYPECODE) values ('DCSP                                              ','Civilian Secretariat of Police','GOVT ');
    Insert into ORGSUBTYPES (ORGSUBTYPECODE,ORGSUBTYPENAME,ORGANISATIONTYPECODE) values ('DCOM                                              ','Communications','GOVT ');
    Insert into ORGSUBTYPES (ORGSUBTYPECODE,ORGSUBTYPENAME,ORGANISATIONTYPECODE) values ('DCG                                               ','Cooperative Governance','GOVT ');
    Insert into ORGSUBTYPES (ORGSUBTYPECODE,ORGSUBTYPENAME,ORGANISATIONTYPECODE) values ('DCS                                               ','Correctional Services','PRIV ');
    Insert into ORGSUBTYPES (ORGSUBTYPECODE,ORGSUBTYPENAME,ORGANISATIONTYPECODE) values ('CC                                                ','Closed Corporation','PRIV ');
    Insert into ORGSUBTYPES (ORGSUBTYPECODE,ORGSUBTYPENAME,ORGANISATIONTYPECODE) values ('DOD                                               ','Defence','GOVT ');
    Insert into ORGSUBTYPES (ORGSUBTYPECODE,ORGSUBTYPENAME,ORGANISATIONTYPECODE) values ('LA                                                ','LAW','PRIV ');
    Insert into ORGSUBTYPES (ORGSUBTYPECODE,ORGSUBTYPENAME,ORGANISATIONTYPECODE) values ('PVT                                               ','Private Limited','PRIV ');
    Insert into ORGANISATIONTYPES (ORGANISATIONTYPECODE,DESCRIPTION) values ('GOVT ','Government');
    Insert into ORGANISATIONTYPES (ORGANISATIONTYPECODE,DESCRIPTION) values ('PRIV ','Private');
    Edited by: adf0994 on 2012/11/16 9:33 AM

    Edited by: adf0994 on 2012/11/23 12:50 PM
  • 46. Re: cascading lov using bean not passing selected parameter value
    user404 Pro
    Currently Being Moderated
    Instead of printing the code, you should print the company name or something else that a (+-) unique identifier.
  • 47. Re: cascading lov using bean not passing selected parameter value
    adf009 Explorer
    Currently Being Moderated
    am lost now what do you mean i must print company name which company
  • 48. Re: cascading lov using bean not passing selected parameter value
    user404 Pro
    Currently Being Moderated
    Instead of the subordtype :
    System.out.println("Orgtypefromsub " + org.getSubOrgType());

    Print out the 'ORGSUBTYPENAME'
  • 49. Re: cascading lov using bean not passing selected parameter value
    adf009 Explorer
    Currently Being Moderated
    ok when the page load i get this printout
    Orgtype GOVT
    Orgtypepriv GOVT
    Orgsubtypename Agriculture, Forestry & Fisheries
    subsize1
    Orgtypepriv GOVT
    Orgsubtypename Arts & Culture
    subsize2
    Orgtypepriv GOVT
    Orgsubtypename Basic Education
    subsize3
    Orgtypepriv GOVT
    Orgsubtypename Civilian Secretariat of Police
    subsize4
    Orgtypepriv GOVT
    Orgsubtypename Communications
    subsize5
    Orgtypepriv GOVT
    Orgsubtypename Cooperative Governance
    subsize6
    Orgtypepriv GOVT
    Orgsubtypename Correctional Services
    subsize7
    Orgtypepriv GOVT
    Orgsubtypename Defence
    subsize8
    Orgtypepriv GOVT
    Orgsubtypename Economic Development
    subsize9
    Orgtypepriv GOVT
    Orgsubtypename Minerals and Energy
    subsize10
    Orgtype PRIV
    Orgtypepriv GOVT
    Orgsubtypename Agriculture, Forestry & Fisheries
    subsize11
    Orgtypepriv GOVT
    Orgsubtypename Arts & Culture
    subsize12
    Orgtypepriv GOVT
    Orgsubtypename Basic Education
    subsize13
    Orgtypepriv GOVT
    Orgsubtypename Civilian Secretariat of Police
    subsize14
    Orgtypepriv GOVT
    Orgsubtypename Communications
    subsize15
    Orgtypepriv GOVT
    Orgsubtypename Cooperative Governance
    subsize16
    Orgtypepriv GOVT
    Orgsubtypename Correctional Services
    subsize17
    Orgtypepriv GOVT
    Orgsubtypename Defence
    subsize18
    Orgtypepriv GOVT
    Orgsubtypename Economic Development
    subsize19
    Orgtypepriv GOVT
    Orgsubtypename Minerals and Energy
    subsize20

    and when i make selection for priv i get
    20
    2
    <PropertyKey> <saveValue> Unserializable value:Bean.OrgTypeBean@1014e39 for key:UINodePropertyKey[value,10]

    but when i make selection for GOVT i get
    20
    2
    01typename Agriculture, Forestry & Fisheries
    01typename Arts & Culture
    01typename Basic Education
    01typename Civilian Secretariat of Police
    01typename Communications
    01typename Cooperative Governance
    01typename Correctional Services
    01typename Defence
    01typename Economic Development
    01typename Minerals and Energy
    01typename Agriculture, Forestry & Fisheries
    01typename Arts & Culture
    01typename Basic Education
    01typename Civilian Secretariat of Police
    01typename Communications
    01typename Cooperative Governance
    01typename Correctional Services
    01typename Defence
    01typename Economic Development
    01typename Minerals and Energy
    01typename Agriculture, Forestry & Fisheries
    01typename Arts & Culture
    01typename Basic Education
    01typename Civilian Secretariat of Police
    01typename Communications
    01typename Cooperative Governance
    01typename Correctional Services
    01typename Defence
    01typename Economic Development
    01typename Minerals and Energy
    01typename Agriculture, Forestry & Fisheries
    01typename Arts & Culture
    01typename Basic Education
    01typename Civilian Secretariat of Police
    01typename Communications
    01typename Cooperative Governance
    01typename Correctional Services
    01typename Defence
    01typename Economic Development
    01typename Minerals and Energy
    <PropertyKey> <saveValue> Unserializable value:Bean.OrgTypeBean@182561d for key:UINodePropertyKey[value,10]

    my constructor is
        public TestBean() {
            
            OrgTypeList = new ArrayList<OrgTypeBean>();
            OrgSubList = new ArrayList<OrgSubType>();
           
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
            BindingContainer bindings2 = BindingContext.getCurrent().getCurrentBindingsEntry();
            //access the name of the iterator the table is bound to. 
            DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("LutOrgsubtypesView1Iterator");
            DCIteratorBinding dciter2 = (DCIteratorBinding) bindings2.get("LutOrganisationtypesView1Iterator");
           // List<SelectItem> selectItems = new ArrayList<SelectItem>();
           for (Row r1 : dciter2.getAllRowsInRange()){
              
                   OrgTypeBean otype = new OrgTypeBean();
                                otype.setOrgType((String)r1.getAttribute("Organisationtypecode")); 
                                System.out.println("Orgtype " + otype.getOrgType());
                                otype.setDescription((String)r1.getAttribute("Description"));                                    
                    OrgTypeList.add(otype);
           
                              
                for (Row r : dciter.getAllRowsInRange()){                
                      OrgSubType org = new OrgSubType();
                                org.setOrgSubType((String)r.getAttribute("Organisationtypecode"));
                                  //  System.out.println("Orgsubtypegovt " + org.getSubOrgType()); 
                                org.setOrgSubType((String)r.getAttribute("Organisationtypecode"));        
                                System.out.println("Orgtypepriv " + org.getSubOrgType());        
                                org.setOrgSubTypeName((String)r.getAttribute("Orgsubtypename"));           
                                System.out.println("Orgsubtypename " + org.getOrgSubTypeName());    
                                org.setOrgSubCode((String)r.getAttribute("Orgsubtypecode"));
            OrgSubList.add(org);
                                        System.out.println("subsize" + OrgSubList.size() );
                                
                                    }
           }
           
        }
    Edited by: adf0994 on 2012/11/23 3:25 PM
  • 50. Re: cascading lov using bean not passing selected parameter value
    user404 Pro
    Currently Being Moderated
    Since you are using VO's now, check this out:
    https://blogs.oracle.com/aramamoo/entry/how_to_create_multi_level
    Success guaranteed since I used it myself some weeks ago.
  • 51. Re: cascading lov using bean not passing selected parameter value
    adf009 Explorer
    Currently Being Moderated
    i see now you forget what was the main problem,the problem is to do cascading LOV using a bean and accessing view values to dispaly via a bean not directly from a view,remember i did iterator in my bean to access view values and display tham in cascading LOV,THE PROBLEM IS THAT AM NOT DISPLAYING ANOTHER values,when making selection,i can do this sample
  • 52. Re: cascading lov using bean not passing selected parameter value
    user404 Pro
    Currently Being Moderated
    Why do you want to make cascading LOV's / SOC's using a bean when you can do it easily with your VO's ?
  • 53. Re: cascading lov using bean not passing selected parameter value
    adf009 Explorer
    Currently Being Moderated
    to be hounest with you,i also have the same question but the person who is leading me its a java developer,the person don't undestand adf fully the person is trying to do adf stuff in java,i was just trying to see if thats possible to do cascading lov in bean and same time accessing the view values
  • 54. Re: cascading lov using bean not passing selected parameter value
    user404 Pro
    Currently Being Moderated
    You can do it using a bean.
    The problem with your code is that you need get the right data for the sub view because now it only contains GOV items, when you select PRIV you need to get fresh data from the other VO.
    You can it programmaticly (search for setWhereClause programmaitcly) .
  • 55. Re: cascading lov using bean not passing selected parameter value
    adf009 Explorer
    Currently Being Moderated
    hi i have upload my sample in this link you can check it
    http://www.4shared.com/zip/Bd7l9w__/BeanLovCascanding.html

    Edited by: adf0994 on 2012/12/18 12:12 PM

    Edited by: adf0994 on 2012/12/18 12:51 PM
1 2 3 4 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points