You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by laredotornado <la...@gmail.com> on 2008/09/26 21:13:31 UTC

Date picker?

Hi, I'm using MyFaces 1.2.4.  On my JSF page, what is the easiest way of
creating a way to select a date, preferably with select menus displaying the
month, day, and year?

Thanks, - Dave
-- 
View this message in context: http://www.nabble.com/Date-picker--tp19694686p19694686.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Myfaces action on pressing Enter Key

Posted by Andrew Robinson <an...@gmail.com>.
Are there two threads for this subject?

Here is my reply on the other thread:

I believe browsers automatically submit the form if a submit button is
found in the form. There are 2 wiki pages that could help you:

http://wiki.apache.org/myfaces/SubmitPageOnValueChange
http://wiki.apache.org/myfaces/JavascriptWithJavaServerFaces

-Andrew

On Mon, Sep 29, 2008 at 12:07 PM, Jalapati, Nagendra
<na...@philips.com> wrote:
> Yes, my issue is the second case.
>
> When enter is clicked any where in the form, I should be able to call the
> same action as below <h:commandButton
>
>
>
> <h:commandButton styleClass="button" value="Go" id="name_btn" type="submit"
> action="#{searchBean.orgSearch}"></h:commandButton>
>
>
>
> Nag
>
>
>
>
>
>
>
> ________________________________
>
> From: Grzesiek [mailto:gregory.d3@gmail.com]
> Sent: Monday, September 29, 2008 2:02 PM
> To: MyFaces Discussion
> Subject: Re: Myfaces action on pressing Enter Key
>
>
>
> If you press 'enter' when your cursor is on form field, the form will be
> submited - no problem - so I  suppose that it's NOT what you are thinking
> about.
>
> BUT If you would like to submit form whenever enter is pressed, the only one
> way is to use javascipt and sth like  'click hidden link'.
>
> regards
> Grzesiek
>
> 2008/9/26 Jalapati, Nagendra <na...@philips.com>
>
> Hello Friends,
>
> How to call managed bean action on pressing Enter Key on the key board?
>
> I have a simple form with a text field and button. When user hits enter
> key on the key board I should be able to call searchBean.orgSearch (same
> action as commandButton)
>
> I am using Myfaces1.1
>
> <f:view>
> <h:form id="searchForm">
> <tr>
>
> <td><h:inputText id="empName" size="30"
> value="#{searchBean.employeeName}"></h:inputText></td>
>
> <td>&nbsp;&nbsp;<h:commandButton styleClass="button" value="Go"
> id="name_btn" type="submit"
> action="#{searchBean.orgSearch}"></h:commandButton></td>
>
> </tr>
> </h:form>
> </f:view>
>
> All suggestions are welcomed...
>
> Nag
>
>

RE: Myfaces action on pressing Enter Key

Posted by "Jalapati, Nagendra" <na...@philips.com>.
Yes, my issue is the second case. 

When enter is clicked any where in the form, I should be able to call
the same action as below <h:commandButton

 

<h:commandButton styleClass="button" value="Go" id="name_btn"
type="submit" action="#{searchBean.orgSearch}"></h:commandButton>

 

Nag

 

 

 

________________________________

From: Grzesiek [mailto:gregory.d3@gmail.com] 
Sent: Monday, September 29, 2008 2:02 PM
To: MyFaces Discussion
Subject: Re: Myfaces action on pressing Enter Key

 

If you press 'enter' when your cursor is on form field, the form will be
submited - no problem - so I  suppose that it's NOT what you are
thinking about.

BUT If you would like to submit form whenever enter is pressed, the only
one way is to use javascipt and sth like  'click hidden link'.

regards
Grzesiek



2008/9/26 Jalapati, Nagendra <na...@philips.com>

Hello Friends,

How to call managed bean action on pressing Enter Key on the key board?

I have a simple form with a text field and button. When user hits enter
key on the key board I should be able to call searchBean.orgSearch (same
action as commandButton)

