Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
5
Erster Beitrag:
vor 9 Jahren, 7 Monaten
Letzter Beitrag:
vor 9 Jahren, 7 Monaten
Beteiligte Autoren:
Prolay Sarkar, marcel.berman@managingbusiness.be.pcs, DerekT

Dynamically set mandatory input

Startbeitrag von Prolay Sarkar am 19.01.2009 18:41

Hi,

On a certain event i need to set whether a given control is mandatory or not. I am getting the list of controls which are mandatory from a database or an ini file and then dynamically i want to set them as mandatory. Is there a direct property ??

Regards,
Prolay Sarkar

Antworten:

Hi !

On 19-Jan-2009, Prolay Sarkar wrote:

> Hi,
> On a certain event i need to set whether a given control is mandatory or
> not. I am getting the list of controls which are mandatory from a database
> or an ini file and then dynamically i want to set them as mandatory. Is
> there a direct property ??
> Regards,
> Prolay Sarkar


Quite easy in fact !
Once you have set the list of mandatory controls (as a window's global
string like TABTAB.... for example), in the "out
code" (in french "sortie de ..") of the controls you easely can test if the
name of the control is in the list (position(sControlList,myself..name) >=
1), and if it is, check if the control is empty, and if it is do a
ReturnToCapture()

Hope this help

--
Marcel Berman
Président de Be-Dev.be (www.be-dev.be) (Belgique)
Membre du CA de Wind'Asso (www.windasso.org) (France)
Be-Dev.be et Wind'Asso sont des associations d'utilisateurs des produits
PC-Soft
Message forwarded from pcsoft.us.windev

von marcel.berman@managingbusiness.be.pcs - am 20.01.2009 08:23
Hi,

Thank you very much!! It worked .. but can i validate all the controls weather it is filled of not in a tab pane on click of a button and it should then go to the next tab!!

Regards,
Prolay

von Prolay Sarkar - am 20.01.2009 16:18
Hi

Each tab has a numeric reference (from left to right).
MyTab = 2 will make the second tab active.

The numbers remain the same even if a tab is made invisible.

Regards

DerekT

von DerekT - am 20.01.2009 16:29
Hi Prolay,

On 20-Jan-2009, Prolay Sarkar wrote:

> Hi,
> Thank you very much!! It worked .. but can i validate all the controls
> weather it is filled of not in a tab pane on click of a button and it
> should then go to the next tab!!
> Regards,
> Prolay


If you want a global validation (only one check for all the controls), you
should then use another way of doing things.
For example, in a hidden button a code like this one
Local
sControlsToBeChecked is a string
=""+tab+""+tab+...+""
sControl is a string
bOK is boolean

for all string sControl of sControlsToBeChecked separated by tab
if {sControl,indcontrol}~= "" then
bok = false
end
if not bOK then break
end
if not bOK then
error()
ReturnToCapture(scontrol)
else
// activate the next tab
endif

and in the code modification of the tab, you do a
ExecuteProcess(,trtChange)

Hope this one will be ok !

--
Marcel Berman
Président de Be-Dev.be (www.be-dev.be) (Belgique)
Membre du CA de Wind'Asso (www.windasso.org) (France)
Be-Dev.be et Wind'Asso sont des associations d'utilisateurs des produits
PC-Soft
Message forwarded from pcsoft.us.windev

von marcel.berman@managingbusiness.be.pcs - am 21.01.2009 09:09
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.