Hi Oleg,

we want to add automaticallly additional javascript code to all input
fields, links, and (non-submitting) buttons to implement a dirty-check-mechanism.

The original problem is that if some enters lots of data in a form and then
clicks a link then all the the entered form data is lost. Our customer does
not accept this behaviour (because many unskilled people use the application).
Therefore we added onchange-javascript-code to all input fields and
checking-javascript-code to all links and (non-submitting) buttons. Now in case of
dirtyness of a form a dialog pops up saying that the entered data will be lost
and allowing to cancel the request.

We already use the <html:input>-tags in all our JSPs but we don't want to
have the necessary javascript code repeated everywhere (for consistency and
maintainance reasons). Therefore we want the necessary javascript code to be
added automatically.

If you think our solution is general enough then maybe this behaviour could
also be directly incorparted into struts.

Ciao,
--Stefan

> Hello Stefan,
> 
> Wednesday, November 21, 2001, 6:33:38 PM, you wrote:
> 
> SW> our first proposal concerning the extensibility of struts concerns the
> SW> html-taglib. Currently in the org.apache.struts.taglib.BaseHandlerTag
> the
> SW> members
> SW> (onClick, onDblClick, ...) are directly accessed. If the prepare
> methods
> SW> would use getter methods then you could easily extend the tags by
> SW> overloading the
> SW> getter method:
> 
> SW> Current version of BaseHandler has methods like this:
> 
> SW>     private void prepareKeyEvents(StringBuffer handlers) {
> 
> SW>         if (onKeyDown != null) {
> SW>             handlers.append(" onKeyDown=\"");
> SW>             handlers.append(onKeyDown);
> SW>             handlers.append("\"");
> SW>         }
> 
> SW>         if (onKeyUp != null) {
> SW>             handlers.append(" onKeyUp=\"");
> SW>             handlers.append(onKeyUp);
> SW>             handlers.append("\"");
> SW>         }
> 
> SW>         if (onKeyPress != null) {
> SW>             handlers.append(" onKeyPress=\"");
> SW>             handlers.append(onKeyPress);
> SW>             handlers.append("\"");
> SW>         }
> SW>     }
> 
> SW> Our proposed version is:
> 
> SW>     private void prepareKeyEvents(StringBuffer handlers) {
> 
> SW>         if (getOnKeyDown() != null) {
> SW>             handlers.append(" onKeyDown=\"");
> SW>             handlers.append(getOnKeyDown());
> SW>             handlers.append("\"");
> SW>         }
> 
> SW>         if (getOnKeyUp() != null) {
> SW>             handlers.append(" onKeyUp=\"");
> SW>             handlers.append(getOnKeyUp());
> SW>             handlers.append("\"");
> SW>         }
> 
> SW>         if (getOnKeyPress() != null) {
> SW>             handlers.append(" onKeyPress=\"");
> SW>             handlers.append(getOnKeyPress());
> SW>             handlers.append("\"");
> SW>        }
> SW>     }
> 
> SW> Admittedly this is not a great change, but it would help extensibility
> a
> SW> lot. Who decides if this proposal is incorporated into the next
> version?
> 
> SW> I will send you some more proposals soon.
> 
> It is good addition. But what reason to do so? Can you explain any
> situation when such methods can be used?
> 
> -- 
> Best regards,
>  Oleg                            mailto:[EMAIL PROTECTED]
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to