feel free to submit a patch in the jira http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best+Practices http://docs.ofbiz.org/display/OFBADMIN/Coding+Conventions http://docs.ofbiz.org/display/OFBADMIN/Best+Practices+Guide
BJ Freeman sent the following on 10/25/2008 11:37 AM: > put in a jira > https://issues.apache.org/jira/browse/OFBIZ-2021 > > BJ Freeman sent the following on 10/25/2008 11:22 AM: >> Ok yes you can define max less than the DB fieldtype. >> looks like some reformating is done in >> ModelFormField.java >> about like 548. >> } else if ("name".equals(modelField.getType()) || >> "short-varchar".equals(modelField.getType())) { >> ModelFormField.TextField textField = new >> ModelFormField.TextField(ModelFormField.FieldInfo.SOURCE_AUTO_ENTITY, this); >> textField.setSize(40); >> textField.setMaxlength(Integer.valueOf(60)); >> this.setFieldInfo(textField); >> >> >> Vu Hong Thuan sent the following on 10/25/2008 10:18 AM: >>> Hi BJ, >>> Thank for suggestion. But I find some interesting: >>> >>> 1. I'm using PostgreSQL. And in the file >>> /framework/entity/fieldtype/fieldtypepostgres.xml, I find the following >>> line: >>> <field-type-def type="name" sql-type="VARCHAR(100)" >>> java-type="String"></field-type-def> >>> That means length of "type=name" field is equal to varchar(100) in postgres. >>> >>> 2. In file entitymodel.xml of party application, at PartyGroup entity >>> definition, the groupNameLocal field is defined as: >>> <field name="groupNameLocal" type="name"></field> >>> >>> 3. In table party_group of the postgres db, I find the field >>> group_name_local has length 100. That's ok. >>> >>> 4. In the form create PartyGroup of party application, the groupNameLocal >>> text box has size is 40. So I only type 40 characters. This opposite to all >>> three above things. >>> >>> Could you give me suggestion? >>> Thank you very much. >>> >>> >>> 2008/10/25 BJ Freeman <[EMAIL PROTECTED]> >>> >>>> more detailed inline >>>> >>>> Vu Hong Thuan sent the following on 10/25/2008 3:16 AM: >>>>> Hi, >>>>> I'm a newbie in ofbiz. I have a question. >>>>> The length of the entity field whose type is "name" is 100. By when is >>>>> rendered as a textbox in form, the size of text box is 40. >>>> Then the DB file that define that field type says it is 40. >>>> >>>>> I really don't know about the mismatch in size of file type and of >>>> text-box >>>>> form input. >>>> you need to become familiar with how ofbiz works. you don't define max >>>> field lengths in the UI, it is done at the entity level, and the DB file >>>> for the DB you are using. >>>> >>>> >>>> >>>>> Eg. In the form "createPartyGroup" size of GroupName text-box is 40. But >>>> in >>>>> the entity.config, type of GroupName field is "name" type. And length of >>>>> "name" type is 100. >>>>> How can I change the size of text-box of "name"-type entity field to 100? >>>> This is defined in the file for the DB you are using. >>>> since it will effect all fields in every entity with that type, it is >>>> better to use extend-entity and create a new field that uses one of the >>>> fieldtypes that uses a blob or text db type. >>>> >>>>> Thank for any suggestion. >>>>> >>> >> > >
