Technology: ADF11g
Developed in: JDeveloper 11.1.1.3.0
Browsers tested: Firefox 3.6.13 and Internet explorer 7 (7.0.6002.18005)
Used database schema: HR
Used tables: EMPLOYEES
Summary
In this blog a solution is provided how to set the cursor in a specific field on page opening.
When a page with input fields is created by drag and drop from the data control palette it looks like this:
The user first has to click in a field before he can edit it.
But if we add into the af:document tag an initialFocusId clause referring to the component that should be active and set in that component the clientComponent property then the cursor is in that field on page opening.
In this example we changed:
<af:document id="d1"
title="emp">
<af:document id="d1"
title="emp"
initialFocusId="pt1:it4">
We changed the input text employee ID from:
<af:inputText value="#{bindings.EmployeeId.inputValue}"
label="#{bindings.EmployeeId.hints.label}"
required="#{bindings.EmployeeId.hints.mandatory}"
columns="#{bindings.EmployeeId.hints.displayWidth}"
maximumLength="#{bindings.EmployeeId.hints.precision}"
shortDesc="#{bindings.EmployeeId.hints.tooltip}"
id="it4">
<f:validator binding="#{bindings.EmployeeId.validator}"/>
<af:convertNumber groupingUsed="false"
pattern="#{bindings.EmployeeId.format}"/>
</af:inputText>
<af:inputText value="#{bindings.EmployeeId.inputValue}"
label="#{bindings.EmployeeId.hints.label}"
required="#{bindings.EmployeeId.hints.mandatory}"
columns="#{bindings.EmployeeId.hints.displayWidth}"
maximumLength="#{bindings.EmployeeId.hints.precision}"
shortDesc="#{bindings.EmployeeId.hints.tooltip}"
id="it4"
clientComponent="true">
<f:validator binding="#{bindings.EmployeeId.validator}"/>
<af:convertNumber groupingUsed="false"
pattern="#{bindings.EmployeeId.format}"/>
</af:inputText>
The initialFocus clause can also be conditional.
For example, on creation of a new employee the cursor must be in employee ID, when an existing employee is edit the employee ID is not updatable and the cursor must be in firstname.
When the employee is created the employee ID is blank, when an employee is edited it’s filled. This fact is used to render the inialFocus. Change it to:
<af:document id="d1"
title="emp"
initialFocusId="#{bindings.EmployeeId.inputValue==null?'pt1:it4':'pt1:it2'}">
<af:inputText value="#{bindings.EmployeeId.inputValue}"
label="#{bindings.EmployeeId.hints.label}"
required="#{bindings.EmployeeId.hints.mandatory}"
columns="#{bindings.EmployeeId.hints.displayWidth}"
maximumLength="#{bindings.EmployeeId.hints.precision}"
shortDesc="#{bindings.EmployeeId.hints.tooltip}"
id="it4"
readOnly="#{bindings.EmployeeId.inputValue!=null}"
clientComponent="true">
<f:validator binding="#{bindings.EmployeeId.validator}"/>
<af:convertNumber groupingUsed="false"
pattern="#{bindings.EmployeeId.format}"/>
</af:inputText>
<af:inputText value="#{bindings.FirstName.inputValue}"
label="#{bindings.FirstName.hints.label}"
required="#{bindings.FirstName.hints.mandatory}"
columns="#{bindings.FirstName.hints.displayWidth}"
maximumLength="#{bindings.FirstName.hints.precision}"
shortDesc="#{bindings.FirstName.hints.tooltip}"
id="it2"
clientComponent="true">
<f:validator binding="#{bindings.FirstName.validator}"/>
</af:inputText>
20150403chenlili
BeantwoordenVerwijderencoach factory
oakley sunglasses sale
hollister clothing
yoga pants
coach outlet
louis vuitton outlet
tory burch sale
timberland boots
louis vuitton uk
louis vuitton handbags
louis vuitton handbags
burberry outlet
lebron james shoes
christian louboutin sale
fitflops clearance
oakley sunglass
toms outlet
coach handbags
michael kors outlet
michael kors uk
hollister clothing
michael kors outlet
jordan 11s
cheap jordans
coach factory outlet
oakley sunglasses outlet
hogan shoes
canada goose jackets
2015-10-8leilei
BeantwoordenVerwijderennike trainers
Michael Kors Outlet
coach outlet
ugg boots sale
Kobe Bryant Shoes On Sale
michael kors handbags
nike shorts,nike hoodies,nike town,new nike shoes,nike tennis shoes,air max 97,nike shop,nike basketball
michael kors outlet online
ray-ban wayfarer
Louis Vuitton Handbags
Canada Goose Jackets/Coats And Parka Online
Michael Kors Handbags Clearance
Ugg Boots Outlet Clearance,Cheap Uggs On Sale Discount For Women
uggs sale
Michael Kors Outlet Online Free Shipping
michael kors outlet
canada goose jackets
michael kors uk
michael kors uk
Coach Factory Outlet Store Online
Jordan 4 Retro For Sale
Coach Outlet Coach factory
michael kors bags
ray-ban sunglasses,ray ban sunglasses,ray bans,rayban,ray ban wayfarer,raybans,ray ban glasses,ray ban aviators,ray ban clubmaster,ray ban eyeglasses,cheap ray bans,ray bans sunglasses,ray ban aviator,ray bands,fake ray bans,ray ban prescription glasses,ray ban outlet,ray ban canada,ray ban sunglasses sale,ray ban sale
Hollister Cheap Hollister Clothing Outlet Store
canada goose outlet,canada goose jackets,canada goose online,canada goose sale
coach outlet online
louis vuitton
ugg outlet
Michael Kors Handbags Outlet