You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by De...@ak.blm.gov on 2005/08/01 20:52:18 UTC

forceId for x:inputHidden behavior

I've set x:inputHidden[@id]=foo inside a form.  When the form is 
submitted, the name of the parameter is "myForm:foo" . 

The docs for forceId say "If true, this component will force the use of 
the specified id when rendering." I would expect that after specifying 
forceId="true", the name of the parameter would then be "foo".  I have 
done this, but the original parameter name is still there. 

What does forceId do? 
How do I force the HTTP parameter name to be "foo"?  Are we just supposed 
to sandwich an expression between two verbatim tags?

Dennis Byrne

Re: forceId for x:inputHidden behavior

Posted by De...@ak.blm.gov.
 I am not getting this w/ a build from the other night.  This must have 
been fixed between 1.0.9 and now.   I willl go w/ the following hack for 
hidden input fields until the next release.

<x:inputText style="display: none" ...

Dennis Byrne

Re: forceId for x:inputHidden behavior

Posted by Bruno Aranda <br...@gmail.com>.
I think you are trying to do it with the myfaces last release
(1.0.9m9), because it is the version available in 
http://myfaces.apache.org/binary.cgi and I don't know if that worked
then... can you try using a nightly? (from
http://cvs.apache.org/builds/myfaces/nightly/). Sean and I have
already tested the last examples and everything is working as
expected. If this does not work, please tell me again....

Good luck! :-)

Bruno

2005/8/2, Dennis_Byrne@ak.blm.gov <De...@ak.blm.gov>:
>  
> Bruno, thanks for the reply. I am looking at a file called forceId.jsp under
> myfaces-simple-examples that was unwarred from a file I downloaded at
> http://myfaces.apache.org/binary.cgi .  I grepped the file
> for "hidden" and I didn't get anything - I am nevertheless sure the example
> works.  Can you please review the below?   
>  
> 1.) 
> <f:view> 
>  <h:form> without forceId 
>         <x:inputText   id="a" value="a" /> 
>         <x:inputHidden id="b" value="b" /> 
>   </h:form> 
> </f:view> 
>  
> ... yields the following.  Notice both controls are prefixed with the
> autogenerated form id. 
>  
>  <form id="_id0" name="_id0" method="post"
> action="/arims/test.jsf;jsessionid=988BFED4C137C3EE92284C10160779C4"
> enctype="application/x-www-form-urlencoded"> without
> forceId 
>         <input id="_id0:a" name="_id0:a" type="text" value="a"/> 
>         <input type="hidden" id="_id0:b" name="_id0:b" value="b"/> 
>   <input type="hidden" name="_id0_SUBMIT" value="1"/><input type="hidden"
> name="autoScroll"/></form> 
>  
> 2.) But ... 
>  
> <f:view> 
>  <h:form> 
>         <x:inputText   forceId="true" id="a" value="a" /> 
>         <x:inputHidden forceId="true" id="b" value="b" /> 
>   </h:form> 
> </f:view> 
>  
> ...  yields the following.  Notice that the form id is still prepended for
> inputHidden. 
>  
>  <form id="_id0" name="_id0" method="post"
> action="/arims/test.jsf;jsessionid=1593D31E84224BDBDA41EE6326E8E0AC"
> enctype="application/x-www-form-urlencoded"> with forceId 
>         <input id="a" name="a" type="text" value="a"/> 
>         <input type="hidden" id="_id0:b" name="_id0:b" value="b"/> 
>   <input type="hidden" name="_id0_SUBMIT" value="1"/><input type="hidden"
> name="autoScroll"/></form> 
>  
> The only other code in the JSP are the following three lines.  I get the
> same behavior if the id for the form is specified.  I'm using the 1.0.9
> release.  Thanks again for the reply. 
> <%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> 
> <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%> 
> <%@taglib prefix="x"
> uri="http://myfaces.apache.org/extensions" %> 
>  
> Dennis Byrne
>

Size if x:inputCalendar

Posted by Phan Anh Le <pl...@neuragenix.com>.
Hi all,

Has any one successfully set the size of a :inputCalendar? It is  
included in the API but seems not working in the current build  
(latest nightly build).

Thanks,


Re: forceId for x:inputHidden behavior

Posted by De...@ak.blm.gov.
Bruno, thanks for the reply. I am looking at a file called forceId.jsp 
under myfaces-simple-examples that was unwarred from a file I downloaded 
at http://myfaces.apache.org/binary.cgi .  I grepped the file for "hidden" 
and I didn't get anything - I am nevertheless sure the example works.  Can 
you please review the below? 

1.) 
<f:view>
 <h:form> without forceId
        <x:inputText   id="a" value="a" />
        <x:inputHidden id="b" value="b" />
  </h:form>
</f:view>

... yields the following.  Notice both controls are prefixed with the 
autogenerated form id.

 <form id="_id0" name="_id0" method="post" 
action="/arims/test.jsf;jsessionid=988BFED4C137C3EE92284C10160779C4" 
enctype="application/x-www-form-urlencoded"> without forceId
        <input id="_id0:a" name="_id0:a" type="text" value="a"/>
        <input type="hidden" id="_id0:b" name="_id0:b" value="b"/>
  <input type="hidden" name="_id0_SUBMIT" value="1"/><input type="hidden" 
