You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Baker,Jonathan" <Ba...@oclc.org> on 2006/06/27 17:28:39 UTC

_link_hidden_

I believe that form_name:_link_hidden is the JSF mechanism for storing
component state on the client side, but I am curious as to why, if you
have your web.xml setting to say store state on the server, that that
element and some javascript methods to set that element are being
generated in my commandLink component html.

For example (see below in red)

<form id="navbar" 
           name="navbar" 
           method="post" 
           action="/slx/myList.faces" 
           enctype="application/x-www-form-urlencoded" 
           style="display:inline;">

  <a href="#"
     onclick="clear_navbar();
 
document.forms['navbar'].elements['navbar:_link_hidden_'].value=

 
'navbar:navbar:id28:navbar_inbox';
 
document.forms['navbar'].elements['selectedFolder'].value='NEW';
              if(document.forms['navbar'].onsubmit)
              {
                  var result=document.forms['navbar'].onsubmit();  
                  if ((typeof result == 'undefined') || result) 
                  {
                      document.forms['navbar'].submit();
                  }
              }
              else
              {
                  document.forms['navbar'].submit();
              }
	      return false;"
    id="navbar:navbar:_id28:navbar_inbox"
     class="subtabSelect">
     Inbox(25)
  </a>


<input type="hidden" name="navbar_SUBMIT" value="1" />
<input type="hidden" name="jsf_sequence" value="4" />
<input type="hidden" name="selectedFolder" />
<input type="hidden" name="navbar:_link_hidden_" />
</form>

JB


Re: _link_hidden_

Posted by Cosma Colanicchia <co...@gmail.com>.
Hi,

the _link_hidden AFAIK isn't intended for client-state saving, that
kind of stuff get renderered in another hidden field in a serialized
form, if enabled, and without any js code.

The hidden field you're talking about should tell JSF, on the
server-side, which component has triggered the submit. It is needed
because JSF forms always do "postbacks" (they submit to the same url
of the current view), so the form action attribute cannot be used.

Cosma


2006/6/27, Baker,Jonathan <Ba...@oclc.org>:
>
>
>
> I believe that form_name:_link_hidden is the JSF mechanism for storing
> component state on the client side, but I am curious as to why, if you have
> your web.xml setting to say store state on the server, that that element and
> some javascript methods to set that element are being generated in my
> commandLink component html.
>
> For example (see below in red)
>
> <form id="navbar"
>            name="navbar"
>            method="post"
>            action="/slx/myList.faces"
>            enctype="application/x-www-form-urlencoded"
>            style="display:inline;">
>
>   <a href="#"
>      onclick="clear_navbar();
>
> document.forms['navbar'].elements['navbar:_link_hidden_'].value=
>
>
>
>
> 'navbar:navbar:id28:navbar_inbox';
>
> document.forms['navbar'].elements['selectedFolder'].value='NEW';
>               if(document.forms['navbar'].onsubmit)
>               {
>                   var result=document.forms['navbar'].onsubmit();
>                   if ((typeof result == 'undefined') || result)
>                   {
>                       document.forms['navbar'].submit();
>                   }
>               }
>               else
>               {
>                   document.forms['navbar'].submit();
>               }
>               return false;"
>     id="navbar:navbar:_id28:navbar_inbox"
>      class="subtabSelect">
>      Inbox(25)
>   </a>
>
>
> <input type="hidden" name="navbar_SUBMIT" value="1" />
> <input type="hidden" name="jsf_sequence" value="4" />
> <input type="hidden" name="selectedFolder" />
> <input type="hidden" name="navbar:_link_hidden_" />
> </form>
>
> JB