SelectMany Shuttle javascripted links not properly rendered if url parameter is 
set
-----------------------------------------------------------------------------------

                 Key: TRINIDAD-1051
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1051
             Project: MyFaces Trinidad
          Issue Type: Bug
    Affects Versions:  1.0.8-core
         Environment: All environments
            Reporter: Werner Punz
            Assignee: Werner Punz


The problem is that the selectmany shuttle component renders its links via href 
and javascript and then refers to  
org.apache.myfaces.trinidad.render.CoreRenderer.renderEncodedActionURI
   value = context.getExternalContext().encodeActionURL(value.toString());
While this is a proper way to handle an incoming url in this case it is not 
because
if you pass down javascripts and put them into this method incoming url 
parameters will be attached

ie
javascript:TrXXX.doMyAction();?myparam=1

This exactly happens in the shuttle component in such a case and renders the 
javascript links invalid.

Now:
The solution would be to change the code
 in the selectManyShuttleRenderer responsible for rendering the link from

  if(href != null) {
                renderEncodedActionURI(context, "href", href);
  }

to

  if(href != null && href.startsWith("javascript:")) {
                rw.writeAttribute("href", href, null);
   } else {
                renderEncodedActionURI(context, "href", href);
   }

Problem is the writeAttribute probably also belongs to a base class
any comments by the trinidad core committers on this (Matze?)?
I need feedback before fixing this in the trunk!



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to