[RFC] Form Widget Stylings element || attribute

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

[RFC] Form Widget Stylings element || attribute

cjhowe
For me the one thing that is holding me back the most from using form
widgets more pervasively is that there are 40+ attributes for the form
element.

Request for comment:  

1.  Would the form widget be better off with moving the styling
attributes into a subelement as opposed to being attributes of the
<form> tag ie:

<form>
  <styling/>
  <actions/>
  <field/>
</form>

2.  If 1, then would it make sense to make a subelement to styling to
account for different media (html vs pdf) or has the pdf styling
already been accomplished well?
Reply | Threaded
Open this post in threaded view
|

Re: [RFC] Form Widget Stylings element || attribute

Adrian Crum
Chris,

I just refactored the form widget. Take a look:

https://issues.apache.org/jira/browse/OFBIZ-671

This will eliminate a lot of property assignments.


Chris Howe wrote:

> For me the one thing that is holding me back the most from using form
> widgets more pervasively is that there are 40+ attributes for the form
> element.
>
> Request for comment:  
>
> 1.  Would the form widget be better off with moving the styling
> attributes into a subelement as opposed to being attributes of the
> <form> tag ie:
>
> <form>
>   <styling/>
>   <actions/>
>   <field/>
> </form>
>
> 2.  If 1, then would it make sense to make a subelement to styling to
> account for different media (html vs pdf) or has the pdf styling
> already been accomplished well?
>
Reply | Threaded
Open this post in threaded view
|

Re: [RFC] Form Widget Stylings element || attribute

snowch
In reply to this post by cjhowe
+1

The same can be said for <field> attributes:

<field>
  <data>        - service-name, etc
  <styling>     - title-area-style, etc
  <interaction> - tooltip, header-link, etc
</field>

Although this would clutter the field element.

On Fri, 2007-02-23 at 16:05 -0800, Chris Howe wrote:

> For me the one thing that is holding me back the most from using form
> widgets more pervasively is that there are 40+ attributes for the form
> element.
>
> Request for comment:  
>
> 1.  Would the form widget be better off with moving the styling
> attributes into a subelement as opposed to being attributes of the
> <form> tag ie:
>
> <form>
>   <styling/>
>   <actions/>
>   <field/>
> </form>
>
> 2.  If 1, then would it make sense to make a subelement to styling to
> account for different media (html vs pdf) or has the pdf styling
> already been accomplished well?
>
Reply | Threaded
Open this post in threaded view
|

Re: [RFC] Form Widget Stylings element || attribute

cjhowe
In reply to this post by Adrian Crum
Just to make sure we're on the same page... These are the attributes
that I would like comment on moving into a <styling> element

form-title-area-style
form-widget-area-style
default-title-area-style
default-widget-area-style
default-title-style
default-widget-style
default-tooltip-style
default-required-field-style
odd-row-style
even-row-style
header-row-style
default-table-style

OFBIZ-671 appears to add three more.  

id
style
widget-focus

Which is great.  The cool thing about the form widget is the amount of
specificity and control you can have and more will probably be needed
as people play with the ajax frameworks.

I'm suggesting that we pull those attributes out of the form definition
and put them in a styling element that is a child to the form element.
I'm not suggesting messing with the functionality, just the
organization.

I get lost, especially with IDEs that use code complete, finding the
attribute I need.  

Separating the pagination attributes into a <pagination> child element
may be beneficial as well as there are about 10 of those that would
make a natural grouping.


--- Adrian Crum <[hidden email]> wrote:

> Chris,
>
> I just refactored the form widget. Take a look:
>
> https://issues.apache.org/jira/browse/OFBIZ-671
>
> This will eliminate a lot of property assignments.
>
>
> Chris Howe wrote:
>
> > For me the one thing that is holding me back the most from using
> form
> > widgets more pervasively is that there are 40+ attributes for the
> form
> > element.
> >
> > Request for comment:  
> >
> > 1.  Would the form widget be better off with moving the styling
> > attributes into a subelement as opposed to being attributes of the
> > <form> tag ie:
> >
> > <form>
> >   <styling/>
> >   <actions/>
> >   <field/>
> > </form>
> >
> > 2.  If 1, then would it make sense to make a subelement to styling
> to
> > account for different media (html vs pdf) or has the pdf styling
> > already been accomplished well?
> >
>

Reply | Threaded
Open this post in threaded view
|

Re: [RFC] Form Widget Stylings element || attribute

Adrian Crum
We're on the same page. If you specify a form style element, that style could
style all of the elements contained in the form. Therefore most of those
elements you listed aren't needed.


Chris Howe wrote:

> Just to make sure we're on the same page... These are the attributes
> that I would like comment on moving into a <styling> element
>
> form-title-area-style
> form-widget-area-style
> default-title-area-style
> default-widget-area-style
> default-title-style
> default-widget-style
> default-tooltip-style
> default-required-field-style
> odd-row-style
> even-row-style
> header-row-style
> default-table-style
>
> OFBIZ-671 appears to add three more.  
>
> id
> style
> widget-focus
>
> Which is great.  The cool thing about the form widget is the amount of
> specificity and control you can have and more will probably be needed
> as people play with the ajax frameworks.
>
> I'm suggesting that we pull those attributes out of the form definition
> and put them in a styling element that is a child to the form element.
> I'm not suggesting messing with the functionality, just the
> organization.
>
> I get lost, especially with IDEs that use code complete, finding the
> attribute I need.  
>
> Separating the pagination attributes into a <pagination> child element
> may be beneficial as well as there are about 10 of those that would
> make a natural grouping.
>
>
> --- Adrian Crum <[hidden email]> wrote:
>
>
>>Chris,
>>
>>I just refactored the form widget. Take a look:
>>
>>https://issues.apache.org/jira/browse/OFBIZ-671
>>
>>This will eliminate a lot of property assignments.
>>
>>
>>Chris Howe wrote:
>>
>>
>>>For me the one thing that is holding me back the most from using
>>
>>form
>>
>>>widgets more pervasively is that there are 40+ attributes for the
>>
>>form
>>
>>>element.
>>>
>>>Request for comment:  
>>>
>>>1.  Would the form widget be better off with moving the styling
>>>attributes into a subelement as opposed to being attributes of the
>>><form> tag ie:
>>>
>>><form>
>>>  <styling/>
>>>  <actions/>
>>>  <field/>
>>></form>
>>>
>>>2.  If 1, then would it make sense to make a subelement to styling
>>
>>to
>>
>>>account for different media (html vs pdf) or has the pdf styling
>>>already been accomplished well?
>>>
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [RFC] Form Widget Stylings element || attribute

cjhowe
Would OFBIZ-671 eventually deprecate many of the attributes or simply
make for an additional option when defining the form definition?

I can certainly see OFBIZ-671 being a "best practice" of sorts, but the
current attributes would likely still be supported and the need for
organization would still be there.  

Would perhaps the following be beneficial

<form>
 <styling>
  <currentHtmlTechnique/>
  <bestPracticeHtmlTechnique/>
  <pdf/>
 </styling>
</form>

but with better element names?


--- Adrian Crum <[hidden email]> wrote:

> We're on the same page. If you specify a form style element, that
> style could
> style all of the elements contained in the form. Therefore most of
> those
> elements you listed aren't needed.
>
>
> Chris Howe wrote:
>
> > Just to make sure we're on the same page... These are the
> attributes
> > that I would like comment on moving into a <styling> element
> >
> > form-title-area-style
> > form-widget-area-style
> > default-title-area-style
> > default-widget-area-style
> > default-title-style
> > default-widget-style
> > default-tooltip-style
> > default-required-field-style
> > odd-row-style
> > even-row-style
> > header-row-style
> > default-table-style
> >
> > OFBIZ-671 appears to add three more.  
> >
> > id
> > style
> > widget-focus
> >
> > Which is great.  The cool thing about the form widget is the amount
> of
> > specificity and control you can have and more will probably be
> needed
> > as people play with the ajax frameworks.
> >
> > I'm suggesting that we pull those attributes out of the form
> definition
> > and put them in a styling element that is a child to the form
> element.
> > I'm not suggesting messing with the functionality, just the
> > organization.
> >
> > I get lost, especially with IDEs that use code complete, finding
> the
> > attribute I need.  
> >
> > Separating the pagination attributes into a <pagination> child
> element
> > may be beneficial as well as there are about 10 of those that would
> > make a natural grouping.
> >
> >
> > --- Adrian Crum <[hidden email]> wrote:
> >
> >
> >>Chris,
> >>
> >>I just refactored the form widget. Take a look:
> >>
> >>https://issues.apache.org/jira/browse/OFBIZ-671
> >>
> >>This will eliminate a lot of property assignments.
> >>
> >>
> >>Chris Howe wrote:
> >>
> >>
> >>>For me the one thing that is holding me back the most from using
> >>
> >>form
> >>
> >>>widgets more pervasively is that there are 40+ attributes for the
> >>
> >>form
> >>
> >>>element.
> >>>
> >>>Request for comment:  
> >>>
> >>>1.  Would the form widget be better off with moving the styling
> >>>attributes into a subelement as opposed to being attributes of the
> >>><form> tag ie:
> >>>
> >>><form>
> >>>  <styling/>
> >>>  <actions/>
> >>>  <field/>
> >>></form>
> >>>
> >>>2.  If 1, then would it make sense to make a subelement to styling
> >>
> >>to
> >>
> >>>account for different media (html vs pdf) or has the pdf styling
> >>>already been accomplished well?
> >>>
> >>
> >
> >
>

Reply | Threaded
Open this post in threaded view
|

Re: [RFC] Form Widget Stylings element || attribute

Adrian Crum
I don't know the answer to that. I'm not arguing against your idea. On the
contrary, I think it's a great idea. Here's my vote:

+1

I guess I was just saying in the short term (after the patch is committed) you
won't have to specify as many things as before.


Chris Howe wrote:

> Would OFBIZ-671 eventually deprecate many of the attributes or simply
> make for an additional option when defining the form definition?
>
> I can certainly see OFBIZ-671 being a "best practice" of sorts, but the
> current attributes would likely still be supported and the need for
> organization would still be there.  
>
> Would perhaps the following be beneficial
>
> <form>
>  <styling>
>   <currentHtmlTechnique/>
>   <bestPracticeHtmlTechnique/>
>   <pdf/>
>  </styling>
> </form>
>
> but with better element names?
>
>
> --- Adrian Crum <[hidden email]> wrote:
>
>
>>We're on the same page. If you specify a form style element, that
>>style could
>>style all of the elements contained in the form. Therefore most of
>>those
>>elements you listed aren't needed.
>>
>>
>>Chris Howe wrote:
>>
>>
>>>Just to make sure we're on the same page... These are the
>>
>>attributes
>>
>>>that I would like comment on moving into a <styling> element
>>>
>>>form-title-area-style
>>>form-widget-area-style
>>>default-title-area-style
>>>default-widget-area-style
>>>default-title-style
>>>default-widget-style
>>>default-tooltip-style
>>>default-required-field-style
>>>odd-row-style
>>>even-row-style
>>>header-row-style
>>>default-table-style
>>>
>>>OFBIZ-671 appears to add three more.  
>>>
>>>id
>>>style
>>>widget-focus
>>>
>>>Which is great.  The cool thing about the form widget is the amount
>>
>>of
>>
>>>specificity and control you can have and more will probably be
>>
>>needed
>>
>>>as people play with the ajax frameworks.
>>>
>>>I'm suggesting that we pull those attributes out of the form
>>
>>definition
>>
>>>and put them in a styling element that is a child to the form
>>
>>element.
>>
>>>I'm not suggesting messing with the functionality, just the
>>>organization.
>>>
>>>I get lost, especially with IDEs that use code complete, finding
>>
>>the
>>
>>>attribute I need.  
>>>
>>>Separating the pagination attributes into a <pagination> child
>>
>>element
>>
>>>may be beneficial as well as there are about 10 of those that would
>>>make a natural grouping.
>>>
>>>
>>>--- Adrian Crum <[hidden email]> wrote:
>>>
>>>
>>>
>>>>Chris,
>>>>
>>>>I just refactored the form widget. Take a look:
>>>>
>>>>https://issues.apache.org/jira/browse/OFBIZ-671
>>>>
>>>>This will eliminate a lot of property assignments.
>>>>
>>>>
>>>>Chris Howe wrote:
>>>>
>>>>
>>>>
>>>>>For me the one thing that is holding me back the most from using
>>>>
>>>>form
>>>>
>>>>
>>>>>widgets more pervasively is that there are 40+ attributes for the
>>>>
>>>>form
>>>>
>>>>
>>>>>element.
>>>>>
>>>>>Request for comment:  
>>>>>
>>>>>1.  Would the form widget be better off with moving the styling
>>>>>attributes into a subelement as opposed to being attributes of the
>>>>><form> tag ie:
>>>>>
>>>>><form>
>>>>> <styling/>
>>>>> <actions/>
>>>>> <field/>
>>>>></form>
>>>>>
>>>>>2.  If 1, then would it make sense to make a subelement to styling
>>>>
>>>>to
>>>>
>>>>
>>>>>account for different media (html vs pdf) or has the pdf styling
>>>>>already been accomplished well?
>>>>>
>>>>
>>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [RFC] Form Widget Stylings element || attribute

Jacopo Cappellato
In reply to this post by cjhowe
Chris,

Chris Howe wrote:

> For me the one thing that is holding me back the most from using form
> widgets more pervasively is that there are 40+ attributes for the form
> element.
>
> Request for comment:  
>
> 1.  Would the form widget be better off with moving the styling
> attributes into a subelement as opposed to being attributes of the
> <form> tag ie:
>
> <form>
>   <styling/>
>   <actions/>
>   <field/>
> </form>
>

