After working with the screen widgets for a while, and having modified them too, I've come to the conclusion that the project could really benefit from higher level screen widgets.

The first benefit I see is reduced XML code needed. I recently committed a screenlet widget that significantly reduces the amount of XML needed to create a screenlet.

There is a Jira issue open to discuss a standard Find screen layout (https://issues.apache.org/jira/browse/OFBIZ-1635) and since nearly every component has one or more Find screens, that could become a widget too. An entire Find screen could be defined with 5 lines of XML.

The second benefit I see would be the reduction of screen widget "hacks." Take for instance the following line

<container style="clear"/>

which is used to clear floats in a multicolumn page layout. The problem with that line of widget code is that it is HTML specific. Other rendering formats might not need to "clear floats."

A better solution would be to have an added attribute for the <section> or <container> elements called "column-count" or something that specifies the number of columns the section of screen contains. The element would accept only <column> sub-elements. The HTML rendering classes would be able to render the multi-column layout properly and insert float clearing elements where necessary. Float clearing is no longer the responsibility of the XML code.

I'm not suggesting that we go overboard and create widgets for every collection of screen elements, but there are some screen element collections that occur frequently enough that a widget for them would reduce XML code and speed up the development process.

What do you think?

-Adrian

Reply via email to