Could you give me an example in OFBiz? I think it's very easy for you to find an example?
-----Original Message----- From: BJ Freeman [mailto:[email protected]] Sent: 2009年2月17日 20:51 To: [email protected] Subject: Re: Tricky! About fields in the form -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 find a page that has a drop down and look at the code. preferably widget. also look up views that use the org.ofbiz.common.enum entity there are examples in code. My comments are how ofbiz sees things. it takes a while for a datbase centric person to see things the way ofbiz does it. I speak from experience. If you step back and let go of the Table Columnnames, it helps. Jack Liu sent the following on 2/16/2009 9:36 PM: > Why would my attribute be enumerations? > You mean attribute references an enumeration below? > > <entity entity-name="protocolAttribute" > <field name="id" type="id-ne"></field> > <field name="protocolid" type="id"></field> > <field name="attribute" type="long-varchar"></field> > <field name="value" type="long-varchar"></field> > <prim-key field="protocolid"/> > <relation type="one" fk-name="ATTRIBUTE_ENUM" rel-entity-name="Enumeration"> > <key-map field-name="attribute" rel-field-name="enumId"/> > </relation> > </entity> > > If a field is from an enumeration, in the page it will show a drop-down list. > It's now what I want. What I want shows like below: > > <form name="A" type="single" > target="createProtocolAttribute?protocolid=${id}"> > <field name="ChlUrl"><text/></field> > <field name="SupportedCharsets"><text/></field> > <field name="ServerID"><text/></field> > <field name="submitButton" title="Add Protocol"> > <submit button-type="button"/> > </field> > </form> > > -----Original Message----- > From: BJ Freeman [mailto:[email protected]] > Sent: 2009年2月17日 13:08 > To: [email protected] > Subject: Re: Tricky! About fields in the form > > A table in a database is an entity > in entity form you would have 4 fields > <entity entity-name="protocolAttribute" > field name="id" type="id-ne"></field> > <field name="protocolid" type="id"></field> > <field name="attribute" type="long-varchar"></field> > <field name="value" type="long-varchar"></field> > <prim-key field="protocolid"/> > </entity> > your attribute would be enumerations > > BTW you can do an export of entities and it will build the Entity from > the table you put in. > > > Jack Liu sent the following on 2/16/2009 6:03 PM: >> In the table protocolAttribute, records show below >> id, protocolid, attribute, value >> 1 1 ChlUrl 192.168.77.22/abc >> 2 1 ServerID DWAI >> 3 2 ChlUrl 192.168.77.22/abc >> 4 2 SupportedCharsets gbk,UTF8 > > >> -----Original Message----- >> From: Jack Liu [mailto:[email protected]] >> Sent: 2009t217 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFJmrLLrP3NbaWWqE4RApBBAJ4874sQawsLHj4UAR0o2gXJ9LioNwCfVbfb 779UzmDOBgw4oKsAKc9p0S4= =oFaO -----END PGP SIGNATURE-----
