<< Back to previous view
Portlets + ajax API (JAVASERVERFACES_SPEC_PUBLIC-861)

[JAVASERVERFACES_SPEC_PUBLIC-966] Make finding components involved by <f:ajax> more flexible Created: 07/Apr/11  Updated: 08/Nov/13

Status: Open
Project: javaserverfaces-spec-public
Component/s: Ajax/JavaScript
Affects Version/s: 2.2
Fix Version/s: None

Type: Sub-task Priority: Major
Reporter: Mathias Werlitz Assignee: Unassigned
Resolution: Unresolved Votes: 5
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Status Whiteboard:

size_medium importance_large

Tags:
Participants: Hanspeter Duennenberger and Mathias Werlitz

 Description   

Specifying the components for execution and re-rendering is very limited. Identifying components outside of a naming container is restricted to absolute component id paths. This is not very flexible. In combination with composite components this leads to requiring knowledge about the tree structure outside of the composite component. This breaks encapsulation.

This simple example is not possible at the moment:
<h:panelGroup id="outside">
Something
</h:panelGroup>
<h:form id="form">
<h:commandLink id="inner" value="Ajax">
<f:ajax render="outside" />
</h:commandLink>
</h:form>

There should be a much more flexible solution.

Furthermore the concept of solely defining the components that take part in a partial (AJAX) request (execute and render) by parameters submitted by the client is very limited.
There should be an option to dynamically decide on the server which components take part in the partial request. At the moment the client is responsible to send these ids.

AJAX requests for example could have a logical name. Components could receive an event or register a listener at the view root that can in turn decide whether the component has to participate in the request or not. This could ease the initially described limitation and allows loosely coupled ajaxified parts of the view.
Maybe this is a usecase for server-side behaviors?



 Comments   
Comment by Hanspeter Duennenberger [ 18/Apr/11 08:01 AM ]

There are components that should be rendered on all AJAX requests - like e.g. the h:messages area showing all the messages. There must be a way to add id's of components to render during PartialViewContext processing (see also my related blog for this https://insights2jsf.wordpress.com/2010/10/17/wrapping-partialviewcontext-or-howto-automatically-add-clientids-to-render-on-ajax-requests/).

Having said that - there might even be components to execute always. I actually created a tag <my:always render="..." execute="..." /> that can be placed on pages to specify areas on the page to render/execute always.

Generated at Mon Apr 21 05:15:59 UTC 2014 using JIRA 4.0.2#472.