This idea is a probably interesting one, but I'd suggest to delay any
decision/discussion on this after the refactoring/consolidation (see
also Adrian's comments) effort is done.
I'm saying this because I think that, after this work is done, the
default styles used by the widgets will be in css and there will be no
need to specify the styles in each form definition (unless you need a
non specific style for the single form).
After this is done, the next (big) step will be that of removing the
default (unnecessary) styles from all the form definitions in the system.
For example, a form like this one:

<form name="ListExamples"
   type="list" list-name="examples"
   paginate-target="FindExample"
   default-title-style="tableheadtext"
   default-widget-style="tabletext"
   default-tooltip-style="tabletext">

   <field name="exampleId"
     title="${uiLabelMap.ExampleExampleId}"
     widget-style="buttontext">
     <hyperlink also-hidden="false"
       description="${exampleId}"
       target="EditExample?exampleId=${exampleId}"/>
   </field>
</form>


Will could be simplified in the following way:

<form name="ListExamples"
   type="list" list-name="examples"
   paginate-target="FindExample">

   <field name="exampleId"
     title="${uiLabelMap.ExampleExampleId}">
     <hyperlink also-hidden="false"
       description="${exampleId}"
       target="EditExample?exampleId=${exampleId}"/>
   </field>
</form>

After these tasks are completed, we can return on this subject and
discuss what you are proposing.

> 2.  If 1, then would it make sense to make a subelement to styling to
> account for different media (html vs pdf) or has the pdf styling
> already been accomplished well?

In theory, form definitions should be abstracted from the media type: I
know that many of them contain html specific code (or at least
conventions, such as the url definition above)... but this should be the
direction, so I would prefer to avoid this if possible.
About the styles for pdf output from widgets: right now they are very
simply defined in a properties file but the key in the file are based on
the same css classes of html output.
So ideally the css style should have a semantic meaning, that is
rendered with different attributes for different media types, but the
form definition should be the same.

Jacopo

Reply | Threaded
Open this post in threaded view
|

Re: [RFC] Form Widget Stylings element || attribute

cjhowe
Jacopo,

I completely agree with the direction or the refactoring and have no
doubt that the definitions in the project will benefit from leveraging
the technique that refactoring would support.  But, when all the dust
settles on that refactoring, is it the goal to deprecate those 12
attributes from the form element or to support both?  

My view, if it's to deprecate, great, table this discussion as they'll
be out of the xsd soon enough and changing the reader and xsd would
likely be a wasted effort.  But if it's to support both (and th
reorganization in this RFC is supported), why not go ahead and move
those attributes to a child element.

It's a relatively simple change in the reader, and a simple migration
in the form definitions, that when done, will even make testing
Adrian's refactoring easier as you can simply comment out the entire
<styling> element to see the difference with the form controlled
styling and the screen controlled styling.

In either case, it still leaves the suggestion of migrating out the
pagination attributes into a child element as well. When you have these
large natural groupings, I think it makes sense to move them to child
elements as keeping them in the <form> element makes it unproductive
to search through a list of 35-45 attributes to find the one you're
interested in.

It also makes it daunting and difficult to learn for newbies and they
end up writing their forms in less maintainable, less reusable
freemarker.


--- Jacopo Cappellato <[hidden email]> wrote:

