You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Deepika1234 <de...@tcs.com> on 2010/06/07 11:08:33 UTC

Where from the field id is getting populated in an xml file form?

In CommForms.xml we have the following sub-forms:-


<field name="roleTypeIdFrom" widget-style="length1">
            <drop-down no-current-selected-key="_NA_">
                <entity-options description="${description}"
entity-name="RoleType" key-field-name="roleTypeId">
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>

        <field name="roleTypeIdTo" position="2" widget-style="length1" >
            <drop-down no-current-selected-key="_NA_">
                <entity-options description="${description}"
entity-name="RoleType" key-field-name="roleTypeId">
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>


The view source we get 

<td class="label">Role Type Id To</td>
   <td><select class="length1" name="roleTypeIdTo"
id="EditCommEvent_roleTypeIdTo" size="1"><option
value="ACCOUNT">Account</option><option value="ACCOUNT_LEAD">Account
Lead</option><option value="ADDRESSEE">Addressee</option><option
value="ADMIN">Administrator</option><option
value="AFFILIATE">Affiliate</option><option
value="AGENT">Agent</option><option
value="APPROVER">Approver</option><option
value="ASSOCIATION">Association</option><option
value="AUTOMATED_AGENT_ROLE">Automated Agent</option><option
value="BILL_FROM_VENDOR">Bill-From-Vendor</option><option
value="BILL_TO_CUSTOMER">Bill-To Customer</option><option value="BCC">Blind
Copy</option><option value="BULK_CUSTOMER">Bulk Customer</option><option
value="BUYER">Buyer</option><option
value="CALENDAR_ROLE">Calendar</option><option value="CAL_ATTENDEE">Calendar
Attendee</option><option value="CAL_DELEGATE">Calendar
Delegate</option><option value="CAL_HOST">Calendar Host</option><option
value="CAL_ORGANIZER">Calendar Organizer</option><option
value="CAL_OWNER">Calendar Owner</option><option value="CC">Carbon
Copy</option><option value="CARRIER">Carrier</option><option
value="CASHIER">Cashier</option><option
value="CLIENT">Client</option><option value="CLIENT_ANALYST">Client
Analyst</option><option value="CLIENT_BILLING">Client
Billing</option><option value="CLIENT_MANAGER">Client
Manager</option><option value="COMMEVENT_ROLE">Communication
Participant</option><option value="COMPETITOR">Competitor</option><option
value="CONSUMER">Consumer</option><option
value="CONTACT">Contact</option><option value="CONTENT_ADMIN">Content
Administrator</option><option value="CONTENT_AUTHOR">Content
Author</option><option value="CONTENT_EDITOR">Content Editor</option><option
value="CONTENT_GUEST">Content Guest</option><option value="CONTENT">Content
Member</option><option value="CONTENT_PUBLISHER">Content
Publisher</option><option value="CONTENT_USER">Content User</option><option
value="CONTRACTOR">Contractor</option><option
value="CUSTOMER">Customer</option><option
value="DEPARTMENT">Department</option><option
value="DISTRIBUTION_CHANNEL">Distribution Channel</option><option
value="DISTRIBUTOR">Distributor</option><option
value="DIVISION">Division</option><option value="EMAIL_ADMIN">Email
Administrator</option><option value="EMPLOYEE">Employee</option><option
value="END_USER_CUSTOMER">End-User Customer</option><option
value="FAMILY_MEMBER">Family Member</option><option
value="FAM_ASSIGNEE">Fixed Asset Maint Assignee</option><option
value="HOSTING_SERVER">Hosting Server</option><option
value="HOUSEHOLD">Household</option><option
value="INTERNAL_ORGANIZATIO">Internal Organization</option><option
value="ISP">ISP</option><option value="LEAD">Lead</option><option
value="LTD_ADMIN">Limited Administrator</option><option
value="LOGGEDIN">Logged In</option><option value="FAM_MANAGER">Maintenance
Manager or Supervisor</option><option value="FAM_SUPPLIER">Maintenance
Supplier or Service</option><option value="FAM_WORKER">Maintenance
Worker</option><option value="MANAGER">Manager</option><option
value="MANUFACTURER">Manufacturer</option><option selected="selected"
value="_NA_">Not Applicable</option><option value="ORDER_CLERK">Order
Clerk</option><option value="ORGANIZATION_ROLE">Organization</option><option
value="ORGANIZATION_UNIT">Organization Unit</option><option
value="ORIGINATOR">Originator</option><option
value="OTHER_INTERNAL_ORGAN">Other Internal</option><option
value="OTHER_ORGANIZATION_U">Other Organization Unit</option><option
value="OWNER">Owner</option><option value="PACKER">Packer</option><option
value="PARENT_ORGANIZATION">Parent Organization</option><option
value="PARTNER">Partner</option><option
value="PERSON_ROLE">Person</option><option
value="PICKER">Picker</option><option value="PLACING_CUSTOMER">Placing
Customer</option><option value="PROJECT_TEAM">Project Team</option><option
value="PROSPECT">Prospect</option><option
value="PROVIDER_ACCOUNTING">Provider Accounting</option><option
value="PROVIDER_ANALYST">Provider Analyst</option><option
value="PROVIDER_FUNCTIONAL">Provider Functional</option><option
value="PROVIDER_MANAGER">Provider Manager</option><option
value="PROVIDER_TESTER">Provider Tester</option><option
value="PROVIDER_VALIDATOR">Provider Validator</option><option
value="RECEIVER">Receiver</option><option
value="REFERRER">Referrer</option><option
value="REGULATORY_AGENCY">Regulatory Agency</option><option
value="REQ_MANAGER">Request Manager</option><option
value="REQ_TAKER">Request Taker</option><option
value="REQ_REQUESTER">Requesting Party</option><option
value="REVIEWER">Reviewer</option><option value="SALES_REP">Sales
Representative</option><option
value="SHAREHOLDER">Shareholder</option><option
value="SHIP_FROM_VENDOR">Ship-From Vendor</option><option
value="SHIP_TO_CUSTOMER">Ship-To Customer</option><option
value="SHIPMENT_CLERK">Shipment Clerk</option><option
value="SPONSOR">Sponsor</option><option
value="SPOUSE">Spouse</option><option
value="STOCKER">Stocker</option><option
value="SUBSCRIBER">Subscriber</option><option
value="SUBSIDIARY">Subsidiary</option><option
value="SUPPLIER">Supplier</option><option value="SUPPLIER_AGENT">Supplier
Agent</option><option value="TAX_AUTHORITY">Tax Authority</option><option
value="UNION">Union</option><option value="VENDOR">Vendor</option><option
value="VISITOR">Visitor</option><option value="WEB_MASTER">Web
Master</option><option value="WORKER">Worker</option><option
value="WORKFLOW_ROLE">Workflow</option><option value="WF_OWNER">Workflow
Owner</option></select></td>

