You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-user@incubator.apache.org by Balaji Phani Krishna Annangi <ba...@Chordiant.com> on 2007/03/27 12:54:47 UTC

How to set focus to an inputText

Everyone,
Does anybody know how to set initial focus to a <tr:inputText> when a
jsf page loaded?
I'm not using <tr:document> tag - so I cannot use initialFocusId

Sample code:

<ui:composition>
...
...
...
<tr:panelGroupLayout layout="vertical">
<tr:inputText id="addressLine1"
label="#{addressProps.values.addressLine1}"> 
<tr:inputText id="addressLine2"
label="#{addressProps.values.addressLine2}">
<tr:inputText id="addressLine3"
label="#{addressProps.values.addressLine3}">
...
...
...
</ui:composition>

How to set the focus to addressLine1 inputText?
Many thanks in advance

--Krishna

Re: How to set focus to an inputText

Posted by Cagatay Civici <ca...@gmail.com>.
http://example.irian.at/example-sandbox-20070327/focus.jsf

On 3/27/07, Matthias Wessendorf <ma...@apache.org> wrote:
>
> perhaps putting something stupid like
> <script>
> document.getElementById("foo6").focus();
> </script>
>
> at the end of the page works...
>
>
> On 3/27/07, Balaji Phani Krishna Annangi <ba...@chordiant.com>
> wrote:
> > Everyone,
> > Does anybody know how to set initial focus to a <tr:inputText> when a
> > jsf page loaded?
> > I'm not using <tr:document> tag - so I cannot use initialFocusId
> >
> > Sample code:
> >
> > <ui:composition>
> > ...
> > ...
> > ...
> > <tr:panelGroupLayout layout="vertical">
> > <tr:inputText id="addressLine1"
> > label="#{addressProps.values.addressLine1}">
> > <tr:inputText id="addressLine2"
> > label="#{addressProps.values.addressLine2}">
> > <tr:inputText id="addressLine3"
> > label="#{addressProps.values.addressLine3}">
> > ...
> > ...
> > ...
> > </ui:composition>
> >
> > How to set the focus to addressLine1 inputText?
> > Many thanks in advance
> >
> > --Krishna
> >
>
>
> --
> Matthias Wessendorf
> http://tinyurl.com/fmywh
>
> further stuff:
> blog: http://jroller.com/page/mwessendorf
> mail: mwessendorf-at-gmail-dot-com
>

Re: How to set focus to an inputText

Posted by Matthias Wessendorf <ma...@apache.org>.
perhaps putting something stupid like
<script>
document.getElementById("foo6").focus();
</script>

at the end of the page works...


On 3/27/07, Balaji Phani Krishna Annangi <ba...@chordiant.com> wrote:
> Everyone,
> Does anybody know how to set initial focus to a <tr:inputText> when a
> jsf page loaded?
> I'm not using <tr:document> tag - so I cannot use initialFocusId
>
> Sample code:
>
> <ui:composition>
> ...
> ...
> ...
> <tr:panelGroupLayout layout="vertical">
> <tr:inputText id="addressLine1"
> label="#{addressProps.values.addressLine1}">
> <tr:inputText id="addressLine2"
> label="#{addressProps.values.addressLine2}">
> <tr:inputText id="addressLine3"
> label="#{addressProps.values.addressLine3}">
> ...
> ...
> ...
> </ui:composition>
>
> How to set the focus to addressLine1 inputText?
> Many thanks in advance
>
> --Krishna
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com