> Chris,
>
> Chris Howe wrote:
> > For me the one thing that is holding me back the most from using
> form
> > widgets more pervasively is that there are 40+ attributes for the
> form
> > element.
> >
> > Request for comment:  
> >
> > 1.  Would the form widget be better off with moving the styling
> > attributes into a subelement as opposed to being attributes of the
> > <form> tag ie:
> >
> > <form>
> >   <styling/>
> >   <actions/>
> >   <field/>
> > </form>
> >
>
> This idea is a probably interesting one, but I'd suggest to delay any
>
> decision/discussion on this after the refactoring/consolidation (see
> also Adrian's comments) effort is done.
> I'm saying this because I think that, after this work is done, the
> default styles used by the widgets will be in css and there will be
> no
> need to specify the styles in each form definition (unless you need a
>
> non specific style for the single form).
> After this is done, the next (big) step will be that of removing the
> default (unnecessary) styles from all the form definitions in the
> system.
> For example, a form like this one:
>
> <form name="ListExamples"
>    type="list" list-name="examples"
>    paginate-target="FindExample"
>    default-title-style="tableheadtext"
>    default-widget-style="tabletext"
>    default-tooltip-style="tabletext">
>
>    <field name="exampleId"
>      title="${uiLabelMap.ExampleExampleId}"
>      widget-style="buttontext">
>      <hyperlink also-hidden="false"
>        description="${exampleId}"
>        target="EditExample?exampleId=${exampleId}"/>
>    </field>
> </form>
>
>
> Will could be simplified in the following way:
>
> <form name="ListExamples"
>    type="list" list-name="examples"
>    paginate-target="FindExample">
>
>    <field name="exampleId"
>      title="${uiLabelMap.ExampleExampleId}">
>      <hyperlink also-hidden="false"
>        description="${exampleId}"
>        target="EditExample?exampleId=${exampleId}"/>
>    </field>
> </form>
>
> After these tasks are completed, we can return on this subject and
> discuss what you are proposing.
>
> > 2.  If 1, then would it make sense to make a subelement to styling
> to
> > account for different media (html vs pdf) or has the pdf styling
> > already been accomplished well?
>
> In theory, form definitions should be abstracted from the media type:
> I
> know that many of them contain html specific code (or at least
> conventions, such as the url definition above)... but this should be
> the
> direction, so I would prefer to avoid this if possible.
> About the styles for pdf output from widgets: right now they are very
>
> simply defined in a properties file but the key in the file are based
> on
> the same css classes of html output.
> So ideally the css style should have a semantic meaning, that is
> rendered with different attributes for different media types, but the
>
> form definition should be the same.
>
> Jacopo
>
>

Reply | Threaded
Open this post in threaded view
|

Re: [RFC] Form Widget Stylings element || attribute

Jacopo Cappellato
Chris,

I understand what you mean, but I don't know, I don't really have a
strong opinion on this so I'd like to get also feedback from others.

Jacopo

Chris Howe wrote:

> Jacopo,
>
> I completely agree with the direction or the refactoring and have no
> doubt that the definitions in the project will benefit from leveraging
> the technique that refactoring would support.  But, when all the dust
> settles on that refactoring, is it the goal to deprecate those 12
> attributes from the form element or to support both?  
>
> My view, if it's to deprecate, great, table this discussion as they'll
> be out of the xsd soon enough and changing the reader and xsd would
> likely be a wasted effort.  But if it's to support both (and th
> reorganization in this RFC is supported), why not go ahead and move
> those attributes to a child element.
>
> It's a relatively simple change in the reader, and a simple migration
> in the form definitions, that when done, will even make testing
> Adrian's refactoring easier as you can simply comment out the entire
> <styling> element to see the difference with the form controlled
> styling and the screen controlled styling.
>
> In either case, it still leaves the suggestion of migrating out the
> pagination attributes into a child element as well. When you have these
> large natural groupings, I think it makes sense to move them to child
> elements as keeping them in the <form> element makes it unproductive
> to search through a list of 35-45 attributes to find the one you're
> interested in.
>
> It also makes it daunting and difficult to learn for newbies and they
> end up writing their forms in less maintainable, less reusable
> freemarker.
>
>
> --- Jacopo Cappellato <[hidden email]> wrote:
>
>> Chris,
>>
>> Chris Howe wrote:
>>> For me the one thing that is holding me back the most from using
>> form
>>> widgets more pervasively is that there are 40+ attributes for the
>> form
>>> element.
>>>
>>> Request for comment:  
>>>
>>> 1.  Would the form widget be better off with moving the styling
>>> attributes into a subelement as opposed to being attributes of the
>>> <form> tag ie:
>>>
>>> <form>
>>>   <styling/>
>>>   <actions/>
>>>   <field/>
>>> </form>
>>>
>> This idea is a probably interesting one, but I'd suggest to delay any
>>
>> decision/discussion on this after the refactoring/consolidation (see
>> also Adrian's comments) effort is done.
>> I'm saying this because I think that, after this work is done, the
>> default styles used by the widgets will be in css and there will be
>> no
>> need to specify the styles in each form definition (unless you need a
>>
>> non specific style for the single form).
>> After this is done, the next (big) step will be that of removing the
>> default (unnecessary) styles from all the form definitions in the
>> system.
>> For example, a form like this one:
>>
>> <form name="ListExamples"
>>    type="list" list-name="examples"
>>    paginate-target="FindExample"
>>    default-title-style="tableheadtext"
>>    default-widget-style="tabletext"
>>    default-tooltip-style="tabletext">
>>
>>    <field name="exampleId"
>>      title="${uiLabelMap.ExampleExampleId}"
>>      widget-style="buttontext">
>>      <hyperlink also-hidden="false"
>>        description="${exampleId}"
>>        target="EditExample?exampleId=${exampleId}"/>
>>    </field>
>> </form>
>>
>>
>> Will could be simplified in the following way:
>>
>> <form name="ListExamples"
>>    type="list" list-name="examples"
>>    paginate-target="FindExample">
>>
>>    <field name="exampleId"
>>      title="${uiLabelMap.ExampleExampleId}">
>>      <hyperlink also-hidden="false"
>>        description="${exampleId}"
>>        target="EditExample?exampleId=${exampleId}"/>
>>    </field>
>> </form>
>>
>> After these tasks are completed, we can return on this subject and
>> discuss what you are proposing.
>>
>>> 2.  If 1, then would it make sense to make a subelement to styling
>> to
>>> account for different media (html vs pdf) or has the pdf styling
>>> already been accomplished well?
>> In theory, form definitions should be abstracted from the media type:
>> I
>> know that many of them contain html specific code (or at least
>> conventions, such as the url definition above)... but this should be
>> the
>> direction, so I would prefer to avoid this if possible.
>> About the styles for pdf output from widgets: right now they are very
>>
>> simply defined in a properties file but the key in the file are based
>> on
>> the same css classes of html output.
>> So ideally the css style should have a semantic meaning, that is
>> rendered with different attributes for different media types, but the
>>
>> form definition should be the same.
>>
>> Jacopo
>>
>>


Reply | Threaded
Open this post in threaded view
|

Re: [RFC] Form Widget Stylings element || attribute

Jacques Le Roux
Administrator
Chris, Jacopo,

At first sight I agree with Chris. In a general way a too high number of attributes is uneasy to deal with when using code complete
tools. If I understand ritght, even after the refactoring/consolidation these elements will stay as form attributes (because of
Jacopo's sentence "unless you need a non specific style for the single form"). So why not tackle this right now and create forms
sub-elements as Chris proposed ? For the moment, this is more a question than a vote for... though a little inclination for...

Jacques


----- Original Message -----
From: "Jacopo Cappellato" <[hidden email]>
To: <[hidden email]>
Sent: Saturday, February 24, 2007 6:23 PM
Subject: Re: [RFC] Form Widget Stylings element || attribute


> Chris,
>
> I understand what you mean, but I don't know, I don't really have a
> strong opinion on this so I'd like to get also feedback from others.
>
> Jacopo
>
> Chris Howe wrote:
> > Jacopo,
> >
> > I completely agree with the direction or the refactoring and have no
> > doubt that the definitions in the project will benefit from leveraging
> > the technique that refactoring would support.  But, when all the dust
> > settles on that refactoring, is it the goal to deprecate those 12
> > attributes from the form element or to support both?
> >
> > My view, if it's to deprecate, great, table this discussion as they'll
> > be out of the xsd soon enough and changing the reader and xsd would
> > likely be a wasted effort.  But if it's to support both (and th
> > reorganization in this RFC is supported), why not go ahead and move
> > those attributes to a child element.
> >
> > It's a relatively simple change in the reader, and a simple migration
> > in the form definitions, that when done, will even make testing
> > Adrian's refactoring easier as you can simply comment out the entire
> > <styling> element to see the difference with the form controlled
> > styling and the screen controlled styling.
> >
> > In either case, it still leaves the suggestion of migrating out the
> > pagination attributes into a child element as well. When you have these
> > large natural groupings, I think it makes sense to move them to child
> > elements as keeping them in the <form> element makes it unproductive
> > to search through a list of 35-45 attributes to find the one you're
> > interested in.
> >
> > It also makes it daunting and difficult to learn for newbies and they
> > end up writing their forms in less maintainable, less reusable
> > freemarker.
> >
> >
> > --- Jacopo Cappellato <[hidden email]> wrote:
> >
> >> Chris,
> >>
> >> Chris Howe wrote:
> >>> For me the one thing that is holding me back the most from using
> >> form
> >>> widgets more pervasively is that there are 40+ attributes for the
> >> form
> >>> element.
> >>>
> >>> Request for comment:
> >>>
> >>> 1.  Would the form widget be better off with moving the styling
> >>> attributes into a subelement as opposed to being attributes of the
> >>> <form> tag ie:
> >>>
> >>> <form>
> >>>   <styling/>
> >>>   <actions/>
> >>>   <field/>
> >>> </form>
> >>>
> >> This idea is a probably interesting one, but I'd suggest to delay any
> >>
> >> decision/discussion on this after the refactoring/consolidation (see
> >> also Adrian's comments) effort is done.
> >> I'm saying this because I think that, after this work is done, the
> >> default styles used by the widgets will be in css and there will be
> >> no
> >> need to specify the styles in each form definition (unless you need a
> >>
> >> non specific style for the single form).
> >> After this is done, the next (big) step will be that of removing the
> >> default (unnecessary) styles from all the form definitions in the
> >> system.
> >> For example, a form like this one:
> >>
> >> <form name="ListExamples"
> >>    type="list" list-name="examples"
> >>    paginate-target="FindExample"
> >>    default-title-style="tableheadtext"
> >>    default-widget-style="tabletext"
> >>    default-tooltip-style="tabletext">
> >>
> >>    <field name="exampleId"
> >>      title="${uiLabelMap.ExampleExampleId}"
> >>      widget-style="buttontext">
> >>      <hyperlink also-hidden="false"
> >>        description="${exampleId}"
> >>        target="EditExample?exampleId=${exampleId}"/>
> >>    </field>
> >> </form>
> >>
> >>
> >> Will could be simplified in the following way:
> >>
> >> <form name="ListExamples"
> >>    type="list" list-name="examples"
> >>    paginate-target="FindExample">
> >>
> >>    <field name="exampleId"
> >>      title="${uiLabelMap.ExampleExampleId}">
> >>      <hyperlink also-hidden="false"
> >>        description="${exampleId}"
> >>        target="EditExample?exampleId=${exampleId}"/>
> >>    </field>
> >> </form>
> >>
> >> After these tasks are completed, we can return on this subject and
> >> discuss what you are proposing.
> >>
> >>> 2.  If 1, then would it make sense to make a subelement to styling
> >> to
> >>> account for different media (html vs pdf) or has the pdf styling
> >>> already been accomplished well?
> >> In theory, form definitions should be abstracted from the media type:
> >> I
> >> know that many of them contain html specific code (or at least
> >> conventions, such as the url definition above)... but this should be
> >> the
> >> direction, so I would prefer to avoid this if possible.
> >> About the styles for pdf output from widgets: right now they are very
> >>
> >> simply defined in a properties file but the key in the file are based
> >> on
> >> the same css classes of html output.
> >> So ideally the css style should have a semantic meaning, that is
> >> rendered with different attributes for different media types, but the
> >>
> >> form definition should be the same.
> >>
> >> Jacopo
> >>
> >>
>

Reply | Threaded
Open this post in threaded view
|

Re: [RFC] Form Widget Stylings element || attribute

Jacques Le Roux
Administrator
In reply to this post by Jacopo Cappellato
Chris, Jacopo,

At first sight I agree with Chris. In a general way a too high number of attributes is uneasy to deal with when using code complete
tools. If I understand ritght, even after the refactoring/consolidation these elements will stay as form attributes (because of
Jacopo's sentence "unless you need a non specific style for the single form"). So why not tackle this right now and create forms
sub-elements as Chris proposed ? For the moment, this is more a question than a vote for... though a little inclination for...

Jacques


----- Original Message -----
From: "Jacopo Cappellato" <[hidden email]>
To: <[hidden email]>
Sent: Saturday, February 24, 2007 6:23 PM
Subject: Re: [RFC] Form Widget Stylings element || attribute


> Chris,
>
> I understand what you mean, but I don't know, I don't really have a
> strong opinion on this so I'd like to get also feedback from others.
>
> Jacopo
>
> Chris Howe wrote:
> > Jacopo,
> >
> > I completely agree with the direction or the refactoring and have no
> > doubt that the definitions in the project will benefit from leveraging
> > the technique that refactoring would support.  But, when all the dust
> > settles on that refactoring, is it the goal to deprecate those 12
> > attributes from the form element or to support both?
> >
> > My view, if it's to deprecate, great, table this discussion as they'll
> > be out of the xsd soon enough and changing the reader and xsd would
> > likely be a wasted effort.  But if it's to support both (and th
> > reorganization in this RFC is supported), why not go ahead and move
> > those attributes to a child element.
> >
> > It's a relatively simple change in the reader, and a simple migration
> > in the form definitions, that when done, will even make testing
> > Adrian's refactoring easier as you can simply comment out the entire
> > <styling> element to see the difference with the form controlled
> > styling and the screen controlled styling.
> >
> > In either case, it still leaves the suggestion of migrating out the
> > pagination attributes into a child element as well. When you have these
> > large natural groupings, I think it makes sense to move them to child
> > elements as keeping them in the <form> element makes it unproductive
> > to search through a list of 35-45 attributes to find the one you're
> > interested in.
> >
> > It also makes it daunting and difficult to learn for newbies and they
> > end up writing their forms in less maintainable, less reusable
> > freemarker.
> >
> >
> > --- Jacopo Cappellato <[hidden email]> wrote:
> >
> >> Chris,
> >>
> >> Chris Howe wrote:
> >>> For me the one thing that is holding me back the most from using
> >> form
> >>> widgets more pervasively is that there are 40+ attributes for the
> >> form
> >>> element.
> >>>
> >>> Request for comment:
> >>>
> >>> 1.  Would the form widget be better off with moving the styling
> >>> attributes into a subelement as opposed to being attributes of the
> >>> <form> tag ie:
> >>>
> >>> <form>
> >>>   <styling/>
> >>>   <actions/>
> >>>   <field/>
> >>> </form>
> >>>
> >> This idea is a probably interesting one, but I'd suggest to delay any
> >>
> >> decision/discussion on this after the refactoring/consolidation (see
> >> also Adrian's comments) effort is done.
> >> I'm saying this because I think that, after this work is done, the
> >> default styles used by the widgets will be in css and there will be
> >> no
> >> need to specify the styles in each form definition (unless you need a
> >>
> >> non specific style for the single form).
> >> After this is done, the next (big) step will be that of removing the
> >> default (unnecessary) styles from all the form definitions in the
> >> system.
> >> For example, a form like this one:
> >>
> >> <form name="ListExamples"
> >>    type="list" list-name="examples"
> >>    paginate-target="FindExample"
> >>    default-title-style="tableheadtext"
> >>    default-widget-style="tabletext"
> >>    default-tooltip-style="tabletext">
> >>
> >>    <field name="exampleId"
> >>      title="${uiLabelMap.ExampleExampleId}"
> >>      widget-style="buttontext">
> >>      <hyperlink also-hidden="false"
> >>        description="${exampleId}"
> >>        target="EditExample?exampleId=${exampleId}"/>
> >>    </field>
> >> </form>
> >>
> >>
> >> Will could be simplified in the following way:
> >>
> >> <form name="ListExamples"
> >>    type="list" list-name="examples"
> >>    paginate-target="FindExample">
> >>
> >>    <field name="exampleId"
> >>      title="${uiLabelMap.ExampleExampleId}">
> >>      <hyperlink also-hidden="false"
> >>        description="${exampleId}"
> >>        target="EditExample?exampleId=${exampleId}"/>
> >>    </field>
> >> </form>
> >>
> >> After these tasks are completed, we can return on this subject and
> >> discuss what you are proposing.
> >>
> >>> 2.  If 1, then would it make sense to make a subelement to styling
> >> to
> >>> account for different media (html vs pdf) or has the pdf styling
> >>> already been accomplished well?
> >> In theory, form definitions should be abstracted from the media type:
> >> I
> >> know that many of them contain html specific code (or at least
> >> conventions, such as the url definition above)... but this should be
> >> the
> >> direction, so I would prefer to avoid this if possible.
> >> About the styles for pdf output from widgets: right now they are very
> >>
> >> simply defined in a properties file but the key in the file are based
> >> on
> >> the same css classes of html output.
> >> So ideally the css style should have a semantic meaning, that is
> >> rendered with different attributes for different media types, but the
> >>
> >> form definition should be the same.
> >>
> >> Jacopo
> >>
> >>
>

Reply | Threaded
Open this post in threaded view
|

Re: [RFC] Form Widget Stylings element || attribute

David E Jones
In reply to this post by Jacques Le Roux

There are other things to consider with this, like backwards  
compatibility. What seems like an improvement to one may be a pain  
for another. More applicable to this situation, what might seem like  
a convenience for one person may be an inconvenience for another.

I guess the main thing is that I agree there will be a small  
improvement in productivity if these are better organized, and the  
coding effort isn't too big, but the refactoring of current artifacts  
would be a bit of work, and it would also cause problems for any  
external code bases that use these.

On the issue of eventually removing these... even if we come up with  
a good way of creating defaults in CSS (which I'm sure will work out  
fine) I don't think we'll want to remove these. Cases may, or are  
likely to, arise where these will be of value.

-David


On Feb 24, 2007, at 3:38 PM, Jacques Le Roux wrote:

> Chris, Jacopo,
>
> At first sight I agree with Chris. In a general way a too high  
> number of attributes is uneasy to deal with when using code complete
> tools. If I understand ritght, even after the refactoring/
> consolidation these elements will stay as form attributes (because of
> Jacopo's sentence "unless you need a non specific style for the  
> single form"). So why not tackle this right now and create forms
> sub-elements as Chris proposed ? For the moment, this is more a  
> question than a vote for... though a little inclination for...
>
> Jacques
>
>
> ----- Original Message -----
> From: "Jacopo Cappellato" <[hidden email]>
> To: <[hidden email]>
> Sent: Saturday, February 24, 2007 6:23 PM
> Subject: Re: [RFC] Form Widget Stylings element || attribute
>
>
>> Chris,
>>
>> I understand what you mean, but I don't know, I don't really have a
>> strong opinion on this so I'd like to get also feedback from others.
>>
>> Jacopo
>>
>> Chris Howe wrote:
>>> Jacopo,
>>>
>>> I completely agree with the direction or the refactoring and have no
>>> doubt that the definitions in the project will benefit from  
>>> leveraging
>>> the technique that refactoring would support.  But, when all the  
>>> dust
>>> settles on that refactoring, is it the goal to deprecate those 12
>>> attributes from the form element or to support both?
>>>
>>> My view, if it's to deprecate, great, table this discussion as  
>>> they'll
>>> be out of the xsd soon enough and changing the reader and xsd would
>>> likely be a wasted effort.  But if it's to support both (and th
>>> reorganization in this RFC is supported), why not go ahead and move
>>> those attributes to a child element.
>>>
>>> It's a relatively simple change in the reader, and a simple  
>>> migration
>>> in the form definitions, that when done, will even make testing
>>> Adrian's refactoring easier as you can simply comment out the entire
>>> <styling> element to see the difference with the form controlled
>>> styling and the screen controlled styling.
>>>
>>> In either case, it still leaves the suggestion of migrating out the
>>> pagination attributes into a child element as well. When you have  
>>> these
>>> large natural groupings, I think it makes sense to move them to  
>>> child
>>> elements as keeping them in the <form> element makes it unproductive
>>> to search through a list of 35-45 attributes to find the one you're
>>> interested in.
>>>
>>> It also makes it daunting and difficult to learn for newbies and  
>>> they
>>> end up writing their forms in less maintainable, less reusable
>>> freemarker.
>>>
>>>
>>> --- Jacopo Cappellato <[hidden email]> wrote:
>>>
>>>> Chris,
>>>>
>>>> Chris Howe wrote:
>>>>> For me the one thing that is holding me back the most from using
>>>> form
>>>>> widgets more pervasively is that there are 40+ attributes for the
>>>> form
>>>>> element.
>>>>>
>>>>> Request for comment:
>>>>>
>>>>> 1.  Would the form widget be better off with moving the styling
>>>>> attributes into a subelement as opposed to being attributes of the
>>>>> <form> tag ie:
>>>>>
>>>>> <form>
>>>>>   <styling/>
>>>>>   <actions/>
>>>>>   <field/>
>>>>> </form>
>>>>>
>>>> This idea is a probably interesting one, but I'd suggest to  
>>>> delay any
>>>>
>>>> decision/discussion on this after the refactoring/consolidation  
>>>> (see
>>>> also Adrian's comments) effort is done.
>>>> I'm saying this because I think that, after this work is done, the
>>>> default styles used by the widgets will be in css and there will be
>>>> no
>>>> need to specify the styles in each form definition (unless you  
>>>> need a
>>>>
>>>> non specific style for the single form).
>>>> After this is done, the next (big) step will be that of removing  
>>>> the
>>>> default (unnecessary) styles from all the form definitions in the
>>>> system.
>>>> For example, a form like this one:
>>>>
>>>> <form name="ListExamples"
>>>>    type="list" list-name="examples"
>>>>    paginate-target="FindExample"
>>>>    default-title-style="tableheadtext"
>>>>    default-widget-style="tabletext"
>>>>    default-tooltip-style="tabletext">
>>>>
>>>>    <field name="exampleId"
>>>>      title="${uiLabelMap.ExampleExampleId}"
>>>>      widget-style="buttontext">
>>>>      <hyperlink also-hidden="false"
>>>>        description="${exampleId}"
>>>>        target="EditExample?exampleId=${exampleId}"/>
>>>>    </field>
>>>> </form>
>>>>
>>>>
>>>> Will could be simplified in the following way:
>>>>
>>>> <form name="ListExamples"
>>>>    type="list" list-name="examples"
>>>>    paginate-target="FindExample">
>>>>
>>>>    <field name="exampleId"
>>>>      title="${uiLabelMap.ExampleExampleId}">
>>>>      <hyperlink also-hidden="false"
>>>>        description="${exampleId}"
>>>>        target="EditExample?exampleId=${exampleId}"/>
>>>>    </field>
>>>> </form>
>>>>
>>>> After these tasks are completed, we can return on this subject and
>>>> discuss what you are proposing.
>>>>
>>>>> 2.  If 1, then would it make sense to make a subelement to styling
>>>> to
>>>>> account for different media (html vs pdf) or has the pdf styling
>>>>> already been accomplished well?
>>>> In theory, form definitions should be abstracted from the media  
>>>> type:
>>>> I
>>>> know that many of them contain html specific code (or at least
>>>> conventions, such as the url definition above)... but this  
>>>> should be
>>>> the
>>>> direction, so I would prefer to avoid this if possible.
>>>> About the styles for pdf output from widgets: right now they are  
>>>> very
>>>>
>>>> simply defined in a properties file but the key in the file are  
>>>> based
>>>> on
>>>> the same css classes of html output.
>>>> So ideally the css style should have a semantic meaning, that is
>>>> rendered with different attributes for different media types,  
>>>> but the
>>>>
>>>> form definition should be the same.
>>>>
>>>> Jacopo
>>>>
>>>>
>>
>


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [RFC] Form Widget Stylings element || attribute

cjhowe
I believe I've taken care of both of your concerns.

bit of work:
FormArrangement.patch in OFBIZ-760 takes care of about 90% of the
coding effort necessary in all OFBiz forms by moving the styling
attributes to their own line in each form definition and then the
pagination attributes to a line below that so that they can readily be
separated into their own element groupings.

backwards compatibility:
FormWidget.patch in OFBIZ-762 removes the pagination and styling
attributes from the widget-form.xsd and moves them to a child element
(<styling> and <paginate>) and will thusly throw errors if those
attributes continue to exist in the <form> element in the definition.
However, the ModelForm.java changes will allow either to exist and
should still render the form as currently defined in svn.

All that is needed to complete this is
1. a consensus (vote?) that this is a good change
2. adding the appropriate tag at the beginning of the separated lines.
(relatively quick work because they all styling lines begin with
"        default-title-style=" and pagination lines begin with
"        paginate" )
3. adding a log message to ModelForm.java when one of those attributes
is used in the <form> element

--- "David E. Jones" <[hidden email]> wrote:

>
> There are other things to consider with this, like backwards  
> compatibility. What seems like an improvement to one may be a pain  
> for another. More applicable to this situation, what might seem like
>
> a convenience for one person may be an inconvenience for another.
>
> I guess the main thing is that I agree there will be a small  
> improvement in productivity if these are better organized, and the  
> coding effort isn't too big, but the refactoring of current artifacts
>  
> would be a bit of work, and it would also cause problems for any  
> external code bases that use these.
>
> On the issue of eventually removing these... even if we come up with
>
> a good way of creating defaults in CSS (which I'm sure will work out
>
> fine) I don't think we'll want to remove these. Cases may, or are  
> likely to, arise where these will be of value.
>
> -David
>
>
> On Feb 24, 2007, at 3:38 PM, Jacques Le Roux wrote:
>
> > Chris, Jacopo,
> >
> > At first sight I agree with Chris. In a general way a too high  
> > number of attributes is uneasy to deal with when using code
> complete
> > tools. If I understand ritght, even after the refactoring/
> > consolidation these elements will stay as form attributes (because
> of
> > Jacopo's sentence "unless you need a non specific style for the  
> > single form"). So why not tackle this right now and create forms
> > sub-elements as Chris proposed ? For the moment, this is more a  
> > question than a vote for... though a little inclination for...
> >
> > Jacques
> >
> >
> > ----- Original Message -----
> > From: "Jacopo Cappellato" <[hidden email]>
> > To: <[hidden email]>
> > Sent: Saturday, February 24, 2007 6:23 PM
> > Subject: Re: [RFC] Form Widget Stylings element || attribute
> >
> >
> >> Chris,
> >>
> >> I understand what you mean, but I don't know, I don't really have
> a
> >> strong opinion on this so I'd like to get also feedback from
> others.
> >>
> >> Jacopo
> >>
> >> Chris Howe wrote:
> >>> Jacopo,
> >>>
> >>> I completely agree with the direction or the refactoring and have
> no
> >>> doubt that the definitions in the project will benefit from  
> >>> leveraging
> >>> the technique that refactoring would support.  But, when all the
>
> >>> dust
> >>> settles on that refactoring, is it the goal to deprecate those 12
> >>> attributes from the form element or to support both?
> >>>
> >>> My view, if it's to deprecate, great, table this discussion as  
> >>> they'll
> >>> be out of the xsd soon enough and changing the reader and xsd
> would
> >>> likely be a wasted effort.  But if it's to support both (and th
> >>> reorganization in this RFC is supported), why not go ahead and
> move
> >>> those attributes to a child element.
> >>>
> >>> It's a relatively simple change in the reader, and a simple  
> >>> migration
> >>> in the form definitions, that when done, will even make testing
> >>> Adrian's refactoring easier as you can simply comment out the
> entire
> >>> <styling> element to see the difference with the form controlled
> >>> styling and the screen controlled styling.
> >>>
> >>> In either case, it still leaves the suggestion of migrating out
> the
> >>> pagination attributes into a child element as well. When you have
>  
> >>> these
> >>> large natural groupings, I think it makes sense to move them to  
> >>> child
> >>> elements as keeping them in the <form> element makes it
> unproductive
> >>> to search through a list of 35-45 attributes to find the one
> you're
> >>> interested in.
> >>>
> >>> It also makes it daunting and difficult to learn for newbies and
>
> >>> they
> >>> end up writing their forms in less maintainable, less reusable
> >>> freemarker.
> >>>
> >>>
> >>> --- Jacopo Cappellato <[hidden email]> wrote:
> >>>
> >>>> Chris,
> >>>>
> >>>> Chris Howe wrote:
> >>>>> For me the one thing that is holding me back the most from
> using
> >>>> form
> >>>>> widgets more pervasively is that there are 40+ attributes for
> the
> >>>> form
> >>>>> element.
> >>>>>
> >>>>> Request for comment:
> >>>>>
> >>>>> 1.  Would the form widget be better off with moving the styling
> >>>>> attributes into a subelement as opposed to being attributes of
> the
> >>>>> <form> tag ie:
> >>>>>
> >>>>> <form>
> >>>>>   <styling/>
> >>>>>   <actions/>
> >>>>>   <field/>
> >>>>> </form>
> >>>>>
> >>>> This idea is a probably interesting one, but I'd suggest to  
> >>>> delay any
> >>>>
> >>>> decision/discussion on this after the refactoring/consolidation
>
> >>>> (see
> >>>> also Adrian's comments) effort is done.
> >>>> I'm saying this because I think that, after this work is done,
> the
> >>>> default styles used by the widgets will be in css and there will
> be
> >>>> no
> >>>> need to specify the styles in each form definition (unless you  
> >>>> need a
> >>>>
> >>>> non specific style for the single form).
> >>>> After this is done, the next (big) step will be that of removing
>  
> >>>> the
> >>>> default (unnecessary) styles from all the form definitions in
> the
> >>>> system.
> >>>> For example, a form like this one:
> >>>>
> >>>> <form name="ListExamples"
> >>>>    type="list" list-name="examples"
> >>>>    paginate-target="FindExample"
> >>>>    default-title-style="tableheadtext"
> >>>>    default-widget-style="tabletext"
> >>>>    default-tooltip-style="tabletext">
> >>>>
> >>>>    <field name="exampleId"
> >>>>      title="${uiLabelMap.ExampleExampleId}"
> >>>>      widget-style="buttontext">
> >>>>      <hyperlink also-hidden="false"
> >>>>        description="${exampleId}"
> >>>>        target="EditExample?exampleId=${exampleId}"/>
> >>>>    </field>
> >>>> </form>
> >>>>
> >>>>
> >>>> Will could be simplified in the following way:
> >>>>
> >>>> <form name="ListExamples"
> >>>>    type="list" list-name="examples"
> >>>>    paginate-target="FindExample">
> >>>>
> >>>>    <field name="exampleId"
> >>>>      title="${uiLabelMap.ExampleExampleId}">
> >>>>      <hyperlink also-hidden="false"
> >>>>        description="${exampleId}"
> >>>>        target="EditExample?exampleId=${exampleId}"/>
> >>>>    </field>
> >>>> </form>
> >>>>
> >>>> After these tasks are completed, we can return on this subject
> and
> >>>> discuss what you are proposing.
> >>>>
> >>>>> 2.  If 1, then would it make sense to make a subelement to
> styling
> >>>> to
> >>>>> account for different media (html vs pdf) or has the pdf
> styling
> >>>>> already been accomplished well?
> >>>> In theory, form definitions should be abstracted from the media
>
>
=== message truncated ===

Reply | Threaded
Open this post in threaded view
|

Re: [RFC] Form Widget Stylings element || attribute

Jacopo Cappellato
In reply to this post by David E Jones
David,

David E. Jones wrote:
>
> ...
> On the issue of eventually removing these... even if we come up with a
> good way of creating defaults in CSS (which I'm sure will work out fine)
> I don't think we'll want to remove these. Cases may, or are likely to,
> arise where these will be of value.
>
> -David
>

just to clarify this point: I was not suggesting to remove (or
deprecate) the style attributes from the xsd grammar; what I meant was
that, as soon as the form widgets element will be decorated with default
styles in css, we should remove the default style attribute from the
existing form definitions and just leave the ones for non standard
styles. Is this a good plan in your opinion?

Jacopo

Reply | Threaded
Open this post in threaded view
|

Re: [RFC] Form Widget Stylings element || attribute

Jacopo Cappellato
In reply to this post by cjhowe
Chris,

before we go too far with the implementation effort I think that we
should refine the
But again, I don't see this as a major improvement because:

1) it is a bit subjective to say if it easier for users to have many
attributes in the form element or less attributes in a more complex
structure
2) the <styling/> tag will just wrap all the form 'header' styles, while
all the field level ones will continue to be scattered around at the
field level
3) as soon as all the default styles will be removed from form
definitions (after the widget/css refactoring process is complete),
using these attribute will be pretty rare

Again, I still don't have a strong opinion on this (there are pros and
cons, and by the way, the structure you have proposed could be improved)
but maybe discussing all these now is a bit premature and it is not
worth of the effort.

Jacopo

Chris Howe wrote:

> I believe I've taken care of both of your concerns.
>
> bit of work:
> FormArrangement.patch in OFBIZ-760 takes care of about 90% of the
> coding effort necessary in all OFBiz forms by moving the styling
> attributes to their own line in each form definition and then the
> pagination attributes to a line below that so that they can readily be
> separated into their own element groupings.
>
> backwards compatibility:
> FormWidget.patch in OFBIZ-762 removes the pagination and styling
> attributes from the widget-form.xsd and moves them to a child element
> (<styling> and <paginate>) and will thusly throw errors if those
> attributes continue to exist in the <form> element in the definition.
> However, the ModelForm.java changes will allow either to exist and
> should still render the form as currently defined in svn.
>
> All that is needed to complete this is
> 1. a consensus (vote?) that this is a good change
> 2. adding the appropriate tag at the beginning of the separated lines.
> (relatively quick work because they all styling lines begin with
> "        default-title-style=" and pagination lines begin with
> "        paginate" )
> 3. adding a log message to ModelForm.java when one of those attributes
> is used in the <form> element
>


Reply | Threaded
Open this post in threaded view
|

Re: [RFC] Form Widget Stylings element || attribute

cjhowe
Comments inline...
--- Jacopo Cappellato <[hidden email]> wrote:

> Chris,
>
> before we go too far with the implementation effort I think that we
> should refine the
> But again, I don't see this as a major improvement because:
>
> 1) it is a bit subjective to say if it easier for users to have many
> attributes in the form element or less attributes in a more complex
> structure

I certainly agree on it being subjective.  This goes back to my first
post on this topic of why I shy away from using form widget. There are
45 attributes and fully half of them have a powerful, but minor impact
on the use and reuse of the form.  If it were possible to order the
presentation of attributes, that would normally be sufficient.
However,  XML mandates that attributes are not ordered. So, other means
are necessary to reduce the importance of these attributes to the
developer, especially new developers.

> 2) the <styling/> tag will just wrap all the form 'header' styles,
> while
> all the field level ones will continue to be scattered around at the
> field level