I would like to know the
id="EditCommEvent_roleTypeIdTo"  is coming from where since we are not
providing the same in the form CommForms.xml .
Please let me know.


-- 
View this message in context: http://ofbiz.135035.n4.nabble.com/Where-from-the-field-id-is-getting-populated-in-an-xml-file-form-tp2245694p2245694.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Where from the field id is getting populated in an xml file form?

Posted by Ankit Jain <an...@hotwaxmedia.com>.
On Tuesday 08 June 2010 10:17 AM, Deepika1234 wrote:
> In form  CommForms.xml at no place<auto-fields-service>   is specified.
> Please let me know from where the form id is getting populated in the view
> source.
> <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd"
>    
>>      
>   <form name="EditCommEvent" type="single" target="updateCommunicationEvent"
> default-map-name="communicationEvent">
>          <alt-target target="createCommunicationEvent"
> use-when="communicationEvent==null"/>
>
> ------------------------------------------------------------------
> <field name="roleTypeIdFrom" widget-style="length1">
>              <drop-down no-current-selected-key="_NA_">
>                  <entity-options description="${description}"
> entity-name="RoleType" key-field-name="roleTypeId">
>                      <entity-order-by field-name="description"/>
>                  </entity-options>
>              </drop-down>
>          </field>
>
>          <field name="roleTypeIdTo" position="2" widget-style="length1">
>              <drop-down no-current-selected-key="_NA_">
>                  <entity-options description="${description}"
> entity-name="RoleType" key-field-name="roleTypeId">
>                      <entity-order-by field-name="description"/>
>                  </entity-options>
>              </drop-down>
>          </field>
>
>
>
>    
Hi Deepika,

