Welcome! Log In Create A New Profile

Advanced

Dynamically set mandatory input

Posted by Prolay Sarkar 
Prolay Sarkar
Dynamically set mandatory input
January 19, 2009 07:41PM
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
marcel.berman@managingbusiness.be.pcs
Re: Dynamically set mandatory input
January 20, 2009 09:23AM
Hi !

On 19-Jan-2009, Prolay Sarkar <guest@news.pcsoft.fr> 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 <field1>TAB<Field2>TAB....<FieldN> 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
Prolay Sarkar
Re: Dynamically set mandatory input
January 20, 2009 05:18PM
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
DerekT
Re: Dynamically set mandatory input
January 20, 2009 05:29PM
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
marcel.berman@managingbusiness.be.pcs
Re: Dynamically set mandatory input
January 21, 2009 10:09AM
Hi Prolay,

On 20-Jan-2009, Prolay Sarkar <guest@news.pcsoft.fr> 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
="<control1>"+tab+"<control2>"+tab+...+"<controlN>"
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(<Your Message>)
ReturnToCapture(scontrol)
else
// activate the next tab
endif

and in the code modification of the tab, you do a
ExecuteProcess(<hiddenbutton>,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
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: