Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 4 Jahren, 11 Monaten
Letzter Beitrag:
vor 4 Jahren, 11 Monaten
Beteiligte Autoren:
Bertrand R., Alexandre Leclerc, Bart VDE, Piet van Zanten

empty the controls when Hfilter() has no record found

Startbeitrag von Bertrand R. am 13.05.2013 14:38

Hi,
perhaps is a silly question, but I can´t get a solution.
I use HFILTER() to get the proper records of an assigned key.After that I filter a tableControl , which is empty when no record matches to the key.
So far its okay.
But when no record fits to the filter, I want to empty all controls, so the user can not enter any data and does not see not matching data. The same behavior as an empty record with HRESET() + HADD()
I tried HRESET() and RESET() with and without FILETOSCREEN(), but there is always a visible record of the filtered file like HREAD() with FileToScreen(). Its possible to edit this record and save.

In short : I want to empty the controls, no assigned content from a record.

Best regards,
Bertrand

Antworten:

Hi Bertrand,

Probably the in the detail tab you have the cascading input option checked. If this is required, you will have no choice but to set the Table..State property to ReadOnlyNoSelection (for example).

Best regards,
Alexandre Leclerc

von Alexandre Leclerc - am 13.05.2013 14:49
Hi Alexandre,
thank you for your answer.
It is not the table, which is the problem. The TableControl works fine and is empty, when no records fit to the HFilter().
But if no records fit to the filter: A record of the used file is shown in all the other controls.
I programmed :
HREADFIRST()
FileToScreen()
HFilter()
HActivateFilter()
FileToScreen() or no FileToScreen() // whatever
TableDisplay()
// if no records fit to the filter, TableControl is empty: thats ok
HRESET() // or RESET()

Now the record, which was displayed after the FileToScreen() is shown in all of the controls. Only the TableControl is empty.
The HREST() or the RESET() does not empty the controls.

Best Regards,
Bertrand

von Bertrand R. - am 14.05.2013 06:45
Hi Bertrand,

Did you try using the filename in the hReset? hReset with no filename specified uses the last used file.
If there are several files involved you need several hResets.

Regards,
Piet

von Piet van Zanten - am 14.05.2013 08:20
Hello Bertrand,

did some testing here : when no records fits the filter, using hReset(xxx) followed by a FileToScreen() empties my controls linked to the file.

Regards,
Bart

von Bart VDE - am 14.05.2013 11:51
Hi Bertrand,

I was about to answer the same: use FileToScreen() after you used HReset() on the required files. When you use FileToScreen(), you can also specify for which file it must be done. This can be usefull in some cases.

Best regards,
Alexandre Leclerc

von Alexandre Leclerc - am 14.05.2013 12:08
Hi Piet, Bart and Alexandre,

HRESET() with the Filename was required thing.
FileToScreen() with the window name now works fine.

I use 4 files with that window.

Thank you for your help !!!

Best regards,
Bertrand

von Bertrand R. - am 15.05.2013 09:35
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.