I am using Myfaces1.1

<f:view>
<h:form id="searchForm">
<tr>

<td><h:inputText id="empName" size="30"
value="#{searchBean.employeeName}"></h:inputText></td>

<td>&nbsp;&nbsp;<h:commandButton styleClass="button" value="Go"
id="name_btn" type="submit"
action="#{searchBean.orgSearch}"></h:commandButton></td>

</tr>
</h:form>
</f:view>

All suggestions are welcomed...

Nag

 


Re: Myfaces action on pressing Enter Key

Posted by Grzesiek <gr...@gmail.com>.
If you press 'enter' when your cursor is on form field, the form will be
submited - no problem - so I  suppose that it's NOT what you are thinking
about.

BUT If you would like to submit form whenever enter is pressed, the only one
way is to use javascipt and sth like  'click hidden link'.

regards
Grzesiek


2008/9/26 Jalapati, Nagendra <na...@philips.com>

> Hello Friends,
>
> How to call managed bean action on pressing Enter Key on the key board?
>
> I have a simple form with a text field and button. When user hits enter
> key on the key board I should be able to call searchBean.orgSearch (same
> action as commandButton)
>
> I am using Myfaces1.1
>
> <f:view>
> <h:form id="searchForm">
> <tr>
>
> <td><h:inputText id="empName" size="30"
> value="#{searchBean.employeeName}"></h:inputText></td>
>
> <td>&nbsp;&nbsp;<h:commandButton styleClass="button" value="Go"
> id="name_btn" type="submit"
> action="#{searchBean.orgSearch}"></h:commandButton></td>
>
> </tr>
> </h:form>
> </f:view>
>
> All suggestions are welcomed...
>
> Nag
>

Myfaces action on pressing Enter Key

Posted by "Jalapati, Nagendra" <na...@philips.com>.
Hello Friends,

How to call managed bean action on pressing Enter Key on the key board?

I have a simple form with a text field and button. When user hits enter
key on the key board I should be able to call searchBean.orgSearch (same
action as commandButton)

I am using Myfaces1.1

<f:view>
<h:form id="searchForm">
<tr>

<td><h:inputText id="empName" size="30"
value="#{searchBean.employeeName}"></h:inputText></td>
	
<td>&nbsp;&nbsp;<h:commandButton styleClass="button" value="Go"
id="name_btn" type="submit"
action="#{searchBean.orgSearch}"></h:commandButton></td>
	
</tr>
</h:form>
</f:view>

All suggestions are welcomed...

Nag

Re: Date picker?

Posted by Hazem Saleh <ha...@apache.org>.
OK, It is very easy.

All what you have to do is the following:

1. Setup Tomahawk in your environment.
2. Add the Tomahawk tag library declaration in your page:
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
3. Use the <t:inputCalendar> tag as follows:
<t:inputCalendar  value="#{calendarBean.date}" .../>

The date attribute of the CalendarBean is an instance of (java.util.Date).

For the complete parameters, check:
http://mashups.s43.eatj.com/myfaces-example-simple/calendar.jsp.source

I hope this is useful.


On Fri, Sep 26, 2008 at 9:44 PM, laredotornado <la...@gmail.com>wrote:

>
> Good stuff.  Do you have an example of how it would be coded on a JSF page?
> When I clicked on the link within the example you listed, I got a page that
> looked like: http://screencast.com/t/YKocTFOm
>
> Also, the link I found on Google --
> http://myfaces.apache.org/tomahawk/calendar.html, gives a 404.
>
>  - Dave
>
>
>
> Hazem Saleh-2 wrote:
> >
> > Use Tomahawk Calendar:
> > http://mashups.s43.eatj.com/myfaces-example-simple/calendar.jsf
> >
> > On Fri, Sep 26, 2008 at 9:13 PM, laredotornado
> > <la...@gmail.com>wrote:
> >
> >>
> >> Hi, I'm using MyFaces 1.2.4.  On my JSF page, what is the easiest way
> of
> >> creating a way to select a date, preferably with select menus displaying
> >> the
> >> month, day, and year?
> >>
> >> Thanks, - Dave
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Date-picker--tp19694686p19694686.html
> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > Hazem Ahmed Saleh Ahmed
> >
> > Web blog: http://www.jroller.com/page/HazemBlog
> >
> > [Web 2.0] GMaps Integration with JSF + Apache Tomahawk + JBoss a4j:
> > http://code.google.com/p/gmaps4jsf/
> >
> > Author of (The Definitive Guide to Apache MyFaces and Facelets):
> >
> http://www.amazon.com/gp/product/images/1590597370/ref=dp_image_text_0?ie=UTF8&n=283155&s=books
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Date-picker--tp19694686p19695144.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>


