cancel
Showing results for 
Search instead for 
Did you mean: 

Force refreshing context

fabio_bellocchio
Participant
0 Kudos

Hi friends,

there are some days I'm trying to solve this problem.

I think it's quite simple: I have an action that runs automatically, without any user action (it's triggered by a "TimedTriggered" element).

public void onActionSetDelay(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionSetDelay(ServerEvent)

wdContext.currentContextElement().setDelay(wdContext.currentContextElement().getDelay() - 1);

//@@end

}

This void changes a Label value and reloads the screen.

But, the problem is: when it runs, any data entered by the user in an Input Field is lost, unless the user clicks anywhere in the screen (out of this input field) before.

So, what happens on the user click that saves the data?

And is it possible to reproduce this in the code, in order to force a context refresh and avoid the lost of data??

Thanks in advance!

Fabio Bellocchio

Message was edited by:

Fabio Bellocchio

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Fabio,

This is behavior by design of HTML WD client (probably some other WD clients as well) -- only when user leavs InputField control, internal client-side event occured and change is registered by client. With any action (be it invoked either from button/link or from timed trigger) all registered changes are transfered to server.

Unfortunately you may not alter this behavior -- it's impossible to write any "JavaScript hooks" for client-side WD functionality.

Please explain why you have to alter label text with timer event -- probably we can find some workaround.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

fabio_bellocchio
Participant
0 Kudos

Thanks Valery!

Actually i have to keep a "TimedTrigger" dispatching an Event each 60 seconds.

But, if the user leaves a text in an Input Field, in this interval, when the event runs the text is lost.

I just would like to avoid this, because it can become a problem to the users.

Anyway I have to keep the event running each 60 seconds (it's a count down information about the duration of the session).

Of course, suggestions will be very welcome!

Thank you !

Fabio

Former Member
0 Kudos

Fabio,

Please read my blog post <a href="/people/valery.silaev/blog/2006/11/27/final-countdown">Final countdown</a> -- probably you can apply this technique.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

fabio_bellocchio
Participant
0 Kudos

Valery,

very very good!!

It really has solved my problem!

Thank you!

PS: do you know if I can change the title of the post?

Fabio

Answers (0)