|
I think the opposite, ICEFaces using Liferay's client API, is a much simpler proposition. Even if we have a client API of our own, the exact way it should be used could make it very difficult to use properly by a developer.
It's true that it might be simpler, but it has the drawback of ICEfaces needing to include proprietary Liferay code in our client bridge - code that would only be exercised in a certain percentage of deployments. It's small but unnecessary for many other (ie non-Liferay) environments. Adding stuff like this to the client-side code goes against our "server-centric", "highly mobile" characteristics too. Having an API there that can be used to dispose 1 or more views can solve more than one issue and could prove valuable going forward. At this point, I'd be happy to have the API available but undocumented (i.e use at your own risk). We can even stamp it with a skull and crossbones ;-) Since it's JavaScript, many of the functions fall into that category. As we look towards future versions of ICEfaces, we might start to build a more "open" client API anyway.
Add public method that notifies server and then disposes the view bound bridge instance.
Here's an example how the public method can be used: <script id="id1234"> Liferay.bind('closePortlet', function() { 'id1234'.asExtendedElement().findBridge().disposeAndNotify(); }); </script> The 'script' element needs to be inserted somewhere in the portlet content so that it can find the bridge instance. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
http://jira.icefaces.org/browse/ICE-2657
Work on this issue should also be coordinated with the work on this case:
http://jira.icefaces.org/browse/ICE-3229
for disposing of multiple views (when a portal page is closed).