Login  Register

RE: [OFBiz] Dev - Using view-entity in a form

Posted by Michael Irving on Sep 03, 2005; 6:25pm
URL: http://ofbiz.116.s1.nabble.com/OFBiz-Dev-Sending-parameters-tp165933p165938.html

I've created the following screen, but I keep getting "
java.lang.NullPointerException (null)" if I pass in the partyId in the URL.
I just can't seem to get the screen to correctly query the Employee
entity-view that I created.  If I don't send a parameter, it will properly
go into "create" mode.:



<screen name="EditEmployee">
  <section>
   <actions>
      <set field="partyId" from-field="parameters.partyId"/>
      <set field="donePage" from-field="parameters.DONE_PAGE"
default-value="viewprofile"/>
      <entity-one entity-name="Employee" value-name="Person">
            <field-map env-name="partyId" field-name="partyId" />
      </entity-one>
   </actions>
   <widgets>
      <decorator-screen name="CommonDecorator">
         <decorator-section name="body">
           <include-form name="EditEmployee"
location="component://aztec-hrms/webapp/aztec-hrms/forms/HrmsForms.xml"/>
         </decorator-section>
      </decorator-screen>
   </widgets>
 </section>
</screen>

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On
Behalf Of Michael Irving
Sent: Saturday, September 03, 2005 11:48 AM
To: 'OFBiz Project Development Discussion'
Subject: [OFBiz] Dev - Using view-entity in a form

I created a view-entity (Employee) that queries the Person table.  I then
created a form "Edit Employee" see below.  The form works when I want to
create anew employee, but when I pass the personId, I get:

org.ofbiz.base.util.GeneralException: Error rendering screen [EditEmployee]:
java.lang.NullPointerException (null)

I know I must be missing something very basic.  Can someone help?

Thanks,

-Mike


<form name="EditEmployee" type="single"
            target="updatePerson" title="" default-map-name="employee"
            default-title-style="tableheadtext"
default-widget-style="inputBox" default-tooltip-style="tabletext">
        <alt-target use-when="partyId==null" target="createPerson"/>
        <auto-fields-entity entity-name="Employee"/>
       
        <field use-when="partyId!=null" name="partyId"
title="${uiLabelMap.PartyPartyId}"
tooltip="${uiLabelMap.CommonNotModifRecreat}"><display/></field>
        <!--
        <field use-when="employee==null&amp;&amp;partyId==null"
name="partyId" title="${uiLabelMap.PartyPartyId}"><ignored/></field>
        <field use-when="employee==null&amp;&amp;partyId!=null"
name="partyId" title="${uiLabelMap.PartyPartyId}"
tooltip="${uiLabelMap.CommonCannotBeFound}: [${partyId}]"><display/></field>
         -->

        <field name="gender">
            <drop-down allow-empty="true">
                <option key="M" description="Male"/>
                <option key="F" description="Female"/>
            </drop-down>
        </field>
        <field name="maritalStatus">
            <drop-down allow-empty="true">
                <option key="S" description="Single"/>
                <option key="M" description="Married"/>
                <option key="P" description="Separated"/>
                <option key="D" description="Divorced"/>
                <option key="W" description="Widowed"/>
            </drop-down>
        </field>
       
        <field name="submitButton" title="[${uiLabelMap.CommonSave}]"
widget-style="buttontext"><submit button-type="text-link"/></field>
        <field name="cancelLink" title=" "
widget-style="buttontext"><hyperlink target="${donePage}?partyId=${partyId}"
also-hidden="false" description="[${uiLabelMap.CommonCancelDone}]"/></field>
    </form>

 
_______________________________________________
Dev mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/dev

 
_______________________________________________
Dev mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/dev