Hi,
Recently I've been trying to come up with a solution for commandLink's
not working with JavaScript. Personally I am of the thought that even if
they don't have JavaScript I should still be able to give the user
something that will function. In the process of looking into this issue
I stumbled across the following settings.
<context-param>
<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
<param-value>false</param-value>
</context-param>
When this is set commandLink seems to then create a fully qualified
link, that would then seem to be able to work with out JavaScript. From
what I've come across this still seems to be kind of an experimental
thing, but when finished would fix my issue. I was wondering if there is
a certain release that this kind of functionality would be in place. I
know the current spec currently says that commandLink can work with
JavaScript, but that just doesn't seem right to me.
In the mean time, I think I might end up using the detect JavaScript
functionality to determine if JavaScript is enabled. With that
determination I plan to use commandLinks when JavaScript is available,
otherwise render a commandButton that will look like a link.
The other issue I have with this is that the myFaces implementation of
commandLink occurs when ALLOW_JAVASCRIPT and DETECT_JAVASCRIPT are both
set to true, the h:commandLink will automatically generate the command
link without JavaScript, even if JavaScript is enabled. Now if I use
the tomahawk commandLink t:commandLink, this is not the case. If
JavaScript is enabled the link displays normally using JavaScript to
submit the wrapping form, and if JavaScript isn't enabled it try's to
provide the fully qualified link. This becomes a real pain as it really
starts to mess with components I would otherwise like to use, even from
the tomahawk library. Such as using <t:dataTable with sortable columns
will use h:commandLink instead of t:commandLink causing even JavaScript
enabled clients to not gain the benefits of having JavaScript.
So all in all, is there a reasonable guess as when commandLink without
JavaScript might be supported? I'd really rather not add a cluster of
switching between commandLink and commandButtons in a custom component
if its going to be fixed in the near future. Or maybe I'm overlooking
something, any other ideas?
By the way, since I forgot to mention it earlier, I am using
myFaces-1.1.4 and tomahawk-1.1.3.
Thanks in advance,
-Josh