You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Don Brown (JIRA)" <ji...@apache.org> on 2006/06/10 05:17:21 UTC

[jira] Updated: (WW-1197) To have a few lighter weight parent objects for UI Components to inherit from when creating tags

     [ http://issues.apache.org/struts/browse/WW-1197?page=all ]

Don Brown updated WW-1197:
--------------------------

    Fix Version: Future
                     (was: 2.0.0)

> To have a few lighter weight parent objects for UI Components  to inherit from when creating tags
> -------------------------------------------------------------------------------------------------
>
>          Key: WW-1197
>          URL: http://issues.apache.org/struts/browse/WW-1197
>      Project: Struts Action 2
>         Type: Improvement

>     Versions: WW 2.2
>     Reporter: Nathan Sarr
>     Priority: Minor
>      Fix For: Future

>
> This is a copy and paste from the initial post.  See full post at:
> http://forums.opensymphony.com/thread.jspa?threadID=18510&tstart=0
> For example webwork could have a TemplateBeanInterface with an
> interface for the Template* methods
> Then modify the TemplateContext and Template Engine to take a
> TemplateBeanInterface so that a Tag must only have the necessary
> TemplateBeanInterface to be used by the template engine and related
> classes.
> Following that a few other interfaces could be created:
> A BaseUiBeanInterface that has get and set methods for the following:
> class
> id
> style
> title
> see - http://www.w3schools.com/tags/ref_standardattributes.asp
> A FormEventBeanInterface that has get and set for the following:
> onchange,
> onsubmit,
> onreset,
> onselect,
> onblur,
> onfocus
> If we keep following the pattern we would have WindowEventUiBean,
> KeyboardEventUiBean ...
> see - http://www.w3schools.com/tags/ref_eventattributes.asp
> Finally webwork could create a few Base bean implementations like the
> following for tag developers:
> BaseTemplateUiBean implements TemplateBeanInterface{}
> BaseUiBean extends BaseTemplateUiBean implements BaseUiBeanInterface{}
> FormUiBean extends BaseUiBean implements FormEventBeanInterface{}
> That way tag developers can implement the interfaces themselves or grab
> one of the above implemented beans along the hierarchy that best meets
> their needs as well as create their own combinations of inherited
> classes and interfaces.
> *--------------------------------------------------------------------
> (NOTE: there was some concern about the performace of the following method
>   in the post.  Please see post for further details).
> I was also wondering about adding another method to one of the
> Base classes - something like
> public boolean addNonNullValue(String key, String value){
> boolean added = false;
> if( value != null ){
> added = true;
> addParameter(key, findString(value));
> }
> return added;
> }
> I noticed a lot of the following in the Component classes
> if (param != null) {
> addParameter("param", findString(param));
> }
> by adding the new method, I don't have to check for a null
> value every time I can just make the call
> addNonNullValue("param", param);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira