You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Alberto Molpeceres (JIRA)" <de...@myfaces.apache.org> on 2005/11/28 18:44:37 UTC

[jira] Created: (MYFACES-882) CommandLink doesn't work if javascript is disabled

CommandLink doesn't work if javascript is disabled
--------------------------------------------------

         Key: MYFACES-882
         URL: http://issues.apache.org/jira/browse/MYFACES-882
     Project: MyFaces
        Type: Bug
  Components: Implementation  
    Versions: 1.1.1    
 Environment: Mac OS X + Apple's JDK 1.5 + Tomcat 5.5
    Reporter: Alberto Molpeceres


This bug is very similar to: http://issues.apache.org/jira/browse/MYFACES-198, closed due to lack of interest. The solution given in that thread doesn't seem to work.

I'm working with a SVN copy of MyFaces dated on 20-Nov-05.

If I have context parameter org.apache.myfaces.ALLOW_JAVASCRIPT to false, commandLinks seem to be rendered wrong. The following code:

         <h:commandLink id="doit" action="#{bb.doIt}" immediate="true" >
               <h:outputText value="Do it!" />
         </h:commandLink>

becomes something like:

        <a .... href=id="A_VERY_LONG_URL">Do It!</a>

what leads to a "page not found" in the browser.

Setting org.apache.myfaces.ALLOW_JAVASCRIPT to "true" solves this problem, because it creates a working javascript-link, so this isn't a showstopper.  However, I think this tag should work properly without javascript too.

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


Re: [jira] Commented: (MYFACES-882) CommandLink doesn't work if javascript is disabled

Posted by Adam Winer <aw...@gmail.com>.
Sean,

I agree 100% with you - I don't understand the horror of using
Javascript.

One truly horrific development is that in the name of webapp
accessibility (a very good thing), some standards boards
are trying to claim that an app has to function without Javascript
to be accessible, which is utter nonsense.

In regards to the bug here, the JSF 1.2 spec is explicit
that commandLink *can* use Javascript, and other components
(in the standard set, of course) may not.  So this is not a bug.

-- Adam


