Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can I add JSF components through Ajax?

 
Namitha karupaiya
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to add a JSF component dynamically, based on the value selected by the user from a drop-down list. The new component should appear without whole page refresh. Is it possible?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17627
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I doubt you can use AJAX to dynamically add JSF components, but it's definitely possible to use AJAX to show and hide components. There are a number of advanced tags that do that. Things like tab controls, tree listviews, panel open/close controls and so forth.
 
Namitha karupaiya
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If we can't add JSF components dynamically, then it is definitely a downside of the JSF framework!
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17627
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Namitha karupaiya wrote:If we can't add JSF components dynamically, then it is definitely a downside of the JSF framework!


Well, do you want a possibly malicious remote client redesigning code on your server?
 
Namitha karupaiya
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe this feature can be made available in technologies like JSF without compromising the security. If you are able to pass data (instructions to the browser from server & so forth) securely, dynamically creating & adding JSF components (securely) must be possible.

When JSF was created first time, the creators did not imagine a facility like AJAX at all & in JSF 2.0 also they did not do a good job.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17627
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You seem to be under the illusion that all clients are honest and that the only security risk is a third party attack.

It's actually very easy to construct a dishonest client. As I've mentioned once or twice on the JavaRanch today, it's one of my favourite ways to bypass do-i-t-yourself security systems, since they almost always assume an honest client, unlike the security system that's part of the JEE standard.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic