# webclient refresh form

**URL:** <https://forum.servoy.com/t/webclient-refresh-form/11603>\
**Category:** Classic Servoy\
**Created:** [January 12, 2010, 7:42pm UTC](https://forum.servoy.com/t/webclient-refresh-form/11603 "2010-01-12T19:42:38Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![acpugliese](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@acpugliese](https://forum.servoy.com/u/acpugliese)\
**Post date:** [January 12, 2010, 7:42pm UTC](https://forum.servoy.com/t/webclient-refresh-form/11603/1 "2010-01-12T19:42:38Z")

</div>

My solution is run WebClient. I have a field in the form of which is variable dataprovider form. In the OnAction execute a method. The problem I have is that when you run the OnAction, clean the variable that is dataprovider and reappears when the field has the data that previously had not respected the variable = null, in short I do not clean the field in the form.  
Can anyone help me?  
Thanks

---

<div class="post-metadata">

**Author:** ![lvostinar](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/lvostinar/32/5248_2.png) [@lvostinar](https://forum.servoy.com/u/lvostinar)\
**Post date:** [January 13, 2010, 12:01pm UTC](https://forum.servoy.com/t/webclient-refresh-form/11603/2 "2010-01-13T12:01:37Z")

</div>

Do you mean you try to set at onAction of the field the dataprovider to null ? Why would you like that ? It seems like you want to do some validation to your data ?

---

<div class="post-metadata">

**Author:** ![acpugliese](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@acpugliese](https://forum.servoy.com/u/acpugliese)\
**Post date:** [January 13, 2010, 12:49pm UTC](https://forum.servoy.com/t/webclient-refresh-form/11603/3 "2010-01-13T12:49:25Z")

</div>

Indeed, the field is valid in OnAction. in the case of being wrong, I clean it so that when display shows empty again, but this does not happen, you still receive the content that I had

---

<div class="post-metadata">

**Author:** ![lvostinar](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/lvostinar/32/5248_2.png) [@lvostinar](https://forum.servoy.com/u/lvostinar)\
**Post date:** [January 13, 2010, 1:19pm UTC](https://forum.servoy.com/t/webclient-refresh-form/11603/4 "2010-01-13T13:19:44Z")

</div>

I think you need another approach: have a look : [http://www.servoy.com/docs/servoy\_4/Ser … eGuide.pdf](http://www.servoy.com/docs/servoy_4/ServoyDev4ReferenceGuide.pdf) , page 127 about onDataChange event. I think you just need to return false if the new value is not correct.

---

<div class="post-metadata">

**Author:** ![acpugliese](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@acpugliese](https://forum.servoy.com/u/acpugliese)\
**Post date:** [January 13, 2010, 1:51pm UTC](https://forum.servoy.com/t/webclient-refresh-form/11603/5 "2010-01-13T13:51:11Z")

</div>

the OnDataChange, is used when the input field content in form changes, for example in the type TYPE\_AHEAD, in case of an input text\_field, OnDataChange event does not run, if the OnAction.  
But the problem I have it between the OnAction and when the form regains focus.  
in the method, the variable dataprovider clean and when the method ends and returns control to the form input field that is associated with the dataProvider that I just cleaned (variable = null), display the content I had before.  
A rare case is that when I run it with debugger and put a toggle breakpoint, and doing nothing let him continue, he returns to take over the form, the field in question is empty, if it works there.  
I hope I have been honest with the problem.  
thanks for the help you’re giving me

---

<div class="post-metadata">

**Author:** ![lvostinar](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/lvostinar/32/5248_2.png) [@lvostinar](https://forum.servoy.com/u/lvostinar)\
**Post date:** [January 13, 2010, 2:26pm UTC](https://forum.servoy.com/t/webclient-refresh-form/11603/6 "2010-01-13T14:26:37Z")

</div>

Not sure I understand the issue ; onDataChange is called all the time when data is changed, most of the time the users will not hit enter but just exit the field. You shouldn’t change the dataprovider of the field in its onAction method. I think would be better to describe the desired behavior, probably someone will give some suggestions about how to achieve it.

---

<div class="post-metadata">

**Author:** ![acpugliese](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@acpugliese](https://forum.servoy.com/u/acpugliese)\
**Post date:** [January 13, 2010, 2:39pm UTC](https://forum.servoy.com/t/webclient-refresh-form/11603/7 "2010-01-13T14:39:42Z")

</div>

thanks for your help, but not approaching the problem, I need the form back empty field when the form regains focus. Remember I’m running on WebClient NOT SmartClient. instruction (variable = null), which is data provider in the field of form, does not return empty.  
See also the rare case that I put above the debugger.  
again, thanks for your help

---

<div class="post-metadata">

**Author:** ![Jan\_Aleman](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@Jan\_Aleman](https://forum.servoy.com/u/Jan_Aleman)\
**Post date:** [January 14, 2010, 6:50pm UTC](https://forum.servoy.com/t/webclient-refresh-form/11603/8 "2010-01-14T18:50:18Z")

</div>

The sample you have sent me works fine.

function Validar\_campo()  
{  
// aqui valido el campo y necesito que vuelva vacio  
vcampo = null  
elements.scampo.requestFocus()  
}

code looks good to me too.

---

<div class="post-metadata">

**Author:** ![acpugliese](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@acpugliese](https://forum.servoy.com/u/acpugliese)\
**Post date:** [January 14, 2010, 7:07pm UTC](https://forum.servoy.com/t/webclient-refresh-form/11603/9 "2010-01-14T19:07:17Z")

</div>

Jan: I regret that we work here. We’ve tested under Windows and Linux. We Servoy version 4.1.3 as an aid for what it is. It happens because something happens?  
Thanks

---

<div class="post-metadata">

**Author:** ![acpugliese](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@acpugliese](https://forum.servoy.com/u/acpugliese)\
**Post date:** [January 14, 2010, 7:16pm UTC](https://forum.servoy.com/t/webclient-refresh-form/11603/10 "2010-01-14T19:16:45Z")

</div>

He added data, we are working on WebClient IE6 / 7 and mozila

---

<div class="post-metadata">

**Author:** ![Jan\_Aleman](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@Jan\_Aleman](https://forum.servoy.com/u/Jan_Aleman)\
**Post date:** [January 14, 2010, 7:52pm UTC](https://forum.servoy.com/t/webclient-refresh-form/11603/11 "2010-01-14T19:52:42Z")

</div>

> acpugliese:  
> He added data, we are working on WebClient IE6 / 7 and mozila

Ok on my mac it works fine. A colleague is now testing on Windows.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [January 15, 2010, 9:22am UTC](https://forum.servoy.com/t/webclient-refresh-form/11603/12 "2010-01-15T09:22:09Z")

</div>

i tested this code:

```auto
function Validar_campo()
{
// aqui valido el campo y necesito que vuelva vacio
vcampo = null
elements.scampo.requestFocus()
}

```

on windows in IE8 and FF35 and both work fine.  
The value is always cleared and the focus is returned.  
I agree with laurian that this is not something you should do.  
If i as a user type in something (lets say 15 chars) but i made a small mistake, if the server that swipes it completely empty, i would be very annoyed.  
Validation should be done in ondatachange and true or false should be returned depending on if the data is ok or not.  
Then we will set the focus back for you and make the text red so that the user understands that something is wrong.

---

<div class="post-metadata">

**Author:** ![acpugliese](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@acpugliese](https://forum.servoy.com/u/acpugliese)\
**Post date:** [January 15, 2010, 4:19pm UTC](https://forum.servoy.com/t/webclient-refresh-form/11603/13 "2010-01-15T16:19:53Z")

</div>

No reason was because we were not working. Our need is that the field is empty for the new bar code reader. no matter the validation, even appears in red, that I have it resolved. What I can not solve is that the field is empty.  
Sorry to insist but not what we see here. One striking theme of the debugger, if I run it with debugger and put a toggle breakpoint, and when it let him go, there it works. There is a problem with the version that we have?. It’s a memory problem?. I can not find axplicacion.  
I say again, sorry for my insistence.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [January 18, 2010, 2:24pm UTC](https://forum.servoy.com/t/webclient-refresh-form/11603/14 "2010-01-18T14:24:32Z")

</div>

please make a case that reproduces your problem in our support system.

That simple case above works fine for me.
