Issue Details (XML | Word | Printable)

Key: JAVASERVERFACES_SPEC_PUBLIC-879
Type: Improvement Improvement
Status: Open Open
Priority: Critical Critical
Assignee: Unassigned
Reporter: vladperl
Votes: 3
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
javaserverfaces-spec-public

Decoder that act as separate functionality

Created: 29/Aug/10 08:29 PM   Updated: 19/Dec/13 10:42 PM
Component/s: Ajax/JavaScript
Affects Version/s: 1.1
Fix Version/s: 2.3

Time Tracking:
Not Specified

Environment:

Operating System: All
Platform: All


Issuezilla Id: 879
Status Whiteboard:

size_large importance_large draft

Tags:
Participants: rogerk and vladperl


 Description  « Hide

I suggest to introduce concept of decoders as functionality that works
independently from rendering functionality. JSF already has dedicated Renderer
class. So it makes sense to do the same thing for decoding functionality.
The first benefit from this approach would be possibility to send data from
client directly to decoder, skipping on the way to it necessity to use JSF
components and JSF life cycle. JSF developers will be able to create more
stateless JSF applications and use Javascript libraries in more flexible than
now manner.

The first usage of decoder would be the following kind of scenario:

client side:
jsf.ajax.post({data:{'dataHolder.value': value1}, render: 'input1');

server side:
if (isDataRequest(context.getExternalContext().getRequestHeaderMap())) { Decoder.handleDataRequest(context); context.responseComplete(); }

...
ValueExpression ve = getValueExpression(context, key);
ve.setValue(context.getELContext(), o.get(key));
...

Note: The first argument of the method "post" would be optional and called "url".
In case if developer need to customize handling of data from client we will use
this argument as way to identify decoder that will handle the data.

Complete signature of the Javascript method could be defined something like this:
jsf.ajax.post([url], [data], [handleAs], [render], [onSuccess(data)],
onError(data)]);



rogerk added a comment - 16/Nov/10 01:02 PM

triage


rogerk added a comment - 27/Oct/10 02:35 PM

triage


vladperl added a comment - 29/Aug/10 08:38 PM

The following link seems could be used as supporting point:
http://forums.java.net/jive/thread.jspa?messageID=481227