You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Ji Kim <ji...@oracle.com> on 2014/03/19 20:44:01 UTC

[Trinidad] New API addition for Trinidad's UIXEditableValueTemplate

So as requested I am sending out a separate email to get responses from 
the crowd regarding this JIRA 
[https://issues.apache.org/jira/browse/TRINIDAD-2459].

The change is to add 2 new APIs to Trinidad's UIXEditableValueTemplate =>

public void *addValueUpdatedListener*(ValueUpdatedListener listener)
{
   super.addFacesListener (listener);
}

public void *removeValueUpdatedListener *(ValueUpdatedListener listener)
{
   super.removeFacesListener (listener);
}

where *ValueUpdatedEvent* is queued within the updateModel method/phase.

public void updateModel(FacesContext context)
{
     ...
     try
     {
       Object localValue = getLocalValue();
       expression.setValue(context.getELContext(), localValue);
       setValue(null);
       setLocalValueSet(false);
*(new ValueUpdatedEvent(this)).queue();*
     ...
}

Thanks!

Re: [Trinidad] New API addition for Trinidad's UIXEditableValueTemplate

Posted by Andy Schwartz <an...@gmail.com>.
+1

Andy


> On Mar 21, 2014, at 5:07 PM, Gabrielle Crawford <ga...@oracle.com> wrote:
> 
> +1
> 
>> On Mar 19, 2014, at 1:25 PM, Ji Kim wrote:
>> 
>> For note =>
>> 
>> This is to allow components and etcetera to listen to this event by adding a listener in the new UIXEditableValueTemplate.addValueUpdatedListener API. 
>> 
>> The pro of adding this event + listener is that various components can then listen when the value has been updated in the model. 
>> 
>> This is beneficial in 
>> 1) Clearing up any data that would have been persisted for some reason [i.e. if the app wished to keep a temporary value of a component using some kind of polling from client to server to not lose any dirty data {i.e. how confluence wiki allows users to preserves the old states}]. 
>> 2) To avoid sending a certain asynchronous dirty data from the client to the server 
>> 
>> Thanks!
>> 
>>> On 3/19/2014 12:44 PM, Ji Kim wrote:
>>> So as requested I am sending out a separate email to get responses from the crowd regarding this JIRA [https://issues.apache.org/jira/browse/TRINIDAD-2459].
>>> 
>>> The change is to add 2 new APIs to Trinidad's UIXEditableValueTemplate =>
>>> 
>>> public void addValueUpdatedListener(ValueUpdatedListener listener) 
>>> { 
>>>   super.addFacesListener (listener); 
>>> } 
>>> 
>>> public void removeValueUpdatedListener (ValueUpdatedListener listener) 
>>> { 
>>>   super.removeFacesListener (listener); 
>>> } 
>>> 
>>> where ValueUpdatedEvent is queued within the updateModel method/phase.
>>> 
>>> public void updateModel(FacesContext context)
>>> {
>>>     ...
>>>     try
>>>     {
>>>       Object localValue = getLocalValue();
>>>       expression.setValue(context.getELContext(), localValue);
>>>       setValue(null);
>>>       setLocalValueSet(false);
>>>       (new ValueUpdatedEvent(this)).queue();
>>>     ...
>>> }
>>> 
>>> Thanks!
> 

Re: [Trinidad] New API addition for Trinidad's UIXEditableValueTemplate

Posted by Gabrielle Crawford <ga...@oracle.com>.
+1

On Mar 19, 2014, at 1:25 PM, Ji Kim wrote:

> For note =>
> 
> This is to allow components and etcetera to listen to this event by adding a listener in the new UIXEditableValueTemplate.addValueUpdatedListener API. 
> 
> The pro of adding this event + listener is that various components can then listen when the value has been updated in the model. 
> 
> This is beneficial in 
> 1) Clearing up any data that would have been persisted for some reason [i.e. if the app wished to keep a temporary value of a component using some kind of polling from client to server to not lose any dirty data {i.e. how confluence wiki allows users to preserves the old states}]. 
> 2) To avoid sending a certain asynchronous dirty data from the client to the server 
> 
> Thanks!
> 
> On 3/19/2014 12:44 PM, Ji Kim wrote:
>> So as requested I am sending out a separate email to get responses from the crowd regarding this JIRA [https://issues.apache.org/jira/browse/TRINIDAD-2459].
>> 
>> The change is to add 2 new APIs to Trinidad's UIXEditableValueTemplate =>
>> 
>> public void addValueUpdatedListener(ValueUpdatedListener listener) 
>> { 
>>   super.addFacesListener (listener); 
>> } 
>> 
>> public void removeValueUpdatedListener (ValueUpdatedListener listener) 
>> { 
>>   super.removeFacesListener (listener); 
>> } 
>> 
>> where ValueUpdatedEvent is queued within the updateModel method/phase.
>> 
>> public void updateModel(FacesContext context)
>> {
>>     ...
>>     try
>>     {
>>       Object localValue = getLocalValue();
>>       expression.setValue(context.getELContext(), localValue);
>>       setValue(null);
>>       setLocalValueSet(false);
>>       (new ValueUpdatedEvent(this)).queue();
>>     ...
>> }
>> 
>> Thanks!
> 


Re: [Trinidad] New API addition for Trinidad's UIXEditableValueTemplate

Posted by Ji Kim <ji...@oracle.com>.
For note =>

This is to allow components and etcetera to listen to this event by 
adding a listener in the new 
UIXEditableValueTemplate.addValueUpdatedListener API.

The pro of adding this event + listener is that various components can 
then listen when the value has been updated in the model.

This is beneficial in
1) Clearing up any data that would have been persisted for some reason 
[i.e. if the app wished to keep a temporary value of a component using 
some kind of polling from client to server to not lose any dirty data 
{i.e. how confluence wiki allows users to preserves the old states}].
2) To avoid sending a certain asynchronous dirty data from the client to 
the server

Thanks!

On 3/19/2014 12:44 PM, Ji Kim wrote:
> So as requested I am sending out a separate email to get responses 
> from the crowd regarding this JIRA 
> [https://issues.apache.org/jira/browse/TRINIDAD-2459].
>
> The change is to add 2 new APIs to Trinidad's UIXEditableValueTemplate =>
>
> public void *addValueUpdatedListener*(ValueUpdatedListener listener)
> {
>   super.addFacesListener (listener);
> }
>
> public void *removeValueUpdatedListener *(ValueUpdatedListener listener)
> {
>   super.removeFacesListener (listener);
> }
>
> where *ValueUpdatedEvent* is queued within the updateModel method/phase.
>
> public void updateModel(FacesContext context)
> {
>     ...
>     try
>     {
>       Object localValue = getLocalValue();
>       expression.setValue(context.getELContext(), localValue);
>       setValue(null);
>       setLocalValueSet(false);
> *(new ValueUpdatedEvent(this)).queue();*
>     ...
> }
>
> Thanks!