name="autoScroll"/></form>

2.) But ...

<f:view>
 <h:form>
        <x:inputText   forceId="true" id="a" value="a" />
        <x:inputHidden forceId="true" id="b" value="b" />
  </h:form>
</f:view>

...  yields the following.  Notice that the form id is still prepended for 
inputHidden.

 <form id="_id0" name="_id0" method="post" 
action="/arims/test.jsf;jsessionid=1593D31E84224BDBDA41EE6326E8E0AC" 
enctype="application/x-www-form-urlencoded"> with forceId
        <input id="a" name="a" type="text" value="a"/>
        <input type="hidden" id="_id0:b" name="_id0:b" value="b"/>
  <input type="hidden" name="_id0_SUBMIT" value="1"/><input type="hidden" 
name="autoScroll"/></form>

The only other code in the JSP are the following three lines.  I get the 
same behavior if the id for the form is specified.  I'm using the 1.0.9 
release.  Thanks again for the reply.
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib prefix="x" uri="http://myfaces.apache.org/extensions" %>

Dennis Byrne

Re: forceId for x:inputHidden behavior

Posted by Sean Schofield <se...@gmail.com>.
Never mind.  I just tried the nightly build and it works fine.

sean

On 8/2/05, Sean Schofield <se...@gmail.com> wrote:
> Bruno,
> 
> Does this example work at the moment?  I tried it late yesterday and
> had some exceptions.  I didn't get a chance to look into it yet ...
> 
> sean
> 
> On 8/2/05, Bruno Aranda <br...@gmail.com> wrote:
> > Yes, there is a forceId example for a hidden field in the simple
> > examples (forceId.jsp) and it is working. The inputHidden is in the
> > first of the three forms of the page with id 'hidden-foo'. The example
> > demonstrates that the renderer hidden element has the same id that the
> > one you provide to the inputHidden component when you use forceId (so
> > the if of the form is not prepended to the id of the component as you
> > might expect otherwise).
> >
> > Regards,
> >
> > Bruno
> >
> > 2005/8/2, Dennis_Byrne@ak.blm.gov <De...@ak.blm.gov>:
> > >
> > > Sean, I'm sorry but I can't see what the forceId example demonstrates.
> > > Nobody in my shop can either.
> > >
> > > I routed my browser requests for forceId.jsp through a network sniffer and
> > > the form name is indeed not prepended to HTTP variables for controls
> > > "without forceId".  This demonstrates forceid is working.
> > >
> > > This is running on the same AS where I am having difficulties - but there
> > > are no inputHidden examples in the demo app.
> > >
> > >
> > > Dennis Byrne
> > >
> > >
> >
>

Re: forceId for x:inputHidden behavior

Posted by Sean Schofield <se...@gmail.com>.
Bruno, 

Does this example work at the moment?  I tried it late yesterday and
had some exceptions.  I didn't get a chance to look into it yet ...

sean

On 8/2/05, Bruno Aranda <br...@gmail.com> wrote:
> Yes, there is a forceId example for a hidden field in the simple
> examples (forceId.jsp) and it is working. The inputHidden is in the
> first of the three forms of the page with id 'hidden-foo'. The example
> demonstrates that the renderer hidden element has the same id that the
> one you provide to the inputHidden component when you use forceId (so
> the if of the form is not prepended to the id of the component as you
> might expect otherwise).
> 
> Regards,
> 
> Bruno
> 
> 2005/8/2, Dennis_Byrne@ak.blm.gov <De...@ak.blm.gov>:
> >
> > Sean, I'm sorry but I can't see what the forceId example demonstrates.
> > Nobody in my shop can either.
> >
> > I routed my browser requests for forceId.jsp through a network sniffer and
> > the form name is indeed not prepended to HTTP variables for controls
> > "without forceId".  This demonstrates forceid is working.
> >
> > This is running on the same AS where I am having difficulties - but there
> > are no inputHidden examples in the demo app.
> >
> >
> > Dennis Byrne
> >
> >
>

Re: forceId for x:inputHidden behavior

Posted by Bruno Aranda <br...@gmail.com>.
Yes, there is a forceId example for a hidden field in the simple
examples (forceId.jsp) and it is working. The inputHidden is in the
first of the three forms of the page with id 'hidden-foo'. The example
demonstrates that the renderer hidden element has the same id that the
one you provide to the inputHidden component when you use forceId (so
the if of the form is not prepended to the id of the component as you
might expect otherwise).

Regards,

Bruno

2005/8/2, Dennis_Byrne@ak.blm.gov <De...@ak.blm.gov>:
>  
> Sean, I'm sorry but I can't see what the forceId example demonstrates. 
> Nobody in my shop can either. 
>  
> I routed my browser requests for forceId.jsp through a network sniffer and
> the form name is indeed not prepended to HTTP variables for controls
> "without forceId".  This demonstrates forceid is working.   
>  
> This is running on the same AS where I am having difficulties - but there
> are no inputHidden examples in the demo app. 
>  
>  
> Dennis Byrne 
>  
>