-- 
Hazem Ahmed Saleh Ahmed

Web blog: http://www.jroller.com/page/HazemBlog

[Web 2.0] GMaps Integration with JSF + Apache Tomahawk + JBoss a4j:
http://code.google.com/p/gmaps4jsf/

Author of (The Definitive Guide to Apache MyFaces and Facelets):
http://www.amazon.com/gp/product/images/1590597370/ref=dp_image_text_0?ie=UTF8&n=283155&s=books

Re: Date picker?

Posted by laredotornado <la...@gmail.com>.
Good stuff.  Do you have an example of how it would be coded on a JSF page? 
When I clicked on the link within the example you listed, I got a page that
looked like: http://screencast.com/t/YKocTFOm

Also, the link I found on Google --
http://myfaces.apache.org/tomahawk/calendar.html, gives a 404.

 - Dave



Hazem Saleh-2 wrote:
> 
> Use Tomahawk Calendar:
> http://mashups.s43.eatj.com/myfaces-example-simple/calendar.jsf
> 
> On Fri, Sep 26, 2008 at 9:13 PM, laredotornado
> <la...@gmail.com>wrote:
> 
>>
>> Hi, I'm using MyFaces 1.2.4.  On my JSF page, what is the easiest way of
>> creating a way to select a date, preferably with select menus displaying
>> the
>> month, day, and year?
>>
>> Thanks, - Dave
>> --
>> View this message in context:
>> http://www.nabble.com/Date-picker--tp19694686p19694686.html
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Hazem Ahmed Saleh Ahmed
> 
> Web blog: http://www.jroller.com/page/HazemBlog
> 
> [Web 2.0] GMaps Integration with JSF + Apache Tomahawk + JBoss a4j:
> http://code.google.com/p/gmaps4jsf/
> 
> Author of (The Definitive Guide to Apache MyFaces and Facelets):
> http://www.amazon.com/gp/product/images/1590597370/ref=dp_image_text_0?ie=UTF8&n=283155&s=books
> 
> 

-- 
View this message in context: http://www.nabble.com/Date-picker--tp19694686p19695144.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Date picker?

Posted by Hazem Saleh <ha...@apache.org>.
Use Tomahawk Calendar:
http://mashups.s43.eatj.com/myfaces-example-simple/calendar.jsf

On Fri, Sep 26, 2008 at 9:13 PM, laredotornado <la...@gmail.com>wrote:

>
> Hi, I'm using MyFaces 1.2.4.  On my JSF page, what is the easiest way of
> creating a way to select a date, preferably with select menus displaying
> the
> month, day, and year?
>
> Thanks, - Dave
> --
> View this message in context:
> http://www.nabble.com/Date-picker--tp19694686p19694686.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>


-- 
Hazem Ahmed Saleh Ahmed

Web blog: http://www.jroller.com/page/HazemBlog

[Web 2.0] GMaps Integration with JSF + Apache Tomahawk + JBoss a4j:
http://code.google.com/p/gmaps4jsf/

Author of (The Definitive Guide to Apache MyFaces and Facelets):
http://www.amazon.com/gp/product/images/1590597370/ref=dp_image_text_0?ie=UTF8&n=283155&s=books