FAQ
Because of a company-rule which does not allow Javascript in
web-applications, the Javascript-toggle is one of the most
important assets of MyFaces for us.

But the HtmlCommandLink component does not work when it is
set to false. I tested that under 1.0.8 and 1.0.9. It seems
that the UiForm does not call the command-links decode method.
I will try to debug that a bit more in depth and I have a small
webapp which I will stremaline a bit more if a testcase is needed.

regards
Alexander

Search Discussions

  • Werner Punz at Jun 2, 2005 at 7:18 am

    Jesse Alexander (KBSA 21) wrote:
    Because of a company-rule which does not allow Javascript in
    web-applications, the Javascript-toggle is one of the most
    important assets of MyFaces for us.

    But the HtmlCommandLink component does not work when it is
    set to false. I tested that under 1.0.8 and 1.0.9. It seems
    that the UiForm does not call the command-links decode method.
    I will try to debug that a bit more in depth and I have a small
    webapp which I will stremaline a bit more if a testcase is needed.
    Cannot work, to my knowledge Sun specified that h:commandLink needs
    javascript in the HTML incarnation to work. This is less a matter of
    implementation and more a matter of specification.
    I dont know if that issue will be resolved by the 1.2 specs.
    I maybe wrong, though, but I dont think so.
  • Martin Marinschek at Jun 2, 2005 at 8:35 am
    What you can try to do is style the commandButtons as Links - I don't
    know if it is completely possible though?

    regards,

    Martin
    On 6/2/05, Werner Punz wrote:
    Jesse Alexander (KBSA 21) wrote:
    Because of a company-rule which does not allow Javascript in
    web-applications, the Javascript-toggle is one of the most
    important assets of MyFaces for us.

    But the HtmlCommandLink component does not work when it is
    set to false. I tested that under 1.0.8 and 1.0.9. It seems
    that the UiForm does not call the command-links decode method.
    I will try to debug that a bit more in depth and I have a small
    webapp which I will stremaline a bit more if a testcase is needed.
    Cannot work, to my knowledge Sun specified that h:commandLink needs
    javascript in the HTML incarnation to work. This is less a matter of
    implementation and more a matter of specification.
    I dont know if that issue will be resolved by the 1.2 specs.
    I maybe wrong, though, but I dont think so.
  • Werner Punz at Jun 2, 2005 at 1:08 pm
    A bypass definitely would be to use direct html
    via <input type ...> to pass down the form parameters.
    The decision of sun, to use javascript for the commandLink
    is perfectly understandable in the light, that it causes
    less problems than targetting plain html for form submits and combined
    form submits (which are often needed for more complex controls)

    In the end I would recommend, to think twice about the decision of
    trying to lock out javascript, things are currently heading in a very
    pro javascript way. There currently is a huge buzzword momentum behind
    Ajax (and it probably will stay that way for the forseeable future).

    Javascript is not thad bad, if you have a good set of components
    isolating the platform and browser dependend stuff.
    On JSF level you wont see it in most cases anyway, that stuff should
    be handled by well implemented renderers.

    Werner



    Martin Marinschek wrote:
    What you can try to do is style the commandButtons as Links - I don't
    know if it is completely possible though?

    regards,

    Martin
    On 6/2/05, Werner Punz wrote:

    Jesse Alexander (KBSA 21) wrote:
    Because of a company-rule which does not allow Javascript in
    web-applications, the Javascript-toggle is one of the most
    important assets of MyFaces for us.

    But the HtmlCommandLink component does not work when it is
    set to false. I tested that under 1.0.8 and 1.0.9. It seems
    that the UiForm does not call the command-links decode method.
    I will try to debug that a bit more in depth and I have a small
    webapp which I will stremaline a bit more if a testcase is needed.
    Cannot work, to my knowledge Sun specified that h:commandLink needs
    javascript in the HTML incarnation to work. This is less a matter of
    implementation and more a matter of specification.
    I dont know if that issue will be resolved by the 1.2 specs.
    I maybe wrong, though, but I dont think so.
  • Alessandro Polverini at Jun 13, 2005 at 5:12 pm

    On Thu, 2005-06-02 at 14:04 +0200, Werner Punz wrote:
    A bypass definitely would be to use direct html
    via <input type ...> to pass down the form parameters.
    The decision of sun, to use javascript for the commandLink
    is perfectly understandable in the light, that it causes
    less problems than targetting plain html for form submits and combined
    form submits (which are often needed for more complex controls)
    [...]
    The problem using commandButtons instead of commandLinks is that in the
    former you can't pass parameters nesting f:params.
    At least that what is happening to me.

    I'm uncertain if this a declared thing of the specs or not.
    If yes:
    - why make behave them differently?
    - how pass parameters to actions and actionListeners?

    More detailed infos here:
    http://www.mail-archive.com/users%40myfaces.apache.org/msg04709.html

    Thanks for any enlightment,
    Alex
  • Jesse Alexander (KBSA 21) at Jun 2, 2005 at 12:51 pm
    I did some more tests which lead to this matrix:

    works with JavaScript
    disabled enabled
    a) button/link is embedded in a form
    htmlCommand false true
    htmlButton true true
    b) button/link is NOT embedded in a form
    htmlCommand true true
    htmlButton false false

    neither redirect (in the nav-outcome) nor immediate hava an influence.

    So the only difference is the form in which the commandlink is
    embedded...

    regards
    Alexander

    -----Original Message-----
    From: Martin Marinschek
    Sent: Thursday, June 02, 2005 10:35 AM
    To: MyFaces Discussion; werpu@gmx.at
    Subject: Re: HtmlCommand does not work when ALLOW_JAVASCRIPT=false

    What you can try to do is style the commandButtons as Links - I don't
    know if it is completely possible though?

    regards,

    Martin
    On 6/2/05, Werner Punz wrote:
    Jesse Alexander (KBSA 21) wrote:
    Because of a company-rule which does not allow Javascript in
    web-applications, the Javascript-toggle is one of the most
    important assets of MyFaces for us.

    But the HtmlCommandLink component does not work when it is
    set to false. I tested that under 1.0.8 and 1.0.9. It seems
    that the UiForm does not call the command-links decode method.
    I will try to debug that a bit more in depth and I have a small
    webapp which I will stremaline a bit more if a testcase is needed.
    Cannot work, to my knowledge Sun specified that h:commandLink needs
    javascript in the HTML incarnation to work. This is less a matter of
    implementation and more a matter of specification.
    I dont know if that issue will be resolved by the 1.2 specs.
    I maybe wrong, though, but I dont think so.
  • Werner Punz at Jun 2, 2005 at 6:55 pm
    Let me try to interprete this

    Jesse Alexander (KBSA 21) wrote:
    I did some more tests which lead to this matrix:

    works with JavaScript
    disabled enabled
    a) button/link is embedded in a form
    htmlCommand false true
    html command triggers a javascript if embedded in a form tag
    htmlButton true true
    html button just issues a submit
    b) button/link is NOT embedded in a form
    htmlCommand true true
    here the command is rendered as a link only
    htmlButton false false
    here it is rendered as a button only therefore does nothing
    neither redirect (in the nav-outcome) nor immediate hava an influence.

    So the only difference is the form in which the commandlink is
    embedded...
    Well makes perfect sense in the scope of html.
    Html command renders basically into <a href....
    html command button basically renders into a <input type whatever...
    according to this matrix.

    To my knowledge, correct me if I am wrong, you only can issue a submit
    in a decent manner from a href within a form by triggering a javascript
    event method which does the submit on the form.
    Buttons can issue automatically submits by being the type submit.
    Therefore this behavior looks weird at the first sight, but is totally
    understandable if you go down on html level.
    You might be able to bypass the problem by writing a renderer
    for your command links which render into input type submit, you you
    encounter that you are in a form...
    I hope I am not to wrong in my interpretation of this.


    Werner
  • Jesse Alexander (KBSA 21) at Jun 2, 2005 at 7:55 pm
    I presume a solution will be to render the commandlink as a commandButton
    when it is embedded in a form and JS is disabled...
    Just gotta find a "cool" point in the source to accomplish that...

    Alexander

    -----Original Message-----
    From: news On Behalf Of Werner Punz
    Sent: Thursday, June 02, 2005 8:42 PM
    To: users@myfaces.apache.org
    Subject: Re: HtmlCommand does not work when ALLOW_JAVASCRIPT=false

    Let me try to interprete this

    Jesse Alexander (KBSA 21) wrote:
    I did some more tests which lead to this matrix:

    works with JavaScript
    disabled enabled
    a) button/link is embedded in a form
    htmlCommand false true
    html command triggers a javascript if embedded in a form tag
    htmlButton true true
    html button just issues a submit
    b) button/link is NOT embedded in a form
    htmlCommand true true
    here the command is rendered as a link only
    htmlButton false false
    here it is rendered as a button only therefore does nothing
    neither redirect (in the nav-outcome) nor immediate hava an influence.

    So the only difference is the form in which the commandlink is
    embedded...
    Well makes perfect sense in the scope of html.
    Html command renders basically into <a href....
    html command button basically renders into a <input type whatever...
    according to this matrix.

    To my knowledge, correct me if I am wrong, you only can issue a submit
    in a decent manner from a href within a form by triggering a javascript
    event method which does the submit on the form.
    Buttons can issue automatically submits by being the type submit.
    Therefore this behavior looks weird at the first sight, but is totally
    understandable if you go down on html level.
    You might be able to bypass the problem by writing a renderer
    for your command links which render into input type submit, you you
    encounter that you are in a form...
    I hope I am not to wrong in my interpretation of this.


    Werner
  • Werner Punz at Jun 3, 2005 at 6:11 am

    Jesse Alexander (KBSA 21) wrote:
    I presume a solution will be to render the commandlink as a commandButton
    when it is embedded in a form and JS is disabled...
    Just gotta find a "cool" point in the source to accomplish that...

    Alexander
    You wont have to find the cool point in the source, you just have to
    write your own renderer which plugs into the command link control

    (you can do that by setting a parameter in the faces-config for
    the commmand-link render group/type)

    Check out my controls I uploaded to sourceforge the day before
    yesterday, both of them basically are just new renderers without any
    control code (but their own render group)

    All you have to do, to my knowledge of the framework.
    Write your own renderer which hooks itself into command link,
    tie it to command link and html renderers via the right faces-config
    entry and you are set.

    That is one of the beauties of JSF (although makes things hard to grasp
    in the beginning) that the framework is totally controlled via inversion
    object control, so that you can exchange things easily on the fly left
    and right.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriesmyfaces
postedJun 1, '05 at 11:49p
activeJun 13, '05 at 5:12p
posts9
users4
websitemyfaces.apache.org

People

Translate

site design / logo © 2019 Grokbase