As i am getting you want to know that how the id of the field changes in 
the view source.

The form is rendered through MacroFormRenderer.java,  if we talk about 
DropDown then in the file you find a method renderDropDownField() which 
is used to render dropdown. here you see

String id = modelFormField.getCurrentContainerId(context);

so the id which you see in the view source is actually set from here...
or you can also trace further...

-- 
Thanks&  Regards:
Ankit Jain
Enterprise Software Developer
Hotwax Media Pvt. Ltd.
www.hotwaxmedia.com


Re: Where from the field id is getting populated in an xml file form?

Posted by Shubham Dubey <sh...@hotwaxmedia.com>.
If you specify your own id name then it gets displayed else it is 
generated as follows
 
 see : ModelFormField.java  ( 1102  )


 public String getIdName() {
        if (UtilValidate.isNotEmpty(idName)) {
            return idName;
        } else {
            *return this.modelForm.getName() + "_" + this.getFieldName();*
        }
    }


Thanks &  Regards:
Shubham Dubey
Enterprise Software Developer
Hotwax Media Pvt. Ltd.
www.hotwaxmedia.com


Shubham Dubey wrote:
> Hi Deepika
>
> This id is generated as follows
> id= formName +"_" + fieldName
>
>
>
> Thanks
> Shubham Dubey
>
>
> Deepika1234 wrote:
>> In form  CommForms.xml at no place <auto-fields-service >  is specified.
>> Please let me know from where the form id is getting populated in the 
>> view
>> source.
>> <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd" 
>>
>>    <form name="EditCommEvent" type="single" 
>> target="updateCommunicationEvent"
>> default-map-name="communicationEvent">
>>         <alt-target target="createCommunicationEvent"
>> use-when="communicationEvent==null"/>
>>                
>> ------------------------------------------------------------------
>> <field name="roleTypeIdFrom" widget-style="length1">
>>             <drop-down no-current-selected-key="_NA_">
>>                 <entity-options description="${description}"
>> entity-name="RoleType" key-field-name="roleTypeId">
>>                     <entity-order-by field-name="description"/>
>>                 </entity-options>
>>             </drop-down>
>>         </field>
>>                  <field name="roleTypeIdTo" position="2" 
>> widget-style="length1" >
>>             <drop-down no-current-selected-key="_NA_">
>>                 <entity-options description="${description}"
>> entity-name="RoleType" key-field-name="roleTypeId">
>>                     <entity-order-by field-name="description"/>
>>                 </entity-options>
>>             </drop-down>
>>         </field>
>>
>>
>>
>>   

Re: Where from the field id is getting populated in an xml file form?

Posted by Shubham Dubey <sh...@hotwaxmedia.com>.
Hi Deepika

This id is generated as follows
id= formName +"_" + fieldName



Thanks
Shubham Dubey


Deepika1234 wrote:
> In form  CommForms.xml at no place <auto-fields-service >  is specified.
> Please let me know from where the form id is getting populated in the view
> source.
> <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd"
>   
>  <form name="EditCommEvent" type="single" target="updateCommunicationEvent"
> default-map-name="communicationEvent">
>         <alt-target target="createCommunicationEvent"
> use-when="communicationEvent==null"/>
>                
> ------------------------------------------------------------------
> <field name="roleTypeIdFrom" widget-style="length1">
>             <drop-down no-current-selected-key="_NA_">
>                 <entity-options description="${description}"
> entity-name="RoleType" key-field-name="roleTypeId">
>                     <entity-order-by field-name="description"/>
>                 </entity-options>
>             </drop-down>
>         </field>
>          
>         <field name="roleTypeIdTo" position="2" widget-style="length1" >
>             <drop-down no-current-selected-key="_NA_">
>                 <entity-options description="${description}"
> entity-name="RoleType" key-field-name="roleTypeId">
>                     <entity-order-by field-name="description"/>
>                 </entity-options>
>             </drop-down>
>         </field>
>
>
>
>   

Re: Where from the field id is getting populated in an xml file form?

Posted by Deepika1234 <de...@tcs.com>.
In form  CommForms.xml at no place <auto-fields-service >  is specified.
Please let me know from where the form id is getting populated in the view
source.
<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd"
>
 <form name="EditCommEvent" type="single" target="updateCommunicationEvent"
