0

Edited by post to try and explain what I am trying to accomplish.

I am trying to fill a field with a value sent by a post to the page. The input value is an ID that I want to insert into the field so the user does not have to fill out all the fields again.

<h:inputText value="#{bowlingEvent.ID}" />

What i am trying to do is simply.

bowlingEvent.ID = param['id'];

How is that done in jsf 2.x ?

BalusC
  • 992,635
  • 352
  • 3,478
  • 3,452
user2130951
  • 2,291
  • 4
  • 21
  • 49
  • Which jsf version is it? – Xtreme Biker Dec 09 '13 at 13:58
  • Well not being an expert on taglibs and versions. At least I am using the 2.2 jsf (mojarra) in eclipse. – user2130951 Dec 09 '13 at 14:04
  • Do you need to use scriplets for any specific reason? Nowadays facelets is the way to go with modern jsf. – Xtreme Biker Dec 09 '13 at 14:07
  • No I don't I need to assign the variable as I try to do. How it's done is not important. – user2130951 Dec 09 '13 at 14:17
  • 1
    I mean, you're mixing nowadays frameworks (jsf 2.2) with technologies that were released a decade ago. Isn't it easier to follow current jsf-facelets patterns? Unless you're playing with some legacy code, which I would consider not to upgrade to jsf 2.2 or definitely upgrade-rewrite everything. In short words, putting jsf 2.2 and scriptlets in the same plate will bring you headaches. See [this](http://stackoverflow.com/questions/2188706/how-to-avoid-using-scriptlets-in-my-jsp-page). – Xtreme Biker Dec 09 '13 at 14:38
  • ok how would you suggest this code would look in the modern era? – user2130951 Dec 09 '13 at 14:43
  • For the parameters, see how [`f:viewParam`](http://stackoverflow.com/questions/4888942/viewparam-vs-managedpropertyvalue-param-id) works. To replace your page with facelets, here you have [some tips](http://stackoverflow.com/questions/6322127/can-not-find-the-tag-library-descriptor-for-http-java-sun-com-jsf-facelets). – Xtreme Biker Dec 09 '13 at 15:04
  • Thanks that should probably do it :) – user2130951 Dec 09 '13 at 15:35

0 Answers0