Updating text fields with progress bar

View: New views
5 Messages — Rating Filter:   Alert me  

Updating text fields with progress bar

by Louis Polycarpou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm successfully running a progress bar example which updates its own
status at regular process intervals.  I'm now looking to update other
text fields on the page when the progress bar is at certain intervals
but I can't seem to find a way to do this.  I've tried binding the field
to a variable which I change the value of when the progress bar interval
changes.  I've also tried finding the component instance from the
FacesContext and updating the TextField value with setValue() but again
this has no effect.

Does anyone have an idea of how to do this?



Thanks,
Louis

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Updating text fields with progress bar

by Louis Polycarpou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

For clarity, see attached image...



Louis Polycarpou wrote:
I'm successfully running a progress bar example which updates its own status at regular process intervals.  I'm now looking to update other text fields on the page when the progress bar is at certain intervals but I can't seem to find a way to do this.  I've tried binding the field to a variable which I change the value of when the progress bar interval changes.  I've also tried finding the component instance from the FacesContext and updating the TextField value with setValue() but again this has no effect.

Does anyone have an idea of how to do this?


Thanks,
Louis




Re: Updating text fields with progress bar

by Dmitry Kushner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

There are couple approaches you can take:
  • you can update textField on the client side with Javascript - in response to, for example progressBar completion event:
    document.getElementById(someId).setProps(value: ' some new value');
  • or you can change the server state, and make textField update itself by calling refresh ( again in Javascript):

    document.getElementById(someId).refresh();
where someId is the id of textField

In either case, if you want to update view without page reload, some Javascript needs to be used

Louis Polycarpou wrote:
I'm successfully running a progress bar example which updates its own status at regular process intervals.  I'm now looking to update other text fields on the page when the progress bar is at certain intervals but I can't seem to find a way to do this.  I've tried binding the field to a variable which I change the value of when the progress bar interval changes.  I've also tried finding the component instance from the FacesContext and updating the TextField value with setValue() but again this has no effect.

Does anyone have an idea of how to do this?


Thanks,
Louis

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@...

Re: Updating text fields with progress bar

by Louis Polycarpou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dmitry,

That's very helpful and works great for onComplete().  However, there doesn't seem to be an onChange() event which I can call refresh on at a given interval ( I tried using setProps(onChange:change) but this has no effect).  Essentially, what I'm trying to do is retrieve the results of multiple WS calls and populate the fields as each one responds.

Thanks,
Louis

Dmitry Kushner wrote:
There are couple approaches you can take:
  • you can update textField on the client side with Javascript - in response to, for example progressBar completion event:
    document.getElementById(someId).setProps(value: ' some new value');
  • or you can change the server state, and make textField update itself by calling refresh ( again in Javascript):

    document.getElementById(someId).refresh();
where someId is the id of textField

In either case, if you want to update view without page reload, some Javascript needs to be used

Louis Polycarpou wrote:
I'm successfully running a progress bar example which updates its own status at regular process intervals.  I'm now looking to update other text fields on the page when the progress bar is at certain intervals but I can't seem to find a way to do this.  I've tried binding the field to a variable which I change the value of when the progress bar interval changes.  I've also tried finding the component instance from the FacesContext and updating the TextField value with setValue() but again this has no effect.

Does anyone have an idea of how to do this?


Thanks,
Louis

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@...


Re: Updating text fields with progress bar

by Bill Edwards - Sun BOS Software :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think Dmitry was suggesting that you hook the event generated by the
progressBar
when it updates its progress.   You can write a javascript function that
listens for this
event, then calls the refresh method on the textField widget.   I think
this is the
com_sun_webui_widget_progressBar_event_progress_end event (not sure of the
exact name, as I'm working in WS 4.3 after the namespace change we have made
for our widget library).

So, subscribe to this event and your event handler can then refresh the
textField
widget appropriately.

Louis Polycarpou wrote:

> Dmitry,
>
> That's very helpful and works great for onComplete().  However, there
> doesn't seem to be an onChange() event which I can call refresh on at
> a given interval ( I tried using setProps(onChange:change) but this
> has no effect).  Essentially, what I'm trying to do is retrieve the
> results of multiple WS calls and populate the fields as each one responds.
>
> Thanks,
> Louis
>
> Dmitry Kushner wrote:
>> There are couple approaches you can take:
>>
>>     * you can update textField on the client side with Javascript -
>>       in response to, for example progressBar completion event:
>>       document.getElementById(someId).setProps(value: ' some new value');
>>     * or you can change the server state, and make textField update
>>       itself by calling refresh ( again in Javascript):
>>
>>       document.getElementById(someId).refresh();
>>
>> where someId is the id of textField
>>
>> In either case, if you want to update view without page reload, some
>> Javascript needs to be used
>>
>> Louis Polycarpou wrote:
>>> I'm successfully running a progress bar example which updates its
>>> own status at regular process intervals.  I'm now looking to update
>>> other text fields on the page when the progress bar is at certain
>>> intervals but I can't seem to find a way to do this.  I've tried
>>> binding the field to a variable which I change the value of when the
>>> progress bar interval changes.  I've also tried finding the
>>> component instance from the FacesContext and updating the TextField
>>> value with setValue() but again this has no effect.
>>>
>>> Does anyone have an idea of how to do this?
>>>
>>>
>>> Thanks,
>>> Louis
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@...
>>> <mailto:users-unsubscribe@...>
>>> For additional commands, e-mail: users-help@...
>>> <mailto:users-help@...>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> <mailto:users-unsubscribe@...> For additional
>> commands, e-mail: users-help@...
>> <mailto:users-help@...>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...