Database driven textboxes - invalid values entered

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
rajeevkushwaha
New User
Posts: 7
Joined: Mon Mar 05, 2012 5:29 pm
First Name: Rajeev
Last Name: Kumar
Company Name: StoneRiver Inc
Contact:

Database driven textboxes - invalid values entered

Post by rajeevkushwaha »

We have textboxes with database driven auto-complete. If user types in something that does not equate to a valid value in database and press' enter, a blank field value is sent back to RPG.

Now, some of our databases may have blank as a valid code value, in such case RPG would see incorrect entry as a valid blank value, misleading the user into believing that invalid value was accepted!
How can we handle such a scenario?
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Database driven textboxes - invalid values entered

Post by David »

You are correct, the auto complete box does not require the user to select from the values presented.

I'm not sure that I understand...

If you want to force the user to select from values presented, a drop down box is what you need.

If using an auto complete box, the program must validate what the user types into it.
rajeevkushwaha
New User
Posts: 7
Joined: Mon Mar 05, 2012 5:29 pm
First Name: Rajeev
Last Name: Kumar
Company Name: StoneRiver Inc
Contact:

Re: Database driven textboxes - invalid values entered

Post by rajeevkushwaha »

I don't want to use drop-down box as my table file may have hundreds of values.

Here's the problem once again:
My textbox is defined with "choice options field" as CODE||' '||DESC, and "choice value field" as CODE.

Lets say user entered code as "QWERTY" - an invalid value

RPG receives blanks in the bound variable. Blanks happens to be a valid value, and hence passes the validation and is stored into the database as blanks.

Now, RPG doesn't know that user entered invalid value. To user it will appear as if "QWERTY" was accepted.
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Database driven textboxes - invalid values entered

Post by David »

When you are searching on the same field (or expression) that is used for the value, it then does return exactly what is typed into the box.

But, when used with different field/expression for value, it is then not clear what it should return to the program if the user has typed something which does not match. So it just returns blanks -- this is normal operation.

That said, I can understand your difficulty -- thanks for the additional explanation. I think a good long term solution is that we could add an optional property to the box that can be used to force the user to select a matching record or type an exact match. Maybe "force selection". If this property was turned on and they did not type/select a matching record, it would trigger a client-side validation message and control would not return to the RPG program.

I can discuss that with the development team.

In the meanwhile, here is one idea on how you can get around it...

You could concatenate some value onto the "choice value field", like this, maybe:

'X' || CODE

Then the bound "value" field would just have to be made long enough to accept the extra value. It can then remove it when the screen is submitted.

This way, you would know if you got all blanks that the user typed something invalid, as there would always be at least 'X' on a valid record selection.
MLC601
Profound User
Posts: 32
Joined: Mon Oct 10, 2011 9:30 am
First Name: Mark
Last Name: Chastant
Company Name: Jano Justice Systems, INC
Phone: 601-927-4428
Contact:

Re: Database driven textboxes - invalid values entered

Post by MLC601 »

How about also adding an option to pass whatever the user types back to the RPG program?

Here's an example: Currently we have code values on some of our screens so many of our users know and use these. We're attempting to use database driven auto-complete on these fields looking for a match on the description and returning the code when selected. Many of our experienced users will not want to pick from a list, just enter the code.

As I understand it, I'll get blanks passed to the RPG program when this happens, correct? I'd like to have the keyed value passed back to the RPG.
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Database driven textboxes - invalid values entered

Post by David »

This sort of thing can be done today with the combo box widget. Have you tried this? This widget allows the user to either type in a value, or select from a list.

You get whatever they typed into the box, or the value selected from the list if they used it.
MLC601
Profound User
Posts: 32
Joined: Mon Oct 10, 2011 9:30 am
First Name: Mark
Last Name: Chastant
Company Name: Jano Justice Systems, INC
Phone: 601-927-4428
Contact:

Re: Database driven textboxes - invalid values entered

Post by MLC601 »

That's a bit better, however, we really need this kind of option on the auto-complete also....some of our lists are very long and we'd prefer not to have our users scrolling through these lists unless they want to.....in fact, currently we have prompt programs that will show the entire list if the user so desires....

Thanks,

Mark
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests