I'm not sure I follow. Widgets are part of the presentation layer. I would say that the default configuration of each item is business logic and specified elsewhere. Currently, it uses a somewhat random method of the default being the first choice available.
Has this just not been an issue for anyone yet? -----Original Message----- From: BJ Freeman [mailto:[EMAIL PROTECTED] Sent: Friday, November 09, 2007 1:49 PM To: [email protected] Subject: Re: [jira] Created: (OFBIZ-1393) Need a better way to specify the default item configuration This is left up to programmer using the widgets. See patch in https://issues.apache.org/jira/browse/OFBIZ-1392 Chris Lombardi (JIRA) sent the following on 11/9/2007 10:28 AM: > Need a better way to specify the default item configuration > ----------------------------------------------------------- > > Key: OFBIZ-1393 > URL: https://issues.apache.org/jira/browse/OFBIZ-1393 > Project: OFBiz > Issue Type: Improvement > Components: product > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Chris Lombardi > Priority: Minor > > > Currently, setDefaultConfig in ProductConfigWrapper assumes the default is the first ProductConfigOption. I would like to be able to set up different products that shared a set of ProductConfigOptions yet allow for a different default ProductConfigOption. > > I don't yet have an opinion on how I can best implement this and my Data Model Resource Book is in the mail. Does anyone have any thoughts or preferences? > > Here's how it's currently implemented: > > public void setDefaultConfig() { > resetConfig(); > for (int i = 0; i < questions.size(); i++) { > ConfigItem ci = (ConfigItem)questions.get(i); > if (ci.isMandatory()) { > if (ci.getOptions().size() > 0) { > ConfigOption co = (ConfigOption)ci.getOptions().get(0); // default is first option > co.setSelected(true); > } > } > } > } > >
