RE: Fwd: RE: another release?
"Christian Cryder" <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
> Hmm... I was hoping for at least one comment on this (Christian?).
Thanks for the reminder Jake...I got distracted by work and forgot to
respond ;-) Ok, so I've updated from cvs and I'm taking a look at the
HTMLActionRenderer code you mentioned in your original question...
> Do you have an opinion, though, on whether we should throw an
> exception at all? ... For instance, for the HTMLInputElement,
> we do this...
>
> if (!"submit".equalsIgnoreCase(el.getType())) {
> if ("button".equalsIgnoreCase(el.getType())) {
> //modify the <input> type to make this form submitable in
> //a non-javascript environment.
> el.setAttribute("type", "submit");
> } else {
> //whoops, it's an <input> element of neither type "submit",
> //nor type "button". Probably overstepping bounds in
> //modifying the type attribute here, so throw exception
> //instead.
> String errmsg = "Cannot render Input action listener;
> input type is not 'submit': "+el;
> logger.warn(errmsg);
> throw new NoSuitableRendererException(errmsg);
> }
> }
>
> Modifying the button type from "button" to "submit" is unlikely to
> affect someone's custom javascript code (although depending on how
> they coded things, it still could be a problem but, again, unlikely)
> but when we find it isn't a button, I'm not sure we should then go
> ahead and throw an exception. Note that with the modifying of the
> "button" to "submit", we are actually avoiding an exception that
> would have happened before I modified the code. So, we are still
> better off than before, but I wonder if we should throw an exception
> at all? Maybe just log the warning and let the developer worry about
> how the user is going to be able to submit the form. Their custom
> script might just do the job, but we are interfering by blowing up
> their application before their script has a chance to do its work.
Ok, here's my response to this...I don't have a really strong opinion here,
but I'm inclined to say that we ought to leave it the way it is until
someone explicitly runs into this issue and requests we address it. In other
words, I'm reluctant to change it to fix a hypothetical situation with
something that _doesn't_ error (and then trust that the developer is going
to notice the problem...if someone binds a BAction component to something we
don't know how to render, I think we ought to throw the exception like we
have been doing.
That said, if someone has a specific case where they want to be doing this,
then I'm totally open to hearing about it (and changing the renderers to
support it).
That's my particular take on it...your thoughts?
Again, sorry to take so long in responding. Anyone else want to chime in?
Christian
----------------------------------------------
Christian Cryder
Internet Architect, ATMReports.com
Project Chair, BarracudaMVC - http://barracudamvc.org
----------------------------------------------
"Coffee? I could quit anytime, just not today"