Feature: Embed Widget inside static HTML

UI Components for JSF
Post Reply
helloprimefaces
Posts: 56
Joined: 28 Sep 2009, 17:44

29 Jan 2010, 03:01

Hi,
Before starting for the feature request, i would like to thank Cagatay and Team for their contribution and support.
Short Description:
This feature request is about embedding a primefaces/jsf application inside a HTML page, where a static DIV element will be replaced by dynamic content through AJAX.
Long Description:
Let say i have a HTML page like this

Code: Select all

<html>
 <head> [ comes all prime resources (css, js etc.) ] </head>
 <body>
   <div id="primewidgetDiv">This will be replaced with dynamic content</div>
   
   <script type="text/javascript">
	primewidget = function(){ 
	 PrimeFaces.ajax.AjaxRequest(
	 	'/webcontextname/loaddynamiccontent.jsf',
	 	{formClientId:'form123Id',global:true},
	 	{'primefacesPartialUpdate':'primewidgetDiv','requestparam1':'1122323', 'requestparam2':'something to test'}
	 	);}
	</script>
 </body>
</html>
Once the HTML page is loaded, then Primefaces script makes a callback to JSF application and fills the "primewidgetDiv" with dynamic content (with text, pics, links etc.).
Important thing is, once if the dynamic content got loaded, then from now only AJAX requests must be allowed for further actions (partial update). Because making a normal refresh (h:commandLink/button) makes no sense here as the whole page will be reloaded again and nested call to load script.

The idea is similar to something like here
Vaadin: http://vaadin.com/book/-/page/applicati ... dding.html
jFrame: http://garage.pimentech.net/scripts_doc_jquery_jframe/
jFrame Demo: http://garage.pimentech.net/examples/jquery_jframes/

This feature has many advantages, where we could embed a JSF application inside a iGoogle like widget and also for other similar cases.

Any help would be great!!

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

29 Jan 2010, 15:17

Thanks for the suggestion, how about using an iframe? Shouldn't it do the same?

helloprimefaces
Posts: 56
Joined: 28 Sep 2009, 17:44

29 Jan 2010, 16:25

cagatay.civici wrote:Thanks for the suggestion, how about using an iframe? Shouldn't it do the same?
Thanks for your reply.
Thats the exact point .. not to use IFrames.
So, a clean solution of replacing DIV ondemand with AJAX would be the best possible solution, i guess.
One thing to say... this feature is very important for embedding JSF Applications simply with existing websites without any stress.
Its my humble opinion for improving Primefaces with some extra-ordinary use-cases and not for my project/application.
Take your own time and think about it.

Thanks.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

29 Jan 2010, 16:38

I will for sure thank you.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 34 guests