On 11/29/05, Sean Schofield <se...@gmail.com> wrote:
> Al,
>
> My rant wasn't really directed at you personally.  It's just that I've
> seen this complaint from users over and over on different mailing
> lists and forums.  These users are *intentionally* trying to develop
> complex webapps without javascript.  I just can't understand why
> anybody would bother.  And if you were forced to do this by a client,
> you would be limited in the sophistication that you could achieve so
> why bother with JSF?
>
> sean
>
>
> On 11/29/05, Alberto Molpeceres <al...@gmail.com> wrote:
> > It isn't that I was concerned. It's just that I had disabled it (just
> > testing), and JSF didn't help me to find the error. In fact, often
> > MyFaces (or JSF in general) doesn't help very much to find errors,
> > altough they could be clearly mine like in this case. If you make a
> > mistake I would expect MyFaces to tell me, not just write something
> > that doesn't work.
> >
> > My apologies.
> >
> >     al.
> >
> >
> > On 11/28/05, Sean Schofield <se...@gmail.com> wrote:
> > > I can't understand for the life of me why someone would write a webapp
> > > that was complicated enough to justify JSF and still be concerned
> > > about browsers that don't support javascript.  I'm sure there are some
> > > scenarios out there but if you can't count on javascript being enabled
> > > then IMO, you shouldn't be wasting your time with the overhead and
> > > complexities of JSF.  Just use Struts or something simpler.
> > >
> > > sean
> > >
> > >
> > > On 11/28/05, Mike Kienenberger <mk...@gmail.com> wrote:
> > > > JSF isn't designed to handle GET requests, so just modifying the link
> > > > wouldn't be sufficient.   In any case, the parameters generated would
> > > > be far too large :)   Take a look at a JSF form submit sometime.
> > > >
> > > > The idea of providing an error if you try to use JSF without
> > > > javascript isn't a bad one.
> > > > I'm not sure what to suggest, though.   I don't think rendering a
> > > > message stating that you can't use links without javascript is the
> > > > best solution.   Perhaps the server should simply throw a
> > > > FacesException if someone attempts to render a component that requires
> > > > javascript, and the parameter is set to false.
> > > >
> > > > Maybe some of the other committers can comment on this.
> > > >
> > > > On 11/28/05, Alberto Molpeceres <al...@gmail.com> wrote:
> > > > > On 11/28/05, Mike Kienenberger (JIRA) <de...@myfaces.apache.org> wrote:
> > > > > >     [ http://issues.apache.org/jira/browse/MYFACES-882?page=comments#action_12358688 ]
> > > > > >
> > > > > > Mike Kienenberger commented on MYFACES-882:
> > > > > > -------------------------------------------
> > > > > >
> > > > > > Well, we can discuss it on the mailing lists, but the short answer is that javascript is required to make the link submit the form.   Normal anchor tags can't submit forms, so the anchor tag has to use javascript to click a submit button.
> > > > > >
> > > > >
> > > > >
> > > > > Hi Mike.
> > > > >
> > > > > I was just wondering, why something to "simply" should need
> > > > > javascript. I mean, why not simply add all needed parameters to the
> > > > > link?. Or if really that's not possible, it would be better just write
> > > > > a message like "don't use commandLink with js disabled" instead of
> > > > > just rendering a broken link.
> > > > >
> > > > > Don't get me worng, I know it's my failure if I don't know what the
> > > > > specification says, only I have lost around three hours looking for a
> > > > > solution and am a bit frustrated.
> > > > >
> > > > >     al.
> > > > >
> > > >
> > >
> >
> >
> > --
> > Alberto Molpeceres
> >   alberto.molpeceres @ linkingpaths.com
> >   (+34) 661 304 614
> >
> > Linking Paths
> >   Francisco Maciá 11, 7º  -  48014 Bilbao
> >   (+34) 944 764 328
> >   http://www.linkingpaths.com
> >
>

Re: [jira] Commented: (MYFACES-882) CommandLink doesn't work if javascript is disabled

Posted by Sean Schofield <se...@gmail.com>.
Al,

My rant wasn't really directed at you personally.  It's just that I've
seen this complaint from users over and over on different mailing
lists and forums.  These users are *intentionally* trying to develop
complex webapps without javascript.  I just can't understand why
anybody would bother.  And if you were forced to do this by a client,
you would be limited in the sophistication that you could achieve so
why bother with JSF?

sean


On 11/29/05, Alberto Molpeceres <al...@gmail.com> wrote:
> It isn't that I was concerned. It's just that I had disabled it (just
> testing), and JSF didn't help me to find the error. In fact, often
> MyFaces (or JSF in general) doesn't help very much to find errors,
> altough they could be clearly mine like in this case. If you make a
> mistake I would expect MyFaces to tell me, not just write something
> that doesn't work.
>
> My apologies.
>
>     al.
>
>
> On 11/28/05, Sean Schofield <se...@gmail.com> wrote:
> > I can't understand for the life of me why someone would write a webapp
> > that was complicated enough to justify JSF and still be concerned
> > about browsers that don't support javascript.  I'm sure there are some
> > scenarios out there but if you can't count on javascript being enabled
> > then IMO, you shouldn't be wasting your time with the overhead and
> > complexities of JSF.  Just use Struts or something simpler.
> >
> > sean
> >
> >
> > On 11/28/05, Mike Kienenberger <mk...@gmail.com> wrote:
> > > JSF isn't designed to handle GET requests, so just modifying the link
> > > wouldn't be sufficient.   In any case, the parameters generated would
> > > be far too large :)   Take a look at a JSF form submit sometime.
> > >
> > > The idea of providing an error if you try to use JSF without
> > > javascript isn't a bad one.
> > > I'm not sure what to suggest, though.   I don't think rendering a
> > > message stating that you can't use links without javascript is the
> > > best solution.   Perhaps the server should simply throw a
> > > FacesException if someone attempts to render a component that requires
> > > javascript, and the parameter is set to false.
> > >
> > > Maybe some of the other committers can comment on this.
> > >
> > > On 11/28/05, Alberto Molpeceres <al...@gmail.com> wrote:
> > > > On 11/28/05, Mike Kienenberger (JIRA) <de...@myfaces.apache.org> wrote:
> > > > >     [ http://issues.apache.org/jira/browse/MYFACES-882?page=comments#action_12358688 ]
> > > > >
> > > > > Mike Kienenberger commented on MYFACES-882:
> > > > > -------------------------------------------
> > > > >
> > > > > Well, we can discuss it on the mailing lists, but the short answer is that javascript is required to make the link submit the form.   Normal anchor tags can't submit forms, so the anchor tag has to use javascript to click a submit button.
> > > > >
> > > >
> > > >
> > > > Hi Mike.
> > > >
> > > > I was just wondering, why something to "simply" should need
> > > > javascript. I mean, why not simply add all needed parameters to the
> > > > link?. Or if really that's not possible, it would be better just write
> > > > a message like "don't use commandLink with js disabled" instead of
> > > > just rendering a broken link.
> > > >
> > > > Don't get me worng, I know it's my failure if I don't know what the
> > > > specification says, only I have lost around three hours looking for a
> > > > solution and am a bit frustrated.
> > > >
> > > >     al.
> > > >
> > >
> >
>
>
> --
> Alberto Molpeceres
>   alberto.molpeceres @ linkingpaths.com
>   (+34) 661 304 614
>
> Linking Paths
>   Francisco Maciá 11, 7º  -  48014 Bilbao
>   (+34) 944 764 328
>   http://www.linkingpaths.com
>

Re: [jira] Commented: (MYFACES-882) CommandLink doesn't work if javascript is disabled

Posted by Alberto Molpeceres <al...@gmail.com>.
It isn't that I was concerned. It's just that I had disabled it (just
testing), and JSF didn't help me to find the error. In fact, often
MyFaces (or JSF in general) doesn't help very much to find errors,
altough they could be clearly mine like in this case. If you make a
mistake I would expect MyFaces to tell me, not just write something
that doesn't work.

My apologies.

    al.


On 11/28/05, Sean Schofield <se...@gmail.com> wrote:
> I can't understand for the life of me why someone would write a webapp
> that was complicated enough to justify JSF and still be concerned
> about browsers that don't support javascript.  I'm sure there are some
> scenarios out there but if you can't count on javascript being enabled
> then IMO, you shouldn't be wasting your time with the overhead and
> complexities of JSF.  Just use Struts or something simpler.
>
> sean
>
>
> On 11/28/05, Mike Kienenberger <mk...@gmail.com> wrote:
> > JSF isn't designed to handle GET requests, so just modifying the link
> > wouldn't be sufficient.   In any case, the parameters generated would
> > be far too large :)   Take a look at a JSF form submit sometime.
> >
> > The idea of providing an error if you try to use JSF without
> > javascript isn't a bad one.
> > I'm not sure what to suggest, though.   I don't think rendering a
> > message stating that you can't use links without javascript is the
> > best solution.   Perhaps the server should simply throw a
> > FacesException if someone attempts to render a component that requires
> > javascript, and the parameter is set to false.
> >
> > Maybe some of the other committers can comment on this.
> >
> > On 11/28/05, Alberto Molpeceres <al...@gmail.com> wrote:
> > > On 11/28/05, Mike Kienenberger (JIRA) <de...@myfaces.apache.org> wrote:
> > > >     [ http://issues.apache.org/jira/browse/MYFACES-882?page=comments#action_12358688 ]
> > > >
> > > > Mike Kienenberger commented on MYFACES-882:
> > > > -------------------------------------------
> > > >
> > > > Well, we can discuss it on the mailing lists, but the short answer is that javascript is required to make the link submit the form.   Normal anchor tags can't submit forms, so the anchor tag has to use javascript to click a submit button.
> > > >
> > >
> > >
> > > Hi Mike.
> > >
> > > I was just wondering, why something to "simply" should need
> > > javascript. I mean, why not simply add all needed parameters to the
> > > link?. Or if really that's not possible, it would be better just write
> > > a message like "don't use commandLink with js disabled" instead of
> > > just rendering a broken link.
> > >
> > > Don't get me worng, I know it's my failure if I don't know what the
> > > specification says, only I have lost around three hours looking for a
> > > solution and am a bit frustrated.
> > >
> > >     al.
> > >
> >
>


--
Alberto Molpeceres
  alberto.molpeceres @ linkingpaths.com
  (+34) 661 304 614

Linking Paths
  Francisco Maciá 11, 7º  -  48014 Bilbao
  (+34) 944 764 328
  http://www.linkingpaths.com

Re: [jira] Commented: (MYFACES-882) CommandLink doesn't work if javascript is disabled

Posted by Sean Schofield <se...@gmail.com>.
I can't understand for the life of me why someone would write a webapp
that was complicated enough to justify JSF and still be concerned
about browsers that don't support javascript.  I'm sure there are some
scenarios out there but if you can't count on javascript being enabled
then IMO, you shouldn't be wasting your time with the overhead and
complexities of JSF.  Just use Struts or something simpler.

sean


On 11/28/05, Mike Kienenberger <mk...@gmail.com> wrote:
> JSF isn't designed to handle GET requests, so just modifying the link
> wouldn't be sufficient.   In any case, the parameters generated would
> be far too large :)   Take a look at a JSF form submit sometime.
>
> The idea of providing an error if you try to use JSF without
> javascript isn't a bad one.
> I'm not sure what to suggest, though.   I don't think rendering a
> message stating that you can't use links without javascript is the
> best solution.   Perhaps the server should simply throw a
> FacesException if someone attempts to render a component that requires
> javascript, and the parameter is set to false.
>
> Maybe some of the other committers can comment on this.
>
> On 11/28/05, Alberto Molpeceres <al...@gmail.com> wrote:
> > On 11/28/05, Mike Kienenberger (JIRA) <de...@myfaces.apache.org> wrote:
> > >     [ http://issues.apache.org/jira/browse/MYFACES-882?page=comments#action_12358688 ]
> > >
> > > Mike Kienenberger commented on MYFACES-882:
> > > -------------------------------------------
> > >
> > > Well, we can discuss it on the mailing lists, but the short answer is that javascript is required to make the link submit the form.   Normal anchor tags can't submit forms, so the anchor tag has to use javascript to click a submit button.
> > >
> >
> >
> > Hi Mike.
> >
> > I was just wondering, why something to "simply" should need
> > javascript. I mean, why not simply add all needed parameters to the
> > link?. Or if really that's not possible, it would be better just write
> > a message like "don't use commandLink with js disabled" instead of
> > just rendering a broken link.
> >
> > Don't get me worng, I know it's my failure if I don't know what the
> > specification says, only I have lost around three hours looking for a
> > solution and am a bit frustrated.
> >
> >     al.
> >
>

Re: [jira] Commented: (MYFACES-882) CommandLink doesn't work if javascript is disabled

Posted by Mike Kienenberger <mk...@gmail.com>.
JSF isn't designed to handle GET requests, so just modifying the link
wouldn't be sufficient.   In any case, the parameters generated would
be far too large :)   Take a look at a JSF form submit sometime.