Re: forceId for x:inputHidden behavior

Posted by De...@ak.blm.gov.
Sean, I'm sorry but I can't see what the forceId example demonstrates. 
Nobody in my shop can either. 

I routed my browser requests for forceId.jsp through a network sniffer and 
the form name is indeed not prepended to HTTP variables for controls 
"without forceId".  This demonstrates forceid is working. 

This is running on the same AS where I am having difficulties - but there 
are no inputHidden examples in the demo app.


Dennis Byrne


Re: forceId for x:inputHidden behavior

Posted by Sean Schofield <se...@gmail.com>.
What about the simple examples?  Do they work?

sean

On 8/1/05, Dennis_Byrne@ak.blm.gov <De...@ak.blm.gov> wrote:
>  
> Notice that forceId works for inputText, but not inputHidden. 
>  
> From log.
>  
> <x:inputHidden forceId="true" id="reachId1"
> rendered="#{reachCrudBacker.normalMode}"
> value="#{reachCrudBacker.unit.reachId}" /> 
> <x:inputText forceId="true" id="reachId2"
> rendered="#{reachCrudBacker.normalMode}"
> value="#{reachCrudBacker.unit.reachId}" /> 
>  
> From log. 
>  
> ERROR gov.blm.ak.webutil.written.backing.BackingUtil -
> PRINTING REQUEST VALUES ... 
> ERROR gov.blm.ak.webutil.written.backing.BackingUtil -
> myForm:_link_hidden_ = [Ljava.lang.String;@4fe98e 
> ERROR gov.blm.ak.webutil.written.backing.BackingUtil -
> autoScroll = [Ljava.lang.String;@6e7c41 
> ERROR gov.blm.ak.webutil.written.backing.BackingUtil -
> myForm:reachId1 = [Ljava.lang.String;@19fce32 
> ERROR gov.blm.ak.webutil.written.backing.BackingUtil -
> myForm:_id156 = [Ljava.lang.String;@9a6bd1 
> ERROR gov.blm.ak.webutil.written.backing.BackingUtil -
> myForm_SUBMIT = [Ljava.lang.String;@1c8b94 
> ERROR gov.blm.ak.webutil.written.backing.BackingUtil -
> reachId2 = [Ljava.lang.String;@faad6 
> ERROR gov.blm.ak.webutil.written.backing.BackingUtil -
> FINISHED PRINTING REQUEST VALUES ... 
>  
> Dennis Byrne
>

Re: forceId for x:inputHidden behavior

Posted by De...@ak.blm.gov.
Notice that forceId works for inputText, but not inputHidden.

>From log.

<x:inputHidden forceId="true" id="reachId1" 
rendered="#{reachCrudBacker.normalMode}" 
value="#{reachCrudBacker.unit.reachId}" />
<x:inputText forceId="true" id="reachId2" 
rendered="#{reachCrudBacker.normalMode}" 
value="#{reachCrudBacker.unit.reachId}" />

>From log.

ERROR gov.blm.ak.webutil.written.backing.BackingUtil - PRINTING REQUEST 
VALUES ...
ERROR gov.blm.ak.webutil.written.backing.BackingUtil - 
myForm:_link_hidden_ = [Ljava.lang.String;@4fe98e
ERROR gov.blm.ak.webutil.written.backing.BackingUtil - autoScroll = 
[Ljava.lang.String;@6e7c41
ERROR gov.blm.ak.webutil.written.backing.BackingUtil - myForm:reachId1 = 
[Ljava.lang.String;@19fce32
ERROR gov.blm.ak.webutil.written.backing.BackingUtil - myForm:_id156 = 
[Ljava.lang.String;@9a6bd1
ERROR gov.blm.ak.webutil.written.backing.BackingUtil - myForm_SUBMIT = 
[Ljava.lang.String;@1c8b94
ERROR gov.blm.ak.webutil.written.backing.BackingUtil - reachId2 = 
[Ljava.lang.String;@faad6
ERROR gov.blm.ak.webutil.written.backing.BackingUtil - FINISHED PRINTING 
REQUEST VALUES ...

Dennis Byrne

Re: forceId for x:inputHidden behavior

Posted by Sean Schofield <se...@gmail.com>.
That's how its supposed to work.  Most likely you've overlooked
something.  There is an example in the simple examples (forceId.jsp)
that shows a hidden input.  Check the example and let us know if the
example does not work or if you think you've discovered a bug.

sean

On 8/1/05, Dennis_Byrne@ak.blm.gov <De...@ak.blm.gov> wrote:
>  
> I've set x:inputHidden[@id]=foo inside a form.  When the form is submitted,
> the name of the parameter is "myForm:foo" .   
>  
> The docs for forceId say "If true, this component will force the use of the
> specified id when rendering." I would expect that after specifying
> forceId="true", the name of the parameter would then be "foo".  I have done
> this, but the original parameter name is still there.   
>  
> What does forceId do? 
> How do I force the HTTP parameter name to be "foo"?  Are we just supposed to
> sandwich an expression between two verbatim tags? 
>  
> Dennis Byrne
>