Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Layouts in primefaces

 
Waqar Azam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
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
Pie
Posts: 18218
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
daniele licitra
Ranch Hand
Posts: 81
Java Linux Netbeans IDE
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic