You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Michael Heinen <mh...@recommind.com> on 2006/05/11 12:24:05 UTC

Re: linkDummyForm not rendering on every page

Hi,
 
I am facing the same problem with new version 1.1.3. The linkDumyForm is
not rendered on every page as in version 1.1.1.
 
My welcome page index.jsp forwards the request to a faces page:
<jsp:forward page="/faces/launch.jsp"/>
This page contains a commandLink outside a form (!) for a simple logout
action. The link was working well with MyFaces 1.1.1
 
Now the link is only working when I enter the URL /faces/launch.jsp
directly. It is not working when I call my welcome page which forwards
to /faces/launch.jsp.
Is this working correctly? 
Do I have to define a second form around the link now?
 
Michael
 
Joey Geiger wrote:
> I've found it has something to do with the need for an actual page to
be 
> part of the url.
> 
> If the browser is showing www.site.com/ <http://www.site.com/>  or
www.site.com/admin/ <http://www.site.com/admin/>  it fails.
> With www.site.com/page.jsf <http://www.site.com/page.jsf> , the link
dummy form will render and the 
> links on the page
> work fine.
 
 
> Joey Geiger wrote:
> I recently upgraded to a 1.1.2 nightly build, and I've run into an 
> issue where the linkdummyform
> listed below is not being created on every page. This wasn't an issue 
> with the 1.1.1 release.
> I know that I can surround all of my h:commandLink tag sections with 
> forms to make them work,
> but I was wondering specifically what triggers the code below to 
> render. I'd rather not have
> 7-8 different forms on a page just for common links that can be 
> processed by one form.
> 
> Thank you.
> 
> 
> 
> <!-- MYFACES JAVASCRIPT -->
> <form id="linkDummyForm" name="linkDummyForm" style="display:inline" 
> method="post" action="/main/display.jsf">
> <input type="hidden" name="linkDummyForm:_link_hidden_" /><script 
> type="text/javascript"><!--
> function clear_linkDummyForm() {
>  var f = document.forms['linkDummyForm'];
>  f.elements['linkDummyForm:_link_hidden_'].value='';
>  f.target='';
> }
> clear_linkDummyForm();
> //--></script>
> </form>
> 
> 
> 
> 

 


Re: linkDummyForm not rendering on every page

Posted by Jonathan Harley <jo...@parkplatz.net>.
Michael Heinen wrote:
> I am facing the same problem with new version 1.1.3. The linkDumyForm is not rendered on every page as in version 1.1.1.
> 
> My welcome page index.jsp forwards the request to a faces page: <jsp:forward page="/faces/launch.jsp"/>
> 
> This page contains a commandLink outside a form (!) for a simple logout action. The link was working well with MyFaces 1.1.1
> 
> Now the link is only working when I enter the URL /faces/launch.jsp directly. It is not working when I call my welcome page which forwards to /faces/launch.jsp.
> 
> Is this working correctly? 
> 
> Do I have to define a second form around the link now?

I posted about this yesterday under a different topic. As far as I
can see, in 1.1.3 the linkDummyForm javascript is now added by the
Tomahawk ExtensionsFilter for some strange reason.

It sounds as though you're using ExtensionsFilter, but it's not being
applied to your welcome page (is it only mapped to /faces/* ?). You
could either change the filter mapping, or substitute a browser
redirect for your server-side forward, i.e. instead of jsp:forward use

<% response.sendRedirect("/faces/launch.jsp"); %>

This would go back to the browser and tell it to send another request
for your faces JSP page, which would then be processed by the filter.

HTH, Jon

> 
> Michael
> 
> Joey Geiger wrote:
> 
>> I've found it has something to do with the need for an actual page to be 
> 
>> part of the url.
> 
>> 
> 
>> If the browser is showing www.site.com/ <http://www.site.com/> or www.site.com/admin/ <http://www.site.com/admin/> it fails.
> 
>> With www.site.com/page.jsf <http://www.site.com/page.jsf>, the link dummy form will render and the 
> 
>> links on the page
> 
>> work fine.
> 
>  
>> Joey Geiger wrote:
> 
>> I recently upgraded to a 1.1.2 nightly build, and I've run into an 
> 
>> issue where the linkdummyform
> 
>> listed below is not being created on every page. This wasn't an issue 
> 
>> with the 1.1.1 release.
> 
>> I know that I can surround all of my h:commandLink tag sections with 
> 
>> forms to make them work,
> 
>> but I was wondering specifically what triggers the code below to 
> 
>> render. I'd rather not have
> 
>> 7-8 different forms on a page just for common links that can be 
> 
>> processed by one form.
> 
>> 
> 
>> Thank you.

-- 
.....................................................................
           Dr Jonathan Harley   .
                                .   Email: jon@parkplatz.net
            Zac Parkplatz Ltd   .   Office Telephone: 024 7633 1375
            www.parkplatz.net   .   Mobile: 079 4116 0423