default-map-name="communicationEvent">
        <alt-target target="createCommunicationEvent"
use-when="communicationEvent==null"/>
               
------------------------------------------------------------------
<field name="roleTypeIdFrom" widget-style="length1">
            <drop-down no-current-selected-key="_NA_">
                <entity-options description="${description}"
entity-name="RoleType" key-field-name="roleTypeId">
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>
         
        <field name="roleTypeIdTo" position="2" widget-style="length1" >
            <drop-down no-current-selected-key="_NA_">
                <entity-options description="${description}"
entity-name="RoleType" key-field-name="roleTypeId">
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>



-- 
View this message in context: http://ofbiz.135035.n4.nabble.com/Where-from-the-field-id-is-getting-populated-in-an-xml-file-form-tp2245694p2246858.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Where from the field id is getting populated in an xml file form?

Posted by Patrick <pa...@gmail.com>.
are you using <auto-fields-service > in CommForms.xml?

On Mon, Jun 7, 2010 at 4:08 AM, Deepika1234 <de...@tcs.com> wrote:
>
> In CommForms.xml we have the following sub-forms:-
>
>
> <field name="roleTypeIdFrom" widget-style="length1">
>            <drop-down no-current-selected-key="_NA_">
>                <entity-options description="${description}"
> entity-name="RoleType" key-field-name="roleTypeId">
>                    <entity-order-by field-name="description"/>
>                </entity-options>
>            </drop-down>
>        </field>
>
>        <field name="roleTypeIdTo" position="2" widget-style="length1" >
>            <drop-down no-current-selected-key="_NA_">
>                <entity-options description="${description}"
> entity-name="RoleType" key-field-name="roleTypeId">
>                    <entity-order-by field-name="description"/>
>                </entity-options>
>            </drop-down>
>        </field>
>
>
> The view source we get
>
> <td class="label">Role Type Id To</td>
>   <td><select class="length1" name="roleTypeIdTo"
> id="EditCommEvent_roleTypeIdTo" size="1"><option
> value="ACCOUNT">Account</option><option value="ACCOUNT_LEAD">Account
> Lead</option><option value="ADDRESSEE">Addressee</option><option
> value="ADMIN">Administrator</option><option
> value="AFFILIATE">Affiliate</option><option
> value="AGENT">Agent</option><option
> value="APPROVER">Approver</option><option
> value="ASSOCIATION">Association</option><option
> value="AUTOMATED_AGENT_ROLE">Automated Agent</option><option
> value="BILL_FROM_VENDOR">Bill-From-Vendor</option><option
> value="BILL_TO_CUSTOMER">Bill-To Customer</option><option value="BCC">Blind
> Copy</option><option value="BULK_CUSTOMER">Bulk Customer</option><option
> value="BUYER">Buyer</option><option
> value="CALENDAR_ROLE">Calendar</option><option value="CAL_ATTENDEE">Calendar
> Attendee</option><option value="CAL_DELEGATE">Calendar
> Delegate</option><option value="CAL_HOST">Calendar Host</option><option
> value="CAL_ORGANIZER">Calendar Organizer</option><option
> value="CAL_OWNER">Calendar Owner</option><option value="CC">Carbon
> Copy</option><option value="CARRIER">Carrier</option><option
> value="CASHIER">Cashier</option><option
> value="CLIENT">Client</option><option value="CLIENT_ANALYST">Client
> Analyst</option><option value="CLIENT_BILLING">Client
> Billing</option><option value="CLIENT_MANAGER">Client
> Manager</option><option value="COMMEVENT_ROLE">Communication
> Participant</option><option value="COMPETITOR">Competitor</option><option
> value="CONSUMER">Consumer</option><option
> value="CONTACT">Contact</option><option value="CONTENT_ADMIN">Content
> Administrator</option><option value="CONTENT_AUTHOR">Content
> Author</option><option value="CONTENT_EDITOR">Content Editor</option><option
> value="CONTENT_GUEST">Content Guest</option><option value="CONTENT">Content
> Member</option><option value="CONTENT_PUBLISHER">Content
> Publisher</option><option value="CONTENT_USER">Content User</option><option
> value="CONTRACTOR">Contractor</option><option
> value="CUSTOMER">Customer</option><option
> value="DEPARTMENT">Department</option><option
> value="DISTRIBUTION_CHANNEL">Distribution Channel</option><option
> value="DISTRIBUTOR">Distributor</option><option
> value="DIVISION">Division</option><option value="EMAIL_ADMIN">Email
> Administrator</option><option value="EMPLOYEE">Employee</option><option
> value="END_USER_CUSTOMER">End-User Customer</option><option
> value="FAMILY_MEMBER">Family Member</option><option
> value="FAM_ASSIGNEE">Fixed Asset Maint Assignee</option><option
> value="HOSTING_SERVER">Hosting Server</option><option
> value="HOUSEHOLD">Household</option><option
> value="INTERNAL_ORGANIZATIO">Internal Organization</option><option
> value="ISP">ISP</option><option value="LEAD">Lead</option><option
> value="LTD_ADMIN">Limited Administrator</option><option
> value="LOGGEDIN">Logged In</option><option value="FAM_MANAGER">Maintenance
> Manager or Supervisor</option><option value="FAM_SUPPLIER">Maintenance
> Supplier or Service</option><option value="FAM_WORKER">Maintenance
> Worker</option><option value="MANAGER">Manager</option><option
> value="MANUFACTURER">Manufacturer</option><option selected="selected"
> value="_NA_">Not Applicable</option><option value="ORDER_CLERK">Order
> Clerk</option><option value="ORGANIZATION_ROLE">Organization</option><option
> value="ORGANIZATION_UNIT">Organization Unit</option><option
> value="ORIGINATOR">Originator</option><option
> value="OTHER_INTERNAL_ORGAN">Other Internal</option><option
> value="OTHER_ORGANIZATION_U">Other Organization Unit</option><option
> value="OWNER">Owner</option><option value="PACKER">Packer</option><option
> value="PARENT_ORGANIZATION">Parent Organization</option><option
> value="PARTNER">Partner</option><option
> value="PERSON_ROLE">Person</option><option
> value="PICKER">Picker</option><option value="PLACING_CUSTOMER">Placing
> Customer</option><option value="PROJECT_TEAM">Project Team</option><option
> value="PROSPECT">Prospect</option><option
> value="PROVIDER_ACCOUNTING">Provider Accounting</option><option
> value="PROVIDER_ANALYST">Provider Analyst</option><option
> value="PROVIDER_FUNCTIONAL">Provider Functional</option><option
> value="PROVIDER_MANAGER">Provider Manager</option><option
> value="PROVIDER_TESTER">Provider Tester</option><option
> value="PROVIDER_VALIDATOR">Provider Validator</option><option
> value="RECEIVER">Receiver</option><option
> value="REFERRER">Referrer</option><option
> value="REGULATORY_AGENCY">Regulatory Agency</option><option
> value="REQ_MANAGER">Request Manager</option><option
> value="REQ_TAKER">Request Taker</option><option
> value="REQ_REQUESTER">Requesting Party</option><option
> value="REVIEWER">Reviewer</option><option value="SALES_REP">Sales
> Representative</option><option
> value="SHAREHOLDER">Shareholder</option><option
> value="SHIP_FROM_VENDOR">Ship-From Vendor</option><option
> value="SHIP_TO_CUSTOMER">Ship-To Customer</option><option
> value="SHIPMENT_CLERK">Shipment Clerk</option><option
> value="SPONSOR">Sponsor</option><option
> value="SPOUSE">Spouse</option><option
> value="STOCKER">Stocker</option><option
> value="SUBSCRIBER">Subscriber</option><option
> value="SUBSIDIARY">Subsidiary</option><option
> value="SUPPLIER">Supplier</option><option value="SUPPLIER_AGENT">Supplier
> Agent</option><option value="TAX_AUTHORITY">Tax Authority</option><option
> value="UNION">Union</option><option value="VENDOR">Vendor</option><option
> value="VISITOR">Visitor</option><option value="WEB_MASTER">Web
> Master</option><option value="WORKER">Worker</option><option
> value="WORKFLOW_ROLE">Workflow</option><option value="WF_OWNER">Workflow
> Owner</option></select></td>
>
> I would like to know the
> id="EditCommEvent_roleTypeIdTo"  is coming from where since we are not
> providing the same in the form CommForms.xml .
> Please let me know.
>
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/Where-from-the-field-id-is-getting-populated-in-an-xml-file-form-tp2245694p2245694.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>