You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Adrian Crum <ad...@hlmksw.com> on 2007/04/06 23:54:11 UTC

Screen Widget Ideas

I've been playing around with the screen widget java code to implement a few 
enhancements. One thing I noticed is there is a lot of redundant code and the 
widgets aren't consistent in how they are constructed/used.

I would like to refactor the widgets to make better use of OOP - which will 
reduce code and make the widgets more consistent. Before I get started, I would 
like to put some of my ideas on the mailing list to see what everyone thinks.

1. Have all widgets contain a common set of attributes (or properties). Since 
the widgets are used mostly for HTML output, they should at least contain the 
standard HTML attributes. The standard attributes might not have meaning to 
other rendering methods or some types of widgets.

(HTML standard attributes - 
http://www.w3schools.com/tags/ref_standardattributes.asp)

2. Somehow break up the remaining attributes into meaningful categories. Chris 
Howe suggested this for the form widget - 
https://issues.apache.org/jira/browse/OFBIZ-762.

3. Create base classes for the model widgets and renderer classes. The base 
classes would contain the code that all of the model widgets/renderers share, 
and each type of model widget/renderer will be derived from the common base class.

4. All of this will be completely backward-compatible, there will be no need to 
change any widget XML files. The new categories Chris Howe proposed will be 
supported in addition to the current methods. A warning will be logged about 
switching over to the new categories when reading older-style XML files.

That's it for now. Let me know what you think.

-Adrian


Re: Screen Widget Ideas

Posted by BJ Freeman <bj...@free-man.net>.
hmmmm seems we are getting to complicated IMHO.
instead of java code to deal with the HTML attributes, would rather have
a widget attribute that lets this happen free hand.
sort of like on a html page, you can mix scripts with HTML.

I would like to see efforts on the widgets be able to make a complicated
layout simpler. A layout like the eclipse IDE but in widgets.

maybe a service that can do pretty print of widgets and a validation,
like w3c uses.

Adrian Crum sent the following on 4/6/2007 1:54 PM:
> I've been playing around with the screen widget java code to implement a
> few enhancements. One thing I noticed is there is a lot of redundant
> code and the widgets aren't consistent in how they are constructed/used.
> 
> I would like to refactor the widgets to make better use of OOP - which
> will reduce code and make the widgets more consistent. Before I get
> started, I would like to put some of my ideas on the mailing list to see
> what everyone thinks.
> 
> 1. Have all widgets contain a common set of attributes (or properties).
> Since the widgets are used mostly for HTML output, they should at least
> contain the standard HTML attributes. The standard attributes might not
> have meaning to other rendering methods or some types of widgets.
> 
> (HTML standard attributes -
> http://www.w3schools.com/tags/ref_standardattributes.asp)
> 
> 2. Somehow break up the remaining attributes into meaningful categories.
> Chris Howe suggested this for the form widget -
> https://issues.apache.org/jira/browse/OFBIZ-762.
> 
> 3. Create base classes for the model widgets and renderer classes. The
> base classes would contain the code that all of the model
> widgets/renderers share, and each type of model widget/renderer will be
> derived from the common base class.
> 
> 4. All of this will be completely backward-compatible, there will be no
> need to change any widget XML files. The new categories Chris Howe
> proposed will be supported in addition to the current methods. A warning
> will be logged about switching over to the new categories when reading
> older-style XML files.
> 
> That's it for now. Let me know what you think.
> 
> -Adrian
> 
> 
> 
>