For consistency, adding it to the fields is certainly a possible
improvement, but we need to make a decision on the form element before
contemplating it on the field element.

> 3) as soon as all the default styles will be removed from form
> definitions (after the widget/css refactoring process is complete),
> using these attribute will be pretty rare

That's terrific, rev 511769 should at the very least make it simple
work to remove them from the definition. Even after they're removed
they'll still show up in the code complete as options and confuse a new
user even more since there will possibly not be an example of their
usage in the active portion of the project.  
>

In addition to the clutter of the attributes that exists today, with
greater use of ajax in ofbiz, it's only a matter of time before
additional attributes will be needed to allow form widgets to utilize
them.  Adding them to the form element will just compound the code
complete problem.  With a <styling> element, there's a natural home for
these improvements.
Reply | Threaded
Open this post in threaded view
|

Re: [RFC] Form Widget Stylings element || attribute

David E Jones
In reply to this post by Jacopo Cappellato

On Feb 26, 2007, at 1:05 AM, Jacopo Cappellato wrote:

> David,
>
> David E. Jones wrote:
>> ...
>> On the issue of eventually removing these... even if we come up  
>> with a good way of creating defaults in CSS (which I'm sure will  
>> work out fine) I don't think we'll want to remove these. Cases  
>> may, or are likely to, arise where these will be of value.
>> -David
>
> just to clarify this point: I was not suggesting to remove (or  
> deprecate) the style attributes from the xsd grammar; what I meant  
> was that, as soon as the form widgets element will be decorated  
> with default styles in css, we should remove the default style  
> attribute from the existing form definitions and just leave the  
> ones for non standard styles. Is this a good plan in your opinion?
Yes, I think that is just fine and would be a great improvement. I  
mentioned this because it sounded like others were misunderstanding  
what you proposed.

-David


smime.p7s (3K) Download Attachment