JS client: Combo box keypress events: FIXED
Das Goravani
goravanis at gmail.com
Fri May 28 15:34:03 UTC 2021
This is a fast and slick pop up list generator.
You use a regular field and a regular list
The hard part, is getting the characters they type correctly, this does it.
I use this to show a list of countries as they type it populates.
On evKey
Hide fields NoteFieldLarge,CitiesList
Do $topwind.$objs.BDEntryPane.$bobjs.1457.$visible.$assign(kFalse)
Show fields CountriesList
Process event and continue
Calculate ltypedstring as $cfield.$contents
Calculate cWhereClause as con('WHERE cntry_name LIKE "',ltypedstring,'%"')
Do tvO.$buildlistfromfileusesearch(ivCountriesList,'fcCountries',cWhereClause)
Redraw CountriesList
And I do the following when they double click in the list of countries
On evClick
Set current list ivCountriesList
Calculate #LSEL as 1
Calculate #S1 as lst(ivCountriesList,#L,cntry_name)
If len(#S1)
Do $topwind.$objs.BDEntryPane.$objs.BIRTHCOUNTRY.$contents.$assign(ivCountriesList.cntry_name)
Calculate iv1.birthcountry as #S1
Redraw (Refresh now) BIRTHCOUNTRY
Queue set current field BIRTH_STATE
Calculate lwhere as con('WHERE state_country = "',ivCountriesList.cntry_name,'"')
Do tvO.$buildlistfromfileusesearch(iStatesList,'fcStates',lwhere)
Redraw StatesDrpLst
End If
On May 28, 2021, at 8:11 AM, Graeme Whiting via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:
>
> Thanks Philip and Per-Arne, I think that's fixed it 😊
>
>
> -----Original Message-----
> From: Philip Tulett <philip.tulett at pdq-networks.com>
> Sent: 27 May 2021 23:28
> To: 'OmnisDev List - English' <omnisdev-en at lists.omnis-dev.com>
> Cc: Graeme Whiting <graeme.whiting at catalina-software.co.uk>
> Subject: RE: JS client: Combo box keypress events
>
> [EXTERNAL] This is an external email. Please treat links and attachments with caution.
>
> Hi Graeme,
>
> Have to you had a look at the "Linked List" example jslinkedlist.lbs in the .\welcome\examples\jsgallery.
> I think that does what you are looking for.
>
> Kind regards
> Philip
>
> -----Original Message-----
> From: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> On Behalf Of Graeme Whiting via omnisdev-en
> Sent: 27 May 2021 14:38
> To: omnisdev-en at lists.omnis-dev.com
> Cc: Graeme Whiting <graeme.whiting at catalina-software.co.uk>
> Subject: O$: JS client: Combo box keypress events
>
> Hi all,
>
> Doing some JavaScript client development and I want to have an entry field that when you type characters, populates a list with possible matches. This would appear to be an ideal candidate for a combo box, however that control doesn't have keypress events so you are constrained to waiting for the user to leave the field?
>
> I've got a solution of sorts using a combination of an entry field and separate list field, but surely this should be easier to do?
>
> Graeme.
>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
More information about the omnisdev-en
mailing list