This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes Layouts in primefaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Layouts in primefaces" Watch "Layouts in primefaces" New topic

Layouts in primefaces

Waqar Azam

Joined: Feb 27, 2013
Posts: 6
I am new to JSF i am using primefaces,

I have to layoutunits center and north, in the north layout I have inputtext and commandbutton, I just simply want to enter a url in inputbox and when I click on the commandbutton the url is displayed in the center layoutunit. your guideness will be highly appreciated.

the code is given below

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950

Start off by creating a backing bean to accept/display these values. If you expose a String property to hold the URL that has been entered, reference it in your inputText control, and again in an h:outputText control in your center panel, clicking Submit will cause the input to be passed into the backing bean and the page to be re-rendered, updating both the input control and outputtext with the value which had just been entered.

Customer surveys are for companies who didn't pay proper attention to begin with.
daniele licitra
Ranch Hand

Joined: Apr 08, 2013
Posts: 36

You need a form element to manage input field and command button (it's a submit button).

You also need a bean like Tim Holloway wrote

The page now will be:

when you click, the url is saved in the variable and the page is reloaded. Now outpuTtext can show the content of the variables.
Maybe there are some mistakes in the code, i can't try it now.

JPA 2.1.0
Glassfish 3.1->4, Wildfly, Primefaces 3.4->4
wood burning stoves
subject: Layouts in primefaces
Similar Threads
Primefaces Layout only shows Center when there should be North, South, East and West as well
How do you update / replace or re-render JSF components from a click on another component?
error message when browsing in the application
FaceletContext.includeFacelet trouble
Activating page in another panel -- almost working but puzzled