So it sounds like this is a MyFaces Core 1.1 bug, then. For 1.1, we should not be providing a h:commandLink onclick attribute.
I'll open an issue. Thanks! I saw the spec change (tld docs) for JSF 1.2, but I couldn't find a spec issue in javaserverfaces-spec-public, although what ones I did see had your name on them :-) On 11/2/07, Ryan Lubke <[EMAIL PROTECTED]> wrote: > Mike Kienenberger wrote: > > That'd be my suggestion. File it against Tomahawk. I'd think the > > patch would be pretty simple to create, but you're probably in a > > better position to judge that than I am. > > > > I just compared the tlds for MyFaces Core and JSF RI 1.1. > > > > Apparently RI 1.1 doesn't support onclick, but MyFaces does. That > > seems like a bug as well. > > > > http://myfaces.apache.org/impl/tlddoc/h/commandLink.html > > http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/tlddocs/h/tld-summary.html > > http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/api/ > > > > Ryan, > > > > Do you know if this is a MyFaces Core bug, a JSF RI bug, or a JSF 1.1 > > spec issue? > Yeah, it was a conscience decision in 1.1. onclick wasn't exposed > to prevent users from overwriting the generated onclick from the renderer. > > This was resolved in 1.2 by wrapping the user specified content and invoking > both. > > The RI 1.1 tld page seems to indicate that an onclick > > attribute isn't supported (nothing explicitly says it is not, though), > > > It's best to treat the TLD docs the same as signature tests. Exposing > the attribute > when not defined in the TLD docs breaks portability between implementations. > > but the RI 1.1 api docs do contain setOnClick() and getOnClick(), > > which indicates that one could programmically set the values even if > > the tag doesn't provide it! > > > Yep, they do. I'm pretty sure though, the renderer doesn't call call > those methods (at least > in the 1.1 RI). > > > > > > > > > > On 11/2/07, Stewart Cambridge <[EMAIL PROTECTED]> wrote: > > > >> Ok. Should I file a bug report then? > >> > >> On 02/11/2007, Mike Kienenberger <[EMAIL PROTECTED]> wrote: > >> > >>> That seems pretty likely, then. > >>> > >>> The patch would be to change the kind of link created to specifically > >>> be a Tomahawk command link. > >>> > >>> Also, depending on how the onClick value is being set, there may not > >>> be explicit support for it in Sun RI. It may be that dataScroller is > >>> setting it as a generic attribute. > >>> > >>> On 11/2/07, Stewart Cambridge <[EMAIL PROTECTED]> wrote: > >>> > >>>> No, I'm not very sure. However, my reasons for thinking so are: > >>>> (1) The CommandLink is created using: > >>>> HtmlCommandLink link = (HtmlCommandLink) application > >>>> .createComponent(HtmlCommandLink.COMPONENT_TYPE); > >>>> where the application object is a Sun RI object, > >>>> and > >>>> (2) the HTML rendered to the browser looks like a Sun RI rendering and > >>>> looks different from a MyFaces rendering of CommandLink. > >>>> > >>>> In my debugger the class of the link is simply reported as a > >>>> javax.faces.component.html.HtmlCommandLink. > >>>> > >>>> What's interesting is that the Sun RI v1.1 CommandLink component has a > >>>> setOnclick() method, even though the <h:commandLink/> tag does not. > >>>> Otherwise I'm sure it would be throwing some kind of exception... > >>>> > >>>> On 02/11/2007, Mike Kienenberger <[EMAIL PROTECTED]> wrote: > >>>> > >>>>> If t:dataScroller is trying to use a nonstandard attribute with > >>>>> h:commandLink rather than t:commandLink, that would be a bug. > >>>>> > >>>>> Are you sure that it's using the core commandLink component rather > >>>>> than the Tomahawk commandLink component? > >>>>> > >>>>> On 11/2/07, Stewart Cambridge <[EMAIL PROTECTED]> wrote: > >>>>> > >>>>>> tomahawk 1.1.6 > >>>>>> Sun RI 1.1_01 > >>>>>> > >>>>>> I realise that both MyFaces CommandLInk and Sun RI 1.2 CommandLink can > >>>>>> handle the onclick attribute nicely, and I'll be upgrading ASAP, but > >>>>>> meanwhile I need to workaround it. > >>>>>> > >>>>>> What I've done is augmented the Tomahawk DataScroller to pass through > >>>>>> onkeypress and onmousedown and I'm using these attributes instead. > >>>>>> > >>>>>> On 02/11/2007, rlubke <[EMAIL PROTECTED]> wrote: > >>>>>> > >>>>>>> What version of the RI and what version of Tomahawk? > >>>>>>> > >>>>>>> > >>>>>>> Stewart Cambridge wrote: > >>>>>>> > >>>>>>>> Hi Myfaces Users, > >>>>>>>> > >>>>>>>> I'm using a Tomahawk dataScroller component with a Tomahawk > >>>>>>>> dataTable on a > >>>>>>>> page. > >>>>>>>> I have the onclick attribute set on the dataScroller, with the idea > >>>>>>>> that each rendered link for first, last, previous, next, etc would > >>>>>>>> have its onclick attribute set. > >>>>>>>> > >>>>>>>> Unfortunately, the onclick is not being rendered and I wondered if > >>>>>>>> (a) > >>>>>>>> it was because I was using the Sun RI rather than MyFaces, and Sun's > >>>>>>>> CommandLink doesn't support onclick, or if (b) I was just using it > >>>>>>>> incorrectly. Could someone enlighten me please? > >>>>>>>> > >>>>>>>> Tracing through in a debugger seems to show the DataScroller setting > >>>>>>>> onclick on the CommandLink each facet (link.setOnclick()), so I > >>>>>>>> thought that it was using Tomahawk's CommandLink quite happily. But > >>>>>>>> it's rendering as though it were a Sun RI CommandLink. > >>>>>>>> > >>>>>>>> Any advise please? > >>>>>>>> > >>>>>>>> Thanks, > >>>>>>>> > >>>>>>>> Stewart > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>> -- > >>>>>>> View this message in context: > >>>>>>> http://www.nabble.com/dataScroller-onclick-with-Sun-RI-tf4737384.html#a13551129 > >>>>>>> Sent from the MyFaces - Users mailing list archive at Nabble.com. > >>>>>>> > >>>>>>> > >>>>>>> > >

