File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 17417

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.

An IDE is no substitute for an Intelligent Developer.
daniele licitra
Ranch Hand

Joined: Apr 08, 2013
Posts: 73

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
I agree. Here's the link:
subject: Layouts in primefaces
It's not a secret anymore!