NetTalk Central

Author Topic: Validate using Radio Controls  (Read 9404 times)

Nick LeForte

  • Newbie
  • *
  • Posts: 15
  • Vancouver - Canada
    • View Profile
    • Email
Validate using Radio Controls
« on: September 12, 2007, 02:16:05 PM »
I'm having difficulty in implementing form radio controls.
I keep getting an error telling me that the field must be in the SP|RE|SS|ISO|PS|SV|D|3P|O
which are also my only radio selections on the form.
I put the results in i.e. 'SP' and SP with no luck.

The field in the dictionary is defined properly and works for standard applications, just not using NetTalk.

Can anyone help me??

Thanks,
Nick in Vancouver
« Last Edit: September 12, 2007, 03:35:47 PM by Nick LeForte »
Regards,
Nick LeForte

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: Validate using Radio Controls
« Reply #1 on: September 13, 2007, 08:06:46 AM »
Nick,

Some things that have bitten me with Radios -
Do you have the selections entered as strings in the Radio Options section of the fields template? And the values are quoted?
Is the field being updated the same size as the strings? - you are not putting 3 characters into a byte or string(2)

HTH,
chris c
Real programmers use copy con newapp.exe

Nick LeForte

  • Newbie
  • *
  • Posts: 15
  • Vancouver - Canada
    • View Profile
    • Email
Re: Validate using Radio Controls
« Reply #2 on: September 13, 2007, 10:17:07 AM »
Not sure what you mean entirely...
My field string is defined as string(20)
in the dictionary, my radio options are defined as shown above. This has always worked in a standard complied exe app.
I'm trying to duplicate the same function in NetTalk, I can't find a solution in any of the docs on how to implement a dictionary field with radio options. I tried selecting the field > selecting radio field type then enter the same names and options as defined in the dictionary. Doing this does not work.  ???
Thanks,

Regards,
Nick LeForte

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: Validate using Radio Controls
« Reply #3 on: September 13, 2007, 10:53:05 AM »
Sounds like you're doing the same thing I am. except ...
I have the Send New Value to Server check box checked on the client side tab of the radio entry.
You might try that. I have it checked because I change stuff on the other tabs depending on what radio selection is made.

chris
Real programmers use copy con newapp.exe

Nick LeForte

  • Newbie
  • *
  • Posts: 15
  • Vancouver - Canada
    • View Profile
    • Email
Re: Validate using Radio Controls
« Reply #4 on: September 14, 2007, 08:15:42 AM »
The only solution so far was to remove the radio options from my dictionary. I then created the options within NetTalk and selected the Client Send to server check box as you suggested. This works but is not what I expected, I'd like to retain my options for the field in my dictionary for regular compiled versions of my application if I could.

Regards,
Nick
Regards,
Nick LeForte

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: Validate using Radio Controls
« Reply #5 on: September 14, 2007, 09:00:36 AM »
That's a little odd. I don't think the options from the dictionary are used in the netweb template at all. So my guess is that you only need the check box checked.

That being said, you could leave your dictionary choices as they were and use a local variable for the entry field and then set the table field during the validate.

chris
Real programmers use copy con newapp.exe

roberti

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: Validate using Radio Controls
« Reply #6 on: September 16, 2007, 02:56:00 AM »
Hallo ,

>That's a little odd. I don't think the options from the dictionary are used in the netweb template at all.
In version 4.29 new future has been added:
Add: Dictionary validation (on the whole record) has been added to the ValidateRecord routine.

I have now the same problem with radio controls. In DCT I have a field STA:Status [string (10)] , Must be in list: Activ|Inactiv .
In a compiled exe works perfect. When I implement in NetTalk web, I set to radio then Text and Value to: 'Activ' & 'Activ' and 'Inactiv'  & 'Inactiv' , after I compile and I insert new record , I check Active or Inactive , I always got error message:
''Status: Must be one of | '' ...... I don't know why ??  :(  Someone has a solution ? :)

Thank you,
Robert

Nick LeForte

  • Newbie
  • *
  • Posts: 15
  • Vancouver - Canada
    • View Profile
    • Email
Re: Validate using Radio Controls
« Reply #7 on: September 18, 2007, 01:18:24 PM »
Exact problem I'm having, My solution was to remove the radio options altogether in the dictionary and set no validation on the field. I set it all within the NetTalk environment for now. Not a solution but a short gap work around...
Regards,
Nick
Regards,
Nick LeForte

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Validate using Radio Controls
« Reply #8 on: September 25, 2007, 12:22:04 AM »
Hi Nick (and Robert),

Version 4.29 introduced dict field validation (ie code is generated that validates the field based on the rules in the dictionary as well as the rules you set on the Validation tab.

Alas I assumed (incorrectly) that the validation was case in-sensitive, and it's not. I've changed this for 4.30. Nick if you need an interim build send me an email and I'll send it to you.

Cheers
Bruce

Nick LeForte

  • Newbie
  • *
  • Posts: 15
  • Vancouver - Canada
    • View Profile
    • Email
Re: Validate using Radio Controls
« Reply #9 on: September 27, 2007, 09:33:23 AM »
Thanks Bruce, I can wait for the official release of 4.30 . I  have it working for now as explained. I appreciate you offer however.
Thanks.
Regards,
Nick LeForte