aspose file tools*
The moose likes JSF and the fly likes Can I add JSF components through Ajax? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Can I add JSF components through Ajax?" Watch "Can I add JSF components through Ajax?" New topic
Author

Can I add JSF components through Ajax?

Namitha karupaiya
Ranch Hand

Joined: Mar 10, 2004
Posts: 89
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

Joined: Jun 25, 2001
Posts: 16054
    
  21

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.


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

Joined: Mar 10, 2004
Posts: 89
If we can't add JSF components dynamically, then it is definitely a downside of the JSF framework!
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16054
    
  21

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

Joined: Mar 10, 2004
Posts: 89
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

Joined: Jun 25, 2001
Posts: 16054
    
  21

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
 
subject: Can I add JSF components through Ajax?