hi,
I think someone who understands the findParty method is probably the best person to answer this. I have a screen and form as detailed below. I am trying to get the data from the person entity for the logged in user and display it in a form. Am I missing some parameters? or something else? I am trying to debug this looking at the existing screens and forms but if someone who understands this method can help, I would appreciate it. Thanks -Milind The error: org.ofbiz.base.util.GeneralException: Error rendering screen [component://ebp/widget/EBPScreens.xml#main]: org.ofbiz.base.util.GeneralException: Error rendering screen [component://ebp/widget/EBPScreens.xml#main-decorator]: java.lang.IllegalArgumentException: Error getting value from the database for display of field [firstName] on form [profile]: org.ofbiz.entity.GenericModelException: [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] (Error getting value from the database for display of field [firstName] on form [profile]: org.ofbiz.entity.GenericModelException: [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid primary key: [GenericEntity:Person][firstName,THE(java.lang.String)]) (Error rendering screen [component://ebp/widget/EBPScreens.xml#main-decorator]: java.lang.IllegalArgumentException: Error getting value from the database for display of field [firstName] on form [profile]: org.ofbiz.entity.GenericModelException: [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] (Error getting value from the database for display of field [firstName] on form [profile]: org.ofbiz.entity.GenericModelException: [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid primary key: [GenericEntity:Person][firstName,THE(java.lang.String)])) The Screen: <screen name="main"> <section> <actions> <set field="headerItem" value="Main"/> <set field="roleTypeId" value="CONTACT"/> <set field="partyTypeId" value="PERSON"/> <set field="headerItem" value="Contacts"/> <set field="partyId" value="${userLogin.partyId}"/> <set field="lookupFlag" value="Y"/> <set field="extInfo" value="N"/> <set field="roleTypeId" value="ANY"/> <entity-one entity-name="Person" value-name="Person" /> </actions> <widgets> <decorator-screen name="main-decorator" location="component://ebp/widget/EBPScreens.xml"> <decorator-section name="body"> <section> <actions> <service service-name="findParty" auto-field-map="true"/> </actions> <widgets> <container style="screenlet"> <container style="screenlet-body"> <section> <condition> <not><if-empty field-name="partyList"/></not> </condition> <widgets> <include-form name="profile" location="component://ebp/widget/EBPForms.xml"/> </widgets> <fail-widgets> <container style="h3"> <label text="PARTY_NOT_FOUND"/> </container> </fail-widgets> </section> </container> </container> </widgets> </section> </decorator-section> </decorator-screen> </widgets> </section> </screen> The FORM: <form name="profile" type="list" target="Person" default-entity-name="Person" > <actions> <entity-condition entity-name="Person"> <condition-expr field-name="partyId" value="${userLogin.partyId}"/> <order-by field-name="partyId"/> </entity-condition> <entity-one entity-name="PartyType" value-name="partyType"> <field-map field-name="partyTypeId" env-name="partyRow.partyTypeId"/> </entity-one> </actions> <field name="partyId" title="PartyId" ><display-entity entity-name="Person"/></field> <field name="firstName"><display-entity entity-name="Person"/></field> <field name="middleName"><display-entity entity-name="Person"/></field> <field name="lastName"><display-entity entity-name="Person"/></field> <field name="personalTitle"><display-entity entity-name="Person"/></field> <field name="gender"><display-entity entity-name="Person"/></field> <field name="birthDate"><display-entity entity-name="Person"/></field> <field name="occupation"><display-entity entity-name="Person"/></field> <field name="lastModifiedDate"><display-entity entity-name="Person"/></field> <field name="lastModifiedByUserLogin"><display-entity entity-name="Person"/></field> </form> |
might want to go over the partyscreens.xml#findparty
Milind W sent the following on 8/17/2008 2:32 PM: > hi, > I think someone who understands the findParty method is probably the best > person to answer this. > I have a screen and form as detailed below. > I am trying to get the data from the person entity for the logged in user > and display it in a form. > Am I missing some parameters? or something else? > I am trying to debug this looking at the existing screens and forms but if > someone who understands this method can help, I would appreciate it. > Thanks > -Milind > > > The error: > > org.ofbiz.base.util.GeneralException: Error rendering screen > [component://ebp/widget/EBPScreens.xml#main]: > org.ofbiz.base.util.GeneralException: Error rendering screen > [component://ebp/widget/EBPScreens.xml#main-decorator]: > java.lang.IllegalArgumentException: Error getting value from the database > for display of field [firstName] on form [profile]: > org.ofbiz.entity.GenericModelException: > [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid > primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] > (Error getting value from the database for display of field [firstName] on > form [profile]: org.ofbiz.entity.GenericModelException: > [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid > primary key: [GenericEntity:Person][firstName,THE(java.lang.String)]) > (Error rendering screen > [component://ebp/widget/EBPScreens.xml#main-decorator]: > java.lang.IllegalArgumentException: Error getting value from the database > for display of field [firstName] on form [profile]: > org.ofbiz.entity.GenericModelException: > [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid > primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] > (Error getting value from the database for display of field [firstName] on > form [profile]: org.ofbiz.entity.GenericModelException: > [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid > primary key: [GenericEntity:Person][firstName,THE(java.lang.String)])) > > > The Screen: > <screen name="main"> > <section> > <actions> > <set field="headerItem" value="Main"/> > <set field="roleTypeId" value="CONTACT"/> > <set field="partyTypeId" value="PERSON"/> > <set field="headerItem" value="Contacts"/> > <set field="partyId" value="${userLogin.partyId}"/> > <set field="lookupFlag" value="Y"/> > <set field="extInfo" value="N"/> > <set field="roleTypeId" value="ANY"/> > <entity-one entity-name="Person" value-name="Person" /> > </actions> > <widgets> > <decorator-screen name="main-decorator" > location="component://ebp/widget/EBPScreens.xml"> > <decorator-section name="body"> > <section> > > <actions> > <service service-name="findParty" > auto-field-map="true"/> > </actions> > <widgets> > <container style="screenlet"> > <container style="screenlet-body"> > <section> > <condition> > <not><if-empty > field-name="partyList"/></not> > </condition> > <widgets> > <include-form > name="profile" > location="component://ebp/widget/EBPForms.xml"/> > </widgets> > <fail-widgets> > <container style="h3"> > <label > text="PARTY_NOT_FOUND"/> > </container> > </fail-widgets> > </section> > </container> > </container> > </widgets> > </section> > </decorator-section> > </decorator-screen> > </widgets> > </section> > </screen> > > The FORM: > <form name="profile" type="list" target="Person" > default-entity-name="Person" > > <actions> > <entity-condition entity-name="Person"> > <condition-expr field-name="partyId" > value="${userLogin.partyId}"/> > <order-by field-name="partyId"/> > </entity-condition> > <entity-one entity-name="PartyType" value-name="partyType"> > <field-map field-name="partyTypeId" > env-name="partyRow.partyTypeId"/> > </entity-one> > </actions> > <field name="partyId" title="PartyId" ><display-entity > entity-name="Person"/></field> > <field name="firstName"><display-entity entity-name="Person"/></field> > <field name="middleName"><display-entity entity-name="Person"/></field> > <field name="lastName"><display-entity entity-name="Person"/></field> > <field name="personalTitle"><display-entity entity-name="Person"/></field> > <field name="gender"><display-entity entity-name="Person"/></field> > <field name="birthDate"><display-entity entity-name="Person"/></field> > <field name="occupation"><display-entity entity-name="Person"/></field> > <field name="lastModifiedDate"><display-entity > entity-name="Person"/></field> > <field name="lastModifiedByUserLogin"><display-entity > entity-name="Person"/></field> > </form> > > > > > > |
Exactly what I am doing (using the debugger).
But it would be nice if the "real findParty author could please stand up" :) > might want to go over the partyscreens.xml#findparty > > > Milind W sent the following on 8/17/2008 2:32 PM: >> hi, >> I think someone who understands the findParty method is probably the >> best >> person to answer this. >> I have a screen and form as detailed below. >> I am trying to get the data from the person entity for the logged in >> user >> and display it in a form. >> Am I missing some parameters? or something else? >> I am trying to debug this looking at the existing screens and forms but >> if >> someone who understands this method can help, I would appreciate it. >> Thanks >> -Milind >> >> >> The error: >> >> org.ofbiz.base.util.GeneralException: Error rendering screen >> [component://ebp/widget/EBPScreens.xml#main]: >> org.ofbiz.base.util.GeneralException: Error rendering screen >> [component://ebp/widget/EBPScreens.xml#main-decorator]: >> java.lang.IllegalArgumentException: Error getting value from the >> database >> for display of field [firstName] on form [profile]: >> org.ofbiz.entity.GenericModelException: >> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] >> (Error getting value from the database for display of field [firstName] >> on >> form [profile]: org.ofbiz.entity.GenericModelException: >> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)]) >> (Error rendering screen >> [component://ebp/widget/EBPScreens.xml#main-decorator]: >> java.lang.IllegalArgumentException: Error getting value from the >> database >> for display of field [firstName] on form [profile]: >> org.ofbiz.entity.GenericModelException: >> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] >> (Error getting value from the database for display of field [firstName] >> on >> form [profile]: org.ofbiz.entity.GenericModelException: >> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)])) >> >> >> The Screen: >> <screen name="main"> >> <section> >> <actions> >> <set field="headerItem" value="Main"/> >> <set field="roleTypeId" value="CONTACT"/> >> <set field="partyTypeId" value="PERSON"/> >> <set field="headerItem" value="Contacts"/> >> <set field="partyId" value="${userLogin.partyId}"/> >> <set field="lookupFlag" value="Y"/> >> <set field="extInfo" value="N"/> >> <set field="roleTypeId" value="ANY"/> >> <entity-one entity-name="Person" value-name="Person" /> >> </actions> >> <widgets> >> <decorator-screen name="main-decorator" >> location="component://ebp/widget/EBPScreens.xml"> >> <decorator-section name="body"> >> <section> >> >> <actions> >> <service service-name="findParty" >> auto-field-map="true"/> >> </actions> >> <widgets> >> <container style="screenlet"> >> <container style="screenlet-body"> >> <section> >> <condition> >> <not><if-empty >> field-name="partyList"/></not> >> </condition> >> <widgets> >> <include-form >> name="profile" >> location="component://ebp/widget/EBPForms.xml"/> >> </widgets> >> <fail-widgets> >> <container style="h3"> >> <label >> text="PARTY_NOT_FOUND"/> >> </container> >> </fail-widgets> >> </section> >> </container> >> </container> >> </widgets> >> </section> >> </decorator-section> >> </decorator-screen> >> </widgets> >> </section> >> </screen> >> >> The FORM: >> <form name="profile" type="list" target="Person" >> default-entity-name="Person" > >> <actions> >> <entity-condition entity-name="Person"> >> <condition-expr field-name="partyId" >> value="${userLogin.partyId}"/> >> <order-by field-name="partyId"/> >> </entity-condition> >> <entity-one entity-name="PartyType" value-name="partyType"> >> <field-map field-name="partyTypeId" >> env-name="partyRow.partyTypeId"/> >> </entity-one> >> </actions> >> <field name="partyId" title="PartyId" ><display-entity >> entity-name="Person"/></field> >> <field name="firstName"><display-entity entity-name="Person"/></field> >> <field name="middleName"><display-entity >> entity-name="Person"/></field> >> <field name="lastName"><display-entity entity-name="Person"/></field> >> <field name="personalTitle"><display-entity >> entity-name="Person"/></field> >> <field name="gender"><display-entity entity-name="Person"/></field> >> <field name="birthDate"><display-entity entity-name="Person"/></field> >> <field name="occupation"><display-entity >> entity-name="Person"/></field> >> <field name="lastModifiedDate"><display-entity >> entity-name="Person"/></field> >> <field name="lastModifiedByUserLogin"><display-entity >> entity-name="Person"/></field> >> </form> >> >> >> >> >> >> > > |
In reply to this post by Milind W-2
you also might consider using the lookup screens
lookupPerson applications\party\webapp\partymgr\lookup Milind W sent the following on 8/17/2008 2:32 PM: > hi, > I think someone who understands the findParty method is probably the best > person to answer this. > I have a screen and form as detailed below. > I am trying to get the data from the person entity for the logged in user > and display it in a form. > Am I missing some parameters? or something else? > I am trying to debug this looking at the existing screens and forms but if > someone who understands this method can help, I would appreciate it. > Thanks > -Milind > > > The error: > > org.ofbiz.base.util.GeneralException: Error rendering screen > [component://ebp/widget/EBPScreens.xml#main]: > org.ofbiz.base.util.GeneralException: Error rendering screen > [component://ebp/widget/EBPScreens.xml#main-decorator]: > java.lang.IllegalArgumentException: Error getting value from the database > for display of field [firstName] on form [profile]: > org.ofbiz.entity.GenericModelException: > [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid > primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] > (Error getting value from the database for display of field [firstName] on > form [profile]: org.ofbiz.entity.GenericModelException: > [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid > primary key: [GenericEntity:Person][firstName,THE(java.lang.String)]) > (Error rendering screen > [component://ebp/widget/EBPScreens.xml#main-decorator]: > java.lang.IllegalArgumentException: Error getting value from the database > for display of field [firstName] on form [profile]: > org.ofbiz.entity.GenericModelException: > [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid > primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] > (Error getting value from the database for display of field [firstName] on > form [profile]: org.ofbiz.entity.GenericModelException: > [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid > primary key: [GenericEntity:Person][firstName,THE(java.lang.String)])) > > > The Screen: > <screen name="main"> > <section> > <actions> > <set field="headerItem" value="Main"/> > <set field="roleTypeId" value="CONTACT"/> > <set field="partyTypeId" value="PERSON"/> > <set field="headerItem" value="Contacts"/> > <set field="partyId" value="${userLogin.partyId}"/> > <set field="lookupFlag" value="Y"/> > <set field="extInfo" value="N"/> > <set field="roleTypeId" value="ANY"/> > <entity-one entity-name="Person" value-name="Person" /> > </actions> > <widgets> > <decorator-screen name="main-decorator" > location="component://ebp/widget/EBPScreens.xml"> > <decorator-section name="body"> > <section> > > <actions> > <service service-name="findParty" > auto-field-map="true"/> > </actions> > <widgets> > <container style="screenlet"> > <container style="screenlet-body"> > <section> > <condition> > <not><if-empty > field-name="partyList"/></not> > </condition> > <widgets> > <include-form > name="profile" > location="component://ebp/widget/EBPForms.xml"/> > </widgets> > <fail-widgets> > <container style="h3"> > <label > text="PARTY_NOT_FOUND"/> > </container> > </fail-widgets> > </section> > </container> > </container> > </widgets> > </section> > </decorator-section> > </decorator-screen> > </widgets> > </section> > </screen> > > The FORM: > <form name="profile" type="list" target="Person" > default-entity-name="Person" > > <actions> > <entity-condition entity-name="Person"> > <condition-expr field-name="partyId" > value="${userLogin.partyId}"/> > <order-by field-name="partyId"/> > </entity-condition> > <entity-one entity-name="PartyType" value-name="partyType"> > <field-map field-name="partyTypeId" > env-name="partyRow.partyTypeId"/> > </entity-one> > </actions> > <field name="partyId" title="PartyId" ><display-entity > entity-name="Person"/></field> > <field name="firstName"><display-entity entity-name="Person"/></field> > <field name="middleName"><display-entity entity-name="Person"/></field> > <field name="lastName"><display-entity entity-name="Person"/></field> > <field name="personalTitle"><display-entity entity-name="Person"/></field> > <field name="gender"><display-entity entity-name="Person"/></field> > <field name="birthDate"><display-entity entity-name="Person"/></field> > <field name="occupation"><display-entity entity-name="Person"/></field> > <field name="lastModifiedDate"><display-entity > entity-name="Person"/></field> > <field name="lastModifiedByUserLogin"><display-entity > entity-name="Person"/></field> > </form> > > > > > > |
In reply to this post by Milind W-2
actually the answer is there.
you need to compare what you wrote to it. but from now on, I will not respond to you emails :) Milind W sent the following on 8/17/2008 4:16 PM: > Exactly what I am doing (using the debugger). > But it would be nice if the "real findParty author could please stand up" > :) > >> might want to go over the partyscreens.xml#findparty >> >> >> Milind W sent the following on 8/17/2008 2:32 PM: >>> hi, >>> I think someone who understands the findParty method is probably the >>> best >>> person to answer this. >>> I have a screen and form as detailed below. >>> I am trying to get the data from the person entity for the logged in >>> user >>> and display it in a form. >>> Am I missing some parameters? or something else? >>> I am trying to debug this looking at the existing screens and forms but >>> if >>> someone who understands this method can help, I would appreciate it. >>> Thanks >>> -Milind >>> >>> >>> The error: >>> >>> org.ofbiz.base.util.GeneralException: Error rendering screen >>> [component://ebp/widget/EBPScreens.xml#main]: >>> org.ofbiz.base.util.GeneralException: Error rendering screen >>> [component://ebp/widget/EBPScreens.xml#main-decorator]: >>> java.lang.IllegalArgumentException: Error getting value from the >>> database >>> for display of field [firstName] on form [profile]: >>> org.ofbiz.entity.GenericModelException: >>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >>> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] >>> (Error getting value from the database for display of field [firstName] >>> on >>> form [profile]: org.ofbiz.entity.GenericModelException: >>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >>> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)]) >>> (Error rendering screen >>> [component://ebp/widget/EBPScreens.xml#main-decorator]: >>> java.lang.IllegalArgumentException: Error getting value from the >>> database >>> for display of field [firstName] on form [profile]: >>> org.ofbiz.entity.GenericModelException: >>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >>> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] >>> (Error getting value from the database for display of field [firstName] >>> on >>> form [profile]: org.ofbiz.entity.GenericModelException: >>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >>> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)])) >>> >>> >>> The Screen: >>> <screen name="main"> >>> <section> >>> <actions> >>> <set field="headerItem" value="Main"/> >>> <set field="roleTypeId" value="CONTACT"/> >>> <set field="partyTypeId" value="PERSON"/> >>> <set field="headerItem" value="Contacts"/> >>> <set field="partyId" value="${userLogin.partyId}"/> >>> <set field="lookupFlag" value="Y"/> >>> <set field="extInfo" value="N"/> >>> <set field="roleTypeId" value="ANY"/> >>> <entity-one entity-name="Person" value-name="Person" /> >>> </actions> >>> <widgets> >>> <decorator-screen name="main-decorator" >>> location="component://ebp/widget/EBPScreens.xml"> >>> <decorator-section name="body"> >>> <section> >>> >>> <actions> >>> <service service-name="findParty" >>> auto-field-map="true"/> >>> </actions> >>> <widgets> >>> <container style="screenlet"> >>> <container style="screenlet-body"> >>> <section> >>> <condition> >>> <not><if-empty >>> field-name="partyList"/></not> >>> </condition> >>> <widgets> >>> <include-form >>> name="profile" >>> location="component://ebp/widget/EBPForms.xml"/> >>> </widgets> >>> <fail-widgets> >>> <container style="h3"> >>> <label >>> text="PARTY_NOT_FOUND"/> >>> </container> >>> </fail-widgets> >>> </section> >>> </container> >>> </container> >>> </widgets> >>> </section> >>> </decorator-section> >>> </decorator-screen> >>> </widgets> >>> </section> >>> </screen> >>> >>> The FORM: >>> <form name="profile" type="list" target="Person" >>> default-entity-name="Person" > >>> <actions> >>> <entity-condition entity-name="Person"> >>> <condition-expr field-name="partyId" >>> value="${userLogin.partyId}"/> >>> <order-by field-name="partyId"/> >>> </entity-condition> >>> <entity-one entity-name="PartyType" value-name="partyType"> >>> <field-map field-name="partyTypeId" >>> env-name="partyRow.partyTypeId"/> >>> </entity-one> >>> </actions> >>> <field name="partyId" title="PartyId" ><display-entity >>> entity-name="Person"/></field> >>> <field name="firstName"><display-entity entity-name="Person"/></field> >>> <field name="middleName"><display-entity >>> entity-name="Person"/></field> >>> <field name="lastName"><display-entity entity-name="Person"/></field> >>> <field name="personalTitle"><display-entity >>> entity-name="Person"/></field> >>> <field name="gender"><display-entity entity-name="Person"/></field> >>> <field name="birthDate"><display-entity entity-name="Person"/></field> >>> <field name="occupation"><display-entity >>> entity-name="Person"/></field> >>> <field name="lastModifiedDate"><display-entity >>> entity-name="Person"/></field> >>> <field name="lastModifiedByUserLogin"><display-entity >>> entity-name="Person"/></field> >>> </form> >>> >>> >>> >>> >>> >>> >> > > > > > |
In reply to this post by Milind W-2
one last note:
findparty works so you have what it takes. so you copy it over and add you code, step by step when it stops working you know where to look in your code. Milind W sent the following on 8/17/2008 4:16 PM: > Exactly what I am doing (using the debugger). > But it would be nice if the "real findParty author could please stand up" > :) > >> might want to go over the partyscreens.xml#findparty >> >> >> Milind W sent the following on 8/17/2008 2:32 PM: >>> hi, >>> I think someone who understands the findParty method is probably the >>> best >>> person to answer this. >>> I have a screen and form as detailed below. >>> I am trying to get the data from the person entity for the logged in >>> user >>> and display it in a form. >>> Am I missing some parameters? or something else? >>> I am trying to debug this looking at the existing screens and forms but >>> if >>> someone who understands this method can help, I would appreciate it. >>> Thanks >>> -Milind >>> >>> >>> The error: >>> >>> org.ofbiz.base.util.GeneralException: Error rendering screen >>> [component://ebp/widget/EBPScreens.xml#main]: >>> org.ofbiz.base.util.GeneralException: Error rendering screen >>> [component://ebp/widget/EBPScreens.xml#main-decorator]: >>> java.lang.IllegalArgumentException: Error getting value from the >>> database >>> for display of field [firstName] on form [profile]: >>> org.ofbiz.entity.GenericModelException: >>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >>> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] >>> (Error getting value from the database for display of field [firstName] >>> on >>> form [profile]: org.ofbiz.entity.GenericModelException: >>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >>> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)]) >>> (Error rendering screen >>> [component://ebp/widget/EBPScreens.xml#main-decorator]: >>> java.lang.IllegalArgumentException: Error getting value from the >>> database >>> for display of field [firstName] on form [profile]: >>> org.ofbiz.entity.GenericModelException: >>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >>> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] >>> (Error getting value from the database for display of field [firstName] >>> on >>> form [profile]: org.ofbiz.entity.GenericModelException: >>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >>> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)])) >>> >>> >>> The Screen: >>> <screen name="main"> >>> <section> >>> <actions> >>> <set field="headerItem" value="Main"/> >>> <set field="roleTypeId" value="CONTACT"/> >>> <set field="partyTypeId" value="PERSON"/> >>> <set field="headerItem" value="Contacts"/> >>> <set field="partyId" value="${userLogin.partyId}"/> >>> <set field="lookupFlag" value="Y"/> >>> <set field="extInfo" value="N"/> >>> <set field="roleTypeId" value="ANY"/> >>> <entity-one entity-name="Person" value-name="Person" /> >>> </actions> >>> <widgets> >>> <decorator-screen name="main-decorator" >>> location="component://ebp/widget/EBPScreens.xml"> >>> <decorator-section name="body"> >>> <section> >>> >>> <actions> >>> <service service-name="findParty" >>> auto-field-map="true"/> >>> </actions> >>> <widgets> >>> <container style="screenlet"> >>> <container style="screenlet-body"> >>> <section> >>> <condition> >>> <not><if-empty >>> field-name="partyList"/></not> >>> </condition> >>> <widgets> >>> <include-form >>> name="profile" >>> location="component://ebp/widget/EBPForms.xml"/> >>> </widgets> >>> <fail-widgets> >>> <container style="h3"> >>> <label >>> text="PARTY_NOT_FOUND"/> >>> </container> >>> </fail-widgets> >>> </section> >>> </container> >>> </container> >>> </widgets> >>> </section> >>> </decorator-section> >>> </decorator-screen> >>> </widgets> >>> </section> >>> </screen> >>> >>> The FORM: >>> <form name="profile" type="list" target="Person" >>> default-entity-name="Person" > >>> <actions> >>> <entity-condition entity-name="Person"> >>> <condition-expr field-name="partyId" >>> value="${userLogin.partyId}"/> >>> <order-by field-name="partyId"/> >>> </entity-condition> >>> <entity-one entity-name="PartyType" value-name="partyType"> >>> <field-map field-name="partyTypeId" >>> env-name="partyRow.partyTypeId"/> >>> </entity-one> >>> </actions> >>> <field name="partyId" title="PartyId" ><display-entity >>> entity-name="Person"/></field> >>> <field name="firstName"><display-entity entity-name="Person"/></field> >>> <field name="middleName"><display-entity >>> entity-name="Person"/></field> >>> <field name="lastName"><display-entity entity-name="Person"/></field> >>> <field name="personalTitle"><display-entity >>> entity-name="Person"/></field> >>> <field name="gender"><display-entity entity-name="Person"/></field> >>> <field name="birthDate"><display-entity entity-name="Person"/></field> >>> <field name="occupation"><display-entity >>> entity-name="Person"/></field> >>> <field name="lastModifiedDate"><display-entity >>> entity-name="Person"/></field> >>> <field name="lastModifiedByUserLogin"><display-entity >>> entity-name="Person"/></field> >>> </form> >>> >>> >>> >>> >>> >>> >> > > > > > |
Can't copy all the code in my app due to all the dependencies.
But I think I have pretty much all the fields <set field="headerItem" value="Main"/> <set field="roleTypeId" value="CONTACT"/> <set field="partyTypeId" value="PERSON"/> <set field="headerItem" value="Contacts"/> <set field="partyId" value="${userLogin.partyId}"/> <set field="lookupFlag" value="Y"/> <set field="extInfo" value="N"/> <set field="roleTypeId" value="ANY"/> <set field="noConditionFind" value="Y"/> <set field="titleProperty" value="PageTitleFindParty" /> <set field="headerItem" value="find" /> <set field="tabButtonItem" value="findparty" /> BJ you and Jacques seem to answer most questions :) Would be nice to add to the list and not subtract :) > one last note: > findparty works so you have what it takes. > so you copy it over and add you code, step by step > when it stops working you know where to look in your code. > > Milind W sent the following on 8/17/2008 4:16 PM: >> Exactly what I am doing (using the debugger). >> But it would be nice if the "real findParty author could please stand >> up" >> :) >> >>> might want to go over the partyscreens.xml#findparty >>> >>> >>> Milind W sent the following on 8/17/2008 2:32 PM: >>>> hi, >>>> I think someone who understands the findParty method is probably the >>>> best >>>> person to answer this. >>>> I have a screen and form as detailed below. >>>> I am trying to get the data from the person entity for the logged in >>>> user >>>> and display it in a form. >>>> Am I missing some parameters? or something else? >>>> I am trying to debug this looking at the existing screens and forms >>>> but >>>> if >>>> someone who understands this method can help, I would appreciate it. >>>> Thanks >>>> -Milind >>>> >>>> >>>> The error: >>>> >>>> org.ofbiz.base.util.GeneralException: Error rendering screen >>>> [component://ebp/widget/EBPScreens.xml#main]: >>>> org.ofbiz.base.util.GeneralException: Error rendering screen >>>> [component://ebp/widget/EBPScreens.xml#main-decorator]: >>>> java.lang.IllegalArgumentException: Error getting value from the >>>> database >>>> for display of field [firstName] on form [profile]: >>>> org.ofbiz.entity.GenericModelException: >>>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >>>> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] >>>> (Error getting value from the database for display of field >>>> [firstName] >>>> on >>>> form [profile]: org.ofbiz.entity.GenericModelException: >>>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >>>> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)]) >>>> (Error rendering screen >>>> [component://ebp/widget/EBPScreens.xml#main-decorator]: >>>> java.lang.IllegalArgumentException: Error getting value from the >>>> database >>>> for display of field [firstName] on form [profile]: >>>> org.ofbiz.entity.GenericModelException: >>>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >>>> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] >>>> (Error getting value from the database for display of field >>>> [firstName] >>>> on >>>> form [profile]: org.ofbiz.entity.GenericModelException: >>>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >>>> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)])) >>>> >>>> >>>> The Screen: >>>> <screen name="main"> >>>> <section> >>>> <actions> >>>> <set field="headerItem" value="Main"/> >>>> <set field="roleTypeId" value="CONTACT"/> >>>> <set field="partyTypeId" value="PERSON"/> >>>> <set field="headerItem" value="Contacts"/> >>>> <set field="partyId" value="${userLogin.partyId}"/> >>>> <set field="lookupFlag" value="Y"/> >>>> <set field="extInfo" value="N"/> >>>> <set field="roleTypeId" value="ANY"/> >>>> <entity-one entity-name="Person" value-name="Person" /> >>>> </actions> >>>> <widgets> >>>> <decorator-screen name="main-decorator" >>>> location="component://ebp/widget/EBPScreens.xml"> >>>> <decorator-section name="body"> >>>> <section> >>>> >>>> <actions> >>>> <service service-name="findParty" >>>> auto-field-map="true"/> >>>> </actions> >>>> <widgets> >>>> <container style="screenlet"> >>>> <container style="screenlet-body"> >>>> <section> >>>> <condition> >>>> <not><if-empty >>>> field-name="partyList"/></not> >>>> </condition> >>>> <widgets> >>>> <include-form >>>> name="profile" >>>> location="component://ebp/widget/EBPForms.xml"/> >>>> </widgets> >>>> <fail-widgets> >>>> <container style="h3"> >>>> <label >>>> text="PARTY_NOT_FOUND"/> >>>> </container> >>>> </fail-widgets> >>>> </section> >>>> </container> >>>> </container> >>>> </widgets> >>>> </section> >>>> </decorator-section> >>>> </decorator-screen> >>>> </widgets> >>>> </section> >>>> </screen> >>>> >>>> The FORM: >>>> <form name="profile" type="list" target="Person" >>>> default-entity-name="Person" > >>>> <actions> >>>> <entity-condition entity-name="Person"> >>>> <condition-expr field-name="partyId" >>>> value="${userLogin.partyId}"/> >>>> <order-by field-name="partyId"/> >>>> </entity-condition> >>>> <entity-one entity-name="PartyType" value-name="partyType"> >>>> <field-map field-name="partyTypeId" >>>> env-name="partyRow.partyTypeId"/> >>>> </entity-one> >>>> </actions> >>>> <field name="partyId" title="PartyId" ><display-entity >>>> entity-name="Person"/></field> >>>> <field name="firstName"><display-entity >>>> entity-name="Person"/></field> >>>> <field name="middleName"><display-entity >>>> entity-name="Person"/></field> >>>> <field name="lastName"><display-entity >>>> entity-name="Person"/></field> >>>> <field name="personalTitle"><display-entity >>>> entity-name="Person"/></field> >>>> <field name="gender"><display-entity entity-name="Person"/></field> >>>> <field name="birthDate"><display-entity >>>> entity-name="Person"/></field> >>>> <field name="occupation"><display-entity >>>> entity-name="Person"/></field> >>>> <field name="lastModifiedDate"><display-entity >>>> entity-name="Person"/></field> >>>> <field name="lastModifiedByUserLogin"><display-entity >>>> entity-name="Person"/></field> >>>> </form> >>>> >>>> >>>> >>>> >>>> >>>> >>> >> >> >> >> >> > > |
Oh and it still gives the same error
> Can't copy all the code in my app due to all the dependencies. > But I think I have pretty much all the fields > <set field="headerItem" value="Main"/> > <set field="roleTypeId" value="CONTACT"/> > <set field="partyTypeId" value="PERSON"/> > <set field="headerItem" value="Contacts"/> > <set field="partyId" value="${userLogin.partyId}"/> > <set field="lookupFlag" value="Y"/> > <set field="extInfo" value="N"/> > <set field="roleTypeId" value="ANY"/> > <set field="noConditionFind" value="Y"/> > <set field="titleProperty" value="PageTitleFindParty" /> > <set field="headerItem" value="find" /> > <set field="tabButtonItem" value="findparty" /> > BJ you and Jacques seem to answer most questions :) > Would be nice to add to the list and not subtract :) > >> one last note: >> findparty works so you have what it takes. >> so you copy it over and add you code, step by step >> when it stops working you know where to look in your code. >> >> Milind W sent the following on 8/17/2008 4:16 PM: >>> Exactly what I am doing (using the debugger). >>> But it would be nice if the "real findParty author could please stand >>> up" >>> :) >>> >>>> might want to go over the partyscreens.xml#findparty >>>> >>>> >>>> Milind W sent the following on 8/17/2008 2:32 PM: >>>>> hi, >>>>> I think someone who understands the findParty method is probably the >>>>> best >>>>> person to answer this. >>>>> I have a screen and form as detailed below. >>>>> I am trying to get the data from the person entity for the logged in >>>>> user >>>>> and display it in a form. >>>>> Am I missing some parameters? or something else? >>>>> I am trying to debug this looking at the existing screens and forms >>>>> but >>>>> if >>>>> someone who understands this method can help, I would appreciate it. >>>>> Thanks >>>>> -Milind >>>>> >>>>> >>>>> The error: >>>>> >>>>> org.ofbiz.base.util.GeneralException: Error rendering screen >>>>> [component://ebp/widget/EBPScreens.xml#main]: >>>>> org.ofbiz.base.util.GeneralException: Error rendering screen >>>>> [component://ebp/widget/EBPScreens.xml#main-decorator]: >>>>> java.lang.IllegalArgumentException: Error getting value from the >>>>> database >>>>> for display of field [firstName] on form [profile]: >>>>> org.ofbiz.entity.GenericModelException: >>>>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >>>>> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] >>>>> (Error getting value from the database for display of field >>>>> [firstName] >>>>> on >>>>> form [profile]: org.ofbiz.entity.GenericModelException: >>>>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >>>>> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)]) >>>>> (Error rendering screen >>>>> [component://ebp/widget/EBPScreens.xml#main-decorator]: >>>>> java.lang.IllegalArgumentException: Error getting value from the >>>>> database >>>>> for display of field [firstName] on form [profile]: >>>>> org.ofbiz.entity.GenericModelException: >>>>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >>>>> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] >>>>> (Error getting value from the database for display of field >>>>> [firstName] >>>>> on >>>>> form [profile]: org.ofbiz.entity.GenericModelException: >>>>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >>>>> primary key: >>>>> [GenericEntity:Person][firstName,THE(java.lang.String)])) >>>>> >>>>> >>>>> The Screen: >>>>> <screen name="main"> >>>>> <section> >>>>> <actions> >>>>> <set field="headerItem" value="Main"/> >>>>> <set field="roleTypeId" value="CONTACT"/> >>>>> <set field="partyTypeId" value="PERSON"/> >>>>> <set field="headerItem" value="Contacts"/> >>>>> <set field="partyId" value="${userLogin.partyId}"/> >>>>> <set field="lookupFlag" value="Y"/> >>>>> <set field="extInfo" value="N"/> >>>>> <set field="roleTypeId" value="ANY"/> >>>>> <entity-one entity-name="Person" value-name="Person" /> >>>>> </actions> >>>>> <widgets> >>>>> <decorator-screen name="main-decorator" >>>>> location="component://ebp/widget/EBPScreens.xml"> >>>>> <decorator-section name="body"> >>>>> <section> >>>>> >>>>> <actions> >>>>> <service service-name="findParty" >>>>> auto-field-map="true"/> >>>>> </actions> >>>>> <widgets> >>>>> <container style="screenlet"> >>>>> <container >>>>> style="screenlet-body"> >>>>> <section> >>>>> <condition> >>>>> <not><if-empty >>>>> field-name="partyList"/></not> >>>>> </condition> >>>>> <widgets> >>>>> <include-form >>>>> name="profile" >>>>> location="component://ebp/widget/EBPForms.xml"/> >>>>> </widgets> >>>>> <fail-widgets> >>>>> <container >>>>> style="h3"> >>>>> <label >>>>> text="PARTY_NOT_FOUND"/> >>>>> </container> >>>>> </fail-widgets> >>>>> </section> >>>>> </container> >>>>> </container> >>>>> </widgets> >>>>> </section> >>>>> </decorator-section> >>>>> </decorator-screen> >>>>> </widgets> >>>>> </section> >>>>> </screen> >>>>> >>>>> The FORM: >>>>> <form name="profile" type="list" target="Person" >>>>> default-entity-name="Person" > >>>>> <actions> >>>>> <entity-condition entity-name="Person"> >>>>> <condition-expr field-name="partyId" >>>>> value="${userLogin.partyId}"/> >>>>> <order-by field-name="partyId"/> >>>>> </entity-condition> >>>>> <entity-one entity-name="PartyType" value-name="partyType"> >>>>> <field-map field-name="partyTypeId" >>>>> env-name="partyRow.partyTypeId"/> >>>>> </entity-one> >>>>> </actions> >>>>> <field name="partyId" title="PartyId" ><display-entity >>>>> entity-name="Person"/></field> >>>>> <field name="firstName"><display-entity >>>>> entity-name="Person"/></field> >>>>> <field name="middleName"><display-entity >>>>> entity-name="Person"/></field> >>>>> <field name="lastName"><display-entity >>>>> entity-name="Person"/></field> >>>>> <field name="personalTitle"><display-entity >>>>> entity-name="Person"/></field> >>>>> <field name="gender"><display-entity entity-name="Person"/></field> >>>>> <field name="birthDate"><display-entity >>>>> entity-name="Person"/></field> >>>>> <field name="occupation"><display-entity >>>>> entity-name="Person"/></field> >>>>> <field name="lastModifiedDate"><display-entity >>>>> entity-name="Person"/></field> >>>>> <field name="lastModifiedByUserLogin"><display-entity >>>>> entity-name="Person"/></field> >>>>> </form> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>> >>> >>> >>> >>> >>> >> >> > > > |
In reply to this post by Milind W-2
then you might use the compare between the findparty and yours to see
what might be different. I am willing, on the mailing list to 1) investigate what is in the svn. 2) give pointers to someone doing custom code. what I am not willing to do is trouble shoot someones code, unless I am hired. So I have been doing #2. you don't have a grasp yet. believe I know how frustrating that is. here are the three rules I learn by 1) read everything till I understand ever word. this says you have 50% of a discipline down. 2) when you think you know enought change something and predict the outcome. 3) if the outcome is not what you predicted go to #1, you missed something. maybe someone else is willing to support you custom code. I feel I have given you a way to accomplish trouble shooting this and other problems you may have. it is better to teach someone how to fish that to supply the fish for them. Milind W sent the following on 8/17/2008 7:15 PM: > Can't copy all the code in my app due to all the dependencies. > But I think I have pretty much all the fields > <set field="headerItem" value="Main"/> > <set field="roleTypeId" value="CONTACT"/> > <set field="partyTypeId" value="PERSON"/> > <set field="headerItem" value="Contacts"/> > <set field="partyId" value="${userLogin.partyId}"/> > <set field="lookupFlag" value="Y"/> > <set field="extInfo" value="N"/> > <set field="roleTypeId" value="ANY"/> > <set field="noConditionFind" value="Y"/> > <set field="titleProperty" value="PageTitleFindParty" /> > <set field="headerItem" value="find" /> > <set field="tabButtonItem" value="findparty" /> > BJ you and Jacques seem to answer most questions :) > Would be nice to add to the list and not subtract :) > >> one last note: >> findparty works so you have what it takes. >> so you copy it over and add you code, step by step >> when it stops working you know where to look in your code. >> >> Milind W sent the following on 8/17/2008 4:16 PM: >>> Exactly what I am doing (using the debugger). >>> But it would be nice if the "real findParty author could please stand >>> up" >>> :) >>> >>>> might want to go over the partyscreens.xml#findparty >>>> >>>> >>>> Milind W sent the following on 8/17/2008 2:32 PM: >>>>> hi, >>>>> I think someone who understands the findParty method is probably the >>>>> best >>>>> person to answer this. >>>>> I have a screen and form as detailed below. >>>>> I am trying to get the data from the person entity for the logged in >>>>> user >>>>> and display it in a form. >>>>> Am I missing some parameters? or something else? >>>>> I am trying to debug this looking at the existing screens and forms >>>>> but >>>>> if >>>>> someone who understands this method can help, I would appreciate it. >>>>> Thanks >>>>> -Milind >>>>> >>>>> >>>>> The error: >>>>> >>>>> org.ofbiz.base.util.GeneralException: Error rendering screen >>>>> [component://ebp/widget/EBPScreens.xml#main]: >>>>> org.ofbiz.base.util.GeneralException: Error rendering screen >>>>> [component://ebp/widget/EBPScreens.xml#main-decorator]: >>>>> java.lang.IllegalArgumentException: Error getting value from the >>>>> database >>>>> for display of field [firstName] on form [profile]: >>>>> org.ofbiz.entity.GenericModelException: >>>>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >>>>> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] >>>>> (Error getting value from the database for display of field >>>>> [firstName] >>>>> on >>>>> form [profile]: org.ofbiz.entity.GenericModelException: >>>>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >>>>> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)]) >>>>> (Error rendering screen >>>>> [component://ebp/widget/EBPScreens.xml#main-decorator]: >>>>> java.lang.IllegalArgumentException: Error getting value from the >>>>> database >>>>> for display of field [firstName] on form [profile]: >>>>> org.ofbiz.entity.GenericModelException: >>>>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >>>>> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] >>>>> (Error getting value from the database for display of field >>>>> [firstName] >>>>> on >>>>> form [profile]: org.ofbiz.entity.GenericModelException: >>>>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >>>>> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)])) >>>>> >>>>> >>>>> The Screen: >>>>> <screen name="main"> >>>>> <section> >>>>> <actions> >>>>> <set field="headerItem" value="Main"/> >>>>> <set field="roleTypeId" value="CONTACT"/> >>>>> <set field="partyTypeId" value="PERSON"/> >>>>> <set field="headerItem" value="Contacts"/> >>>>> <set field="partyId" value="${userLogin.partyId}"/> >>>>> <set field="lookupFlag" value="Y"/> >>>>> <set field="extInfo" value="N"/> >>>>> <set field="roleTypeId" value="ANY"/> >>>>> <entity-one entity-name="Person" value-name="Person" /> >>>>> </actions> >>>>> <widgets> >>>>> <decorator-screen name="main-decorator" >>>>> location="component://ebp/widget/EBPScreens.xml"> >>>>> <decorator-section name="body"> >>>>> <section> >>>>> >>>>> <actions> >>>>> <service service-name="findParty" >>>>> auto-field-map="true"/> >>>>> </actions> >>>>> <widgets> >>>>> <container style="screenlet"> >>>>> <container style="screenlet-body"> >>>>> <section> >>>>> <condition> >>>>> <not><if-empty >>>>> field-name="partyList"/></not> >>>>> </condition> >>>>> <widgets> >>>>> <include-form >>>>> name="profile" >>>>> location="component://ebp/widget/EBPForms.xml"/> >>>>> </widgets> >>>>> <fail-widgets> >>>>> <container style="h3"> >>>>> <label >>>>> text="PARTY_NOT_FOUND"/> >>>>> </container> >>>>> </fail-widgets> >>>>> </section> >>>>> </container> >>>>> </container> >>>>> </widgets> >>>>> </section> >>>>> </decorator-section> >>>>> </decorator-screen> >>>>> </widgets> >>>>> </section> >>>>> </screen> >>>>> >>>>> The FORM: >>>>> <form name="profile" type="list" target="Person" >>>>> default-entity-name="Person" > >>>>> <actions> >>>>> <entity-condition entity-name="Person"> >>>>> <condition-expr field-name="partyId" >>>>> value="${userLogin.partyId}"/> >>>>> <order-by field-name="partyId"/> >>>>> </entity-condition> >>>>> <entity-one entity-name="PartyType" value-name="partyType"> >>>>> <field-map field-name="partyTypeId" >>>>> env-name="partyRow.partyTypeId"/> >>>>> </entity-one> >>>>> </actions> >>>>> <field name="partyId" title="PartyId" ><display-entity >>>>> entity-name="Person"/></field> >>>>> <field name="firstName"><display-entity >>>>> entity-name="Person"/></field> >>>>> <field name="middleName"><display-entity >>>>> entity-name="Person"/></field> >>>>> <field name="lastName"><display-entity >>>>> entity-name="Person"/></field> >>>>> <field name="personalTitle"><display-entity >>>>> entity-name="Person"/></field> >>>>> <field name="gender"><display-entity entity-name="Person"/></field> >>>>> <field name="birthDate"><display-entity >>>>> entity-name="Person"/></field> >>>>> <field name="occupation"><display-entity >>>>> entity-name="Person"/></field> >>>>> <field name="lastModifiedDate"><display-entity >>>>> entity-name="Person"/></field> >>>>> <field name="lastModifiedByUserLogin"><display-entity >>>>> entity-name="Person"/></field> >>>>> </form> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>> >>> >>> >>> >> > > > > > |
Thanks BJ,
Understand your sentiment and pointer and yes it is frustrating :) I was down the path you suggested (comparing stuff that works and my custom code) before I posted here. This bring me back to my original question if someone can see something that is obviously and/or specifically missing (based on the data I provided and/or the error message) I would like to hear, otherwise I am debugging away to glory :) -Milind > then you might use the compare between the findparty and yours to see > what might be different. > I am willing, on the mailing list to > 1) investigate what is in the svn. > 2) give pointers to someone doing custom code. > what I am not willing to do > is trouble shoot someones code, unless I am hired. > So I have been doing #2. > > you don't have a grasp yet. believe I know how frustrating that is. > here are the three rules I learn by > 1) read everything till I understand ever word. this says you have 50% > of a discipline down. > 2) when you think you know enought change something and predict the > outcome. > 3) if the outcome is not what you predicted go to #1, you missed > something. > > maybe someone else is willing to support you custom code. > I feel I have given you a way to accomplish trouble shooting this and > other problems you may have. > > it is better to teach someone how to fish that to supply the fish for > them. > > > > > Milind W sent the following on 8/17/2008 7:15 PM: >> Can't copy all the code in my app due to all the dependencies. >> But I think I have pretty much all the fields >> <set field="headerItem" value="Main"/> >> <set field="roleTypeId" value="CONTACT"/> >> <set field="partyTypeId" value="PERSON"/> >> <set field="headerItem" value="Contacts"/> >> <set field="partyId" value="${userLogin.partyId}"/> >> <set field="lookupFlag" value="Y"/> >> <set field="extInfo" value="N"/> >> <set field="roleTypeId" value="ANY"/> >> <set field="noConditionFind" value="Y"/> >> <set field="titleProperty" value="PageTitleFindParty" /> >> <set field="headerItem" value="find" /> >> <set field="tabButtonItem" value="findparty" /> >> BJ you and Jacques seem to answer most questions :) >> Would be nice to add to the list and not subtract :) >> >>> one last note: >>> findparty works so you have what it takes. >>> so you copy it over and add you code, step by step >>> when it stops working you know where to look in your code. >>> >>> Milind W sent the following on 8/17/2008 4:16 PM: >>>> Exactly what I am doing (using the debugger). >>>> But it would be nice if the "real findParty author could please stand >>>> up" >>>> :) >>>> >>>>> might want to go over the partyscreens.xml#findparty >>>>> >>>>> >>>>> Milind W sent the following on 8/17/2008 2:32 PM: >>>>>> hi, >>>>>> I think someone who understands the findParty method is probably the >>>>>> best >>>>>> person to answer this. >>>>>> I have a screen and form as detailed below. >>>>>> I am trying to get the data from the person entity for the logged in >>>>>> user >>>>>> and display it in a form. >>>>>> Am I missing some parameters? or something else? >>>>>> I am trying to debug this looking at the existing screens and forms >>>>>> but >>>>>> if >>>>>> someone who understands this method can help, I would appreciate it. >>>>>> Thanks >>>>>> -Milind >>>>>> >>>>>> >>>>>> The error: >>>>>> >>>>>> org.ofbiz.base.util.GeneralException: Error rendering screen >>>>>> [component://ebp/widget/EBPScreens.xml#main]: >>>>>> org.ofbiz.base.util.GeneralException: Error rendering screen >>>>>> [component://ebp/widget/EBPScreens.xml#main-decorator]: >>>>>> java.lang.IllegalArgumentException: Error getting value from the >>>>>> database >>>>>> for display of field [firstName] on form [profile]: >>>>>> org.ofbiz.entity.GenericModelException: >>>>>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a >>>>>> valid >>>>>> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] >>>>>> (Error getting value from the database for display of field >>>>>> [firstName] >>>>>> on >>>>>> form [profile]: org.ofbiz.entity.GenericModelException: >>>>>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a >>>>>> valid >>>>>> primary key: >>>>>> [GenericEntity:Person][firstName,THE(java.lang.String)]) >>>>>> (Error rendering screen >>>>>> [component://ebp/widget/EBPScreens.xml#main-decorator]: >>>>>> java.lang.IllegalArgumentException: Error getting value from the >>>>>> database >>>>>> for display of field [firstName] on form [profile]: >>>>>> org.ofbiz.entity.GenericModelException: >>>>>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a >>>>>> valid >>>>>> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] >>>>>> (Error getting value from the database for display of field >>>>>> [firstName] >>>>>> on >>>>>> form [profile]: org.ofbiz.entity.GenericModelException: >>>>>> [GenericDelegator.findByPrimaryKey] Passed primary key is not a >>>>>> valid >>>>>> primary key: >>>>>> [GenericEntity:Person][firstName,THE(java.lang.String)])) >>>>>> >>>>>> >>>>>> The Screen: >>>>>> <screen name="main"> >>>>>> <section> >>>>>> <actions> >>>>>> <set field="headerItem" value="Main"/> >>>>>> <set field="roleTypeId" value="CONTACT"/> >>>>>> <set field="partyTypeId" value="PERSON"/> >>>>>> <set field="headerItem" value="Contacts"/> >>>>>> <set field="partyId" value="${userLogin.partyId}"/> >>>>>> <set field="lookupFlag" value="Y"/> >>>>>> <set field="extInfo" value="N"/> >>>>>> <set field="roleTypeId" value="ANY"/> >>>>>> <entity-one entity-name="Person" value-name="Person" /> >>>>>> </actions> >>>>>> <widgets> >>>>>> <decorator-screen name="main-decorator" >>>>>> location="component://ebp/widget/EBPScreens.xml"> >>>>>> <decorator-section name="body"> >>>>>> <section> >>>>>> >>>>>> <actions> >>>>>> <service service-name="findParty" >>>>>> auto-field-map="true"/> >>>>>> </actions> >>>>>> <widgets> >>>>>> <container style="screenlet"> >>>>>> <container >>>>>> style="screenlet-body"> >>>>>> <section> >>>>>> <condition> >>>>>> <not><if-empty >>>>>> field-name="partyList"/></not> >>>>>> </condition> >>>>>> <widgets> >>>>>> <include-form >>>>>> name="profile" >>>>>> location="component://ebp/widget/EBPForms.xml"/> >>>>>> </widgets> >>>>>> <fail-widgets> >>>>>> <container >>>>>> style="h3"> >>>>>> <label >>>>>> text="PARTY_NOT_FOUND"/> >>>>>> </container> >>>>>> </fail-widgets> >>>>>> </section> >>>>>> </container> >>>>>> </container> >>>>>> </widgets> >>>>>> </section> >>>>>> </decorator-section> >>>>>> </decorator-screen> >>>>>> </widgets> >>>>>> </section> >>>>>> </screen> >>>>>> >>>>>> The FORM: >>>>>> <form name="profile" type="list" target="Person" >>>>>> default-entity-name="Person" > >>>>>> <actions> >>>>>> <entity-condition entity-name="Person"> >>>>>> <condition-expr field-name="partyId" >>>>>> value="${userLogin.partyId}"/> >>>>>> <order-by field-name="partyId"/> >>>>>> </entity-condition> >>>>>> <entity-one entity-name="PartyType" value-name="partyType"> >>>>>> <field-map field-name="partyTypeId" >>>>>> env-name="partyRow.partyTypeId"/> >>>>>> </entity-one> >>>>>> </actions> >>>>>> <field name="partyId" title="PartyId" ><display-entity >>>>>> entity-name="Person"/></field> >>>>>> <field name="firstName"><display-entity >>>>>> entity-name="Person"/></field> >>>>>> <field name="middleName"><display-entity >>>>>> entity-name="Person"/></field> >>>>>> <field name="lastName"><display-entity >>>>>> entity-name="Person"/></field> >>>>>> <field name="personalTitle"><display-entity >>>>>> entity-name="Person"/></field> >>>>>> <field name="gender"><display-entity >>>>>> entity-name="Person"/></field> >>>>>> <field name="birthDate"><display-entity >>>>>> entity-name="Person"/></field> >>>>>> <field name="occupation"><display-entity >>>>>> entity-name="Person"/></field> >>>>>> <field name="lastModifiedDate"><display-entity >>>>>> entity-name="Person"/></field> >>>>>> <field name="lastModifiedByUserLogin"><display-entity >>>>>> entity-name="Person"/></field> >>>>>> </form> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>> >>>> >>>> >>>> >>> >> >> >> >> >> > > |
Hello milind ,
I suggest you to follow the step suggested by the BJ and try to print each the value of each one that you want on form like "partyList" to confirm that whether something is there or not and see other component also where this method "findParty" is used . I think then probably you get the answer. If after that you have error's so post them here may be someone help you. Thanks Ravi |
In reply to this post by Milind W-2
Hi. I think your problem is that youre not passing the partyId value or its
value is null. First, entity-one needs you to provide all primary keys for it to return something (hence the error: [GenericDelegator. findByPrimaryKey] Passed primary key is not a valid primary key:...) Second, youre not passing the partyId because this userLogin is null. At least from the snippet that you provided, userLogin is not defined anywhere. If youre intention was to retrieve the userLogin value of the currently logged in account, then you should retrieve the partyId this way: <set field="partyId" value="${*parameters.*userLogin.partyId}"/> Hope this helps. ~ ian On Mon, Aug 18, 2008 at 5:32 AM, Milind W <[hidden email]> wrote: > hi, > I think someone who understands the findParty method is probably the best > person to answer this. > I have a screen and form as detailed below. > I am trying to get the data from the person entity for the logged in user > and display it in a form. > Am I missing some parameters? or something else? > I am trying to debug this looking at the existing screens and forms but if > someone who understands this method can help, I would appreciate it. > Thanks > -Milind > > > The error: > > org.ofbiz.base.util.GeneralException: Error rendering screen > [component://ebp/widget/EBPScreens.xml#main]: > org.ofbiz.base.util.GeneralException: Error rendering screen > [component://ebp/widget/EBPScreens.xml#main-decorator]: > java.lang.IllegalArgumentException: Error getting value from the database > for display of field [firstName] on form [profile]: > org.ofbiz.entity.GenericModelException: > [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid > primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] > (Error getting value from the database for display of field [firstName] on > form [profile]: org.ofbiz.entity.GenericModelException: > [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid > primary key: [GenericEntity:Person][firstName,THE(java.lang.String)]) > (Error rendering screen > [component://ebp/widget/EBPScreens.xml#main-decorator]: > java.lang.IllegalArgumentException: Error getting value from the database > for display of field [firstName] on form [profile]: > org.ofbiz.entity.GenericModelException: > [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid > primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] > (Error getting value from the database for display of field [firstName] on > form [profile]: org.ofbiz.entity.GenericModelException: > [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid > primary key: [GenericEntity:Person][firstName,THE(java.lang.String)])) > > > The Screen: > <screen name="main"> > <section> > <actions> > <set field="headerItem" value="Main"/> > <set field="roleTypeId" value="CONTACT"/> > <set field="partyTypeId" value="PERSON"/> > <set field="headerItem" value="Contacts"/> > <set field="partyId" > value="${userLogin.partyId}"/> > <set field="lookupFlag" value="Y"/> > <set field="extInfo" value="N"/> > <set field="roleTypeId" value="ANY"/> > <entity-one entity-name="Person" > value-name="Person" /> > </actions> > <widgets> > <decorator-screen name="main-decorator" > location="component://ebp/widget/EBPScreens.xml"> > <decorator-section name="body"> > <section> > > <actions> > <service service-name="findParty" > auto-field-map="true"/> > </actions> > <widgets> > <container style="screenlet"> > <container style="screenlet-body"> > <section> > <condition> > <not><if-empty > field-name="partyList"/></not> > </condition> > <widgets> > <include-form > name="profile" > location="component://ebp/widget/EBPForms.xml"/> > </widgets> > <fail-widgets> > <container style="h3"> > <label > text="PARTY_NOT_FOUND"/> > </container> > </fail-widgets> > </section> > </container> > </container> > </widgets> > </section> > </decorator-section> > </decorator-screen> > </widgets> > </section> > </screen> > > The FORM: > <form name="profile" type="list" target="Person" > default-entity-name="Person" > > <actions> > <entity-condition entity-name="Person"> > <condition-expr field-name="partyId" > value="${userLogin.partyId}"/> > <order-by field-name="partyId"/> > </entity-condition> > <entity-one entity-name="PartyType" > value-name="partyType"> > <field-map field-name="partyTypeId" > env-name="partyRow.partyTypeId"/> > </entity-one> > </actions> > <field name="partyId" title="PartyId" ><display-entity > entity-name="Person"/></field> > <field name="firstName"><display-entity > entity-name="Person"/></field> > <field name="middleName"><display-entity > entity-name="Person"/></field> > <field name="lastName"><display-entity > entity-name="Person"/></field> > <field name="personalTitle"><display-entity > entity-name="Person"/></field> > <field name="gender"><display-entity > entity-name="Person"/></field> > <field name="birthDate"><display-entity > entity-name="Person"/></field> > <field name="occupation"><display-entity > entity-name="Person"/></field> > <field name="lastModifiedDate"><display-entity > entity-name="Person"/></field> > <field name="lastModifiedByUserLogin"><display-entity > entity-name="Person"/></field> > </form> > > > > |
Hi Ian
2008/8/18 ian tabangay <[hidden email]>: > At least from > the snippet that you provided, userLogin is not defined anywhere. If youre > intention was to retrieve the userLogin value of the currently logged in > account, then you should retrieve the partyId this way: > <set field="partyId" value="${*parameters.*userLogin.partyId}"/> userLogin is automatically put in the screen's context in the same way that the parameters map automatically get builts out of the request parameters and attrributes, session parameters etc. Regards Scott |
In reply to this post by ian tabangay
Found my problem.
It was my form, I was using 'display-entity' instead of 'display' for the field. e.g <field name="firstName"><display-entity entity-name="Person"/></field> Changed it to <field name="firstName"><display entity-name="Person"/></field> and now the form works fine I can retrieve the data for the logged in user from the person entity. > Hi. I think your problem is that youre not passing the partyId value or > its > value is null. First, entity-one needs you to provide all primary keys for > it to return something (hence the error: [GenericDelegator. > findByPrimaryKey] Passed primary key is not a valid primary key:...) > Second, > youre not passing the partyId because this userLogin is null. At least > from > the snippet that you provided, userLogin is not defined anywhere. If youre > intention was to retrieve the userLogin value of the currently logged in > account, then you should retrieve the partyId this way: > <set field="partyId" value="${*parameters.*userLogin.partyId}"/> > Hope this helps. > > ~ ian > > On Mon, Aug 18, 2008 at 5:32 AM, Milind W <[hidden email]> > wrote: > >> hi, >> I think someone who understands the findParty method is probably the >> best >> person to answer this. >> I have a screen and form as detailed below. >> I am trying to get the data from the person entity for the logged in >> user >> and display it in a form. >> Am I missing some parameters? or something else? >> I am trying to debug this looking at the existing screens and forms but >> if >> someone who understands this method can help, I would appreciate it. >> Thanks >> -Milind >> >> >> The error: >> >> org.ofbiz.base.util.GeneralException: Error rendering screen >> [component://ebp/widget/EBPScreens.xml#main]: >> org.ofbiz.base.util.GeneralException: Error rendering screen >> [component://ebp/widget/EBPScreens.xml#main-decorator]: >> java.lang.IllegalArgumentException: Error getting value from the >> database >> for display of field [firstName] on form [profile]: >> org.ofbiz.entity.GenericModelException: >> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] >> (Error getting value from the database for display of field [firstName] >> on >> form [profile]: org.ofbiz.entity.GenericModelException: >> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)]) >> (Error rendering screen >> [component://ebp/widget/EBPScreens.xml#main-decorator]: >> java.lang.IllegalArgumentException: Error getting value from the >> database >> for display of field [firstName] on form [profile]: >> org.ofbiz.entity.GenericModelException: >> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)] >> (Error getting value from the database for display of field [firstName] >> on >> form [profile]: org.ofbiz.entity.GenericModelException: >> [GenericDelegator.findByPrimaryKey] Passed primary key is not a valid >> primary key: [GenericEntity:Person][firstName,THE(java.lang.String)])) >> >> >> The Screen: >> <screen name="main"> >> <section> >> <actions> >> <set field="headerItem" value="Main"/> >> <set field="roleTypeId" value="CONTACT"/> >> <set field="partyTypeId" value="PERSON"/> >> <set field="headerItem" value="Contacts"/> >> <set field="partyId" >> value="${userLogin.partyId}"/> >> <set field="lookupFlag" value="Y"/> >> <set field="extInfo" value="N"/> >> <set field="roleTypeId" value="ANY"/> >> <entity-one entity-name="Person" >> value-name="Person" /> >> </actions> >> <widgets> >> <decorator-screen name="main-decorator" >> location="component://ebp/widget/EBPScreens.xml"> >> <decorator-section >> name="body"> >> <section> >> >> <actions> >> <service service-name="findParty" >> auto-field-map="true"/> >> </actions> >> <widgets> >> <container style="screenlet"> >> <container style="screenlet-body"> >> <section> >> <condition> >> <not><if-empty >> field-name="partyList"/></not> >> </condition> >> <widgets> >> <include-form >> name="profile" >> location="component://ebp/widget/EBPForms.xml"/> >> </widgets> >> <fail-widgets> >> <container style="h3"> >> <label >> text="PARTY_NOT_FOUND"/> >> </container> >> </fail-widgets> >> </section> >> </container> >> </container> >> </widgets> >> </section> >> </decorator-section> >> </decorator-screen> >> </widgets> >> </section> >> </screen> >> >> The FORM: >> <form name="profile" type="list" target="Person" >> default-entity-name="Person" > >> <actions> >> <entity-condition entity-name="Person"> >> <condition-expr field-name="partyId" >> value="${userLogin.partyId}"/> >> <order-by field-name="partyId"/> >> </entity-condition> >> <entity-one entity-name="PartyType" >> value-name="partyType"> >> <field-map field-name="partyTypeId" >> env-name="partyRow.partyTypeId"/> >> </entity-one> >> </actions> >> <field name="partyId" title="PartyId" ><display-entity >> entity-name="Person"/></field> >> <field name="firstName"><display-entity >> entity-name="Person"/></field> >> <field name="middleName"><display-entity >> entity-name="Person"/></field> >> <field name="lastName"><display-entity >> entity-name="Person"/></field> >> <field name="personalTitle"><display-entity >> entity-name="Person"/></field> >> <field name="gender"><display-entity >> entity-name="Person"/></field> >> <field name="birthDate"><display-entity >> entity-name="Person"/></field> >> <field name="occupation"><display-entity >> entity-name="Person"/></field> >> <field name="lastModifiedDate"><display-entity >> entity-name="Person"/></field> >> <field name="lastModifiedByUserLogin"><display-entity >> entity-name="Person"/></field> >> </form> >> >> >> >> > |
In reply to this post by Scott Gray
oh. sorry my version must have been very far from the recent release. in
that case, the partyId field (from the line <set field="partyId" value="${userLogin.partyId}"/>) isnt visible from <entity-one>. I believe entity-one uses the fields in the parameters map by default? And setting the userLogin.partyId to partyId field isnt the same as setting it to parameters.partyId. (sorry im used to an end of May build. I wanted to help but Im not that familiar with the changes) ~ ian On Mon, Aug 18, 2008 at 1:43 PM, Scott Gray <[hidden email]> wrote: > Hi Ian > > 2008/8/18 ian tabangay <[hidden email]>: > > At least from > > the snippet that you provided, userLogin is not defined anywhere. If > youre > > intention was to retrieve the userLogin value of the currently logged in > > account, then you should retrieve the partyId this way: > > <set field="partyId" value="${*parameters.*userLogin.partyId}"/> > > userLogin is automatically put in the screen's context in the same way > that the parameters map automatically get builts out of the request > parameters and attrributes, session parameters etc. > > Regards > Scott > |
It's been that way for a few years at least, you can see what is made
available in ScreenRenderer.populateContextForRequest() and in turn populateBasicContext(). Regarding entity-one the code looks for the primary keys in the parameters map first and then looks in the context itself, if anything is found in the context then that overrides what was found in the parameters map. Regards Scott 2008/8/18 ian tabangay <[hidden email]>: > oh. sorry my version must have been very far from the recent release. in > that case, the partyId field (from the line <set field="partyId" > value="${userLogin.partyId}"/>) isnt visible from <entity-one>. I believe > entity-one uses the fields in the parameters map by default? And setting the > userLogin.partyId to partyId field isnt the same as setting it to > parameters.partyId. (sorry im used to an end of May build. I wanted to help > but Im not that familiar with the changes) > > > ~ ian > > On Mon, Aug 18, 2008 at 1:43 PM, Scott Gray <[hidden email]> wrote: > >> Hi Ian >> >> 2008/8/18 ian tabangay <[hidden email]>: >> > At least from >> > the snippet that you provided, userLogin is not defined anywhere. If >> youre >> > intention was to retrieve the userLogin value of the currently logged in >> > account, then you should retrieve the partyId this way: >> > <set field="partyId" value="${*parameters.*userLogin.partyId}"/> >> >> userLogin is automatically put in the screen's context in the same way >> that the parameters map automatically get builts out of the request >> parameters and attrributes, session parameters etc. >> >> Regards >> Scott >> > |
Free forum by Nabble | Edit this page |