The idea of providing an error if you try to use JSF without
javascript isn't a bad one.
I'm not sure what to suggest, though.   I don't think rendering a
message stating that you can't use links without javascript is the
best solution.   Perhaps the server should simply throw a
FacesException if someone attempts to render a component that requires
javascript, and the parameter is set to false.

Maybe some of the other committers can comment on this.

On 11/28/05, Alberto Molpeceres <al...@gmail.com> wrote:
> On 11/28/05, Mike Kienenberger (JIRA) <de...@myfaces.apache.org> wrote:
> >     [ http://issues.apache.org/jira/browse/MYFACES-882?page=comments#action_12358688 ]
> >
> > Mike Kienenberger commented on MYFACES-882:
> > -------------------------------------------
> >
> > Well, we can discuss it on the mailing lists, but the short answer is that javascript is required to make the link submit the form.   Normal anchor tags can't submit forms, so the anchor tag has to use javascript to click a submit button.
> >
>
>
> Hi Mike.
>
> I was just wondering, why something to "simply" should need
> javascript. I mean, why not simply add all needed parameters to the
> link?. Or if really that's not possible, it would be better just write
> a message like "don't use commandLink with js disabled" instead of
> just rendering a broken link.
>
> Don't get me worng, I know it's my failure if I don't know what the
> specification says, only I have lost around three hours looking for a
> solution and am a bit frustrated.
>
>     al.
>

Re: [jira] Commented: (MYFACES-882) CommandLink doesn't work if javascript is disabled

Posted by Alberto Molpeceres <al...@gmail.com>.
On 11/28/05, Mike Kienenberger (JIRA) <de...@myfaces.apache.org> wrote:
>     [ http://issues.apache.org/jira/browse/MYFACES-882?page=comments#action_12358688 ]
>
> Mike Kienenberger commented on MYFACES-882:
> -------------------------------------------
>
> Well, we can discuss it on the mailing lists, but the short answer is that javascript is required to make the link submit the form.   Normal anchor tags can't submit forms, so the anchor tag has to use javascript to click a submit button.
>


Hi Mike.

I was just wondering, why something to "simply" should need
javascript. I mean, why not simply add all needed parameters to the
link?. Or if really that's not possible, it would be better just write
a message like "don't use commandLink with js disabled" instead of
just rendering a broken link.

Don't get me worng, I know it's my failure if I don't know what the
specification says, only I have lost around three hours looking for a
solution and am a bit frustrated.

    al.

[jira] Closed: (MYFACES-882) CommandLink doesn't work if javascript is disabled

Posted by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-882?page=all ]
     
Mike Kienenberger closed MYFACES-882:
-------------------------------------

    Resolution: Invalid

JSF CommandLink requires javascript.  Javascript must be enabled to use this component.

http://java.sun.com/j2ee/javaserverfaces/1.1/docs/renderkitdocs/HTML_BASIC/javax.faces.Commandjavax.faces.Link.html


> CommandLink doesn't work if javascript is disabled
> --------------------------------------------------
>
>          Key: MYFACES-882
>          URL: http://issues.apache.org/jira/browse/MYFACES-882
>      Project: MyFaces
>         Type: Bug
>   Components: Implementation
>     Versions: 1.1.1
>  Environment: Mac OS X + Apple's JDK 1.5 + Tomcat 5.5
>     Reporter: Alberto Molpeceres

>
> This bug is very similar to: http://issues.apache.org/jira/browse/MYFACES-198, closed due to lack of interest. The solution given in that thread doesn't seem to work.
> I'm working with a SVN copy of MyFaces dated on 20-Nov-05.
> If I have context parameter org.apache.myfaces.ALLOW_JAVASCRIPT to false, commandLinks seem to be rendered wrong. The following code:
>          <h:commandLink id="doit" action="#{bb.doIt}" immediate="true" >
>                <h:outputText value="Do it!" />
>          </h:commandLink>
> becomes something like:
>         <a .... href=id="A_VERY_LONG_URL">Do It!</a>
> what leads to a "page not found" in the browser.
> Setting org.apache.myfaces.ALLOW_JAVASCRIPT to "true" solves this problem, because it creates a working javascript-link, so this isn't a showstopper.  However, I think this tag should work properly without javascript too.

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


[jira] Commented: (MYFACES-882) CommandLink doesn't work if javascript is disabled

Posted by "Alberto Molpeceres (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-882?page=comments#action_12358686 ] 

Alberto Molpeceres commented on MYFACES-882:
--------------------------------------------

Wow. Sorry, I didn't know. 
I can't understand how can someone make javascript mandatory to write a link, but sure it's a reason for it. 

> CommandLink doesn't work if javascript is disabled
> --------------------------------------------------
>
>          Key: MYFACES-882
>          URL: http://issues.apache.org/jira/browse/MYFACES-882
>      Project: MyFaces
>         Type: Bug
>   Components: Implementation
>     Versions: 1.1.1
>  Environment: Mac OS X + Apple's JDK 1.5 + Tomcat 5.5
>     Reporter: Alberto Molpeceres

>
> This bug is very similar to: http://issues.apache.org/jira/browse/MYFACES-198, closed due to lack of interest. The solution given in that thread doesn't seem to work.
> I'm working with a SVN copy of MyFaces dated on 20-Nov-05.
> If I have context parameter org.apache.myfaces.ALLOW_JAVASCRIPT to false, commandLinks seem to be rendered wrong. The following code:
>          <h:commandLink id="doit" action="#{bb.doIt}" immediate="true" >
>                <h:outputText value="Do it!" />
>          </h:commandLink>
> becomes something like:
>         <a .... href=id="A_VERY_LONG_URL">Do It!</a>
> what leads to a "page not found" in the browser.
> Setting org.apache.myfaces.ALLOW_JAVASCRIPT to "true" solves this problem, because it creates a working javascript-link, so this isn't a showstopper.  However, I think this tag should work properly without javascript too.

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


[jira] Commented: (MYFACES-882) CommandLink doesn't work if javascript is disabled

Posted by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-882?page=comments#action_12358688 ] 

Mike Kienenberger commented on MYFACES-882:
-------------------------------------------

Well, we can discuss it on the mailing lists, but the short answer is that javascript is required to make the link submit the form.   Normal anchor tags can't submit forms, so the anchor tag has to use javascript to click a submit button.

> CommandLink doesn't work if javascript is disabled
> --------------------------------------------------
>
>          Key: MYFACES-882
>          URL: http://issues.apache.org/jira/browse/MYFACES-882
>      Project: MyFaces
>         Type: Bug
>   Components: Implementation
>     Versions: 1.1.1
>  Environment: Mac OS X + Apple's JDK 1.5 + Tomcat 5.5
>     Reporter: Alberto Molpeceres

>
> This bug is very similar to: http://issues.apache.org/jira/browse/MYFACES-198, closed due to lack of interest. The solution given in that thread doesn't seem to work.
> I'm working with a SVN copy of MyFaces dated on 20-Nov-05.
> If I have context parameter org.apache.myfaces.ALLOW_JAVASCRIPT to false, commandLinks seem to be rendered wrong. The following code:
>          <h:commandLink id="doit" action="#{bb.doIt}" immediate="true" >
>                <h:outputText value="Do it!" />
>          </h:commandLink>
> becomes something like:
>         <a .... href=id="A_VERY_LONG_URL">Do It!</a>
> what leads to a "page not found" in the browser.
> Setting org.apache.myfaces.ALLOW_JAVASCRIPT to "true" solves this problem, because it creates a working javascript-link, so this isn't a showstopper.  However, I think this tag should work properly without javascript too.

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