KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Dynamically populate dropdown box with selectable entries

 
Post new topic   Reply to topic    KiXforms Forum Index -> Advanced Scripting
View previous topic :: View next topic  
Author Message
tmartinez
KiXforms Follower
KiXforms Follower


Joined: 25 Mar 2004
Posts: 15

PostPosted: Thu Sep 08, 2016 11:10 pm    Post subject: Dynamically populate dropdown box with selectable entries Reply with quote

Hello all,

I have an AD User Admin tool that I want to enhance. I'd like the kixform to have the ability to dynamically populate a search field as characters are being entered. Specifically, while entering a user name, whether it be a SamAccountName, Last name, DisplayName, ... As the AD Search process finds AD user names that matched the entered characters, multiple lines, 10-20, AD User Names start appearing and/or disappearing in a drop down box. And once the AD user name you have been looking for appears, you can select/click on it to populate the kixForm box/field. Is that doable with KixForms? if so, can someone share the box (combox) code, and/or point me in the right direction?

Thanks Very Happy
Back to top
View user's profile Send private message
enahsyemotp
KiXforms Regular
KiXforms Regular


Joined: 22 Sep 2010
Posts: 40
Location: Tulsa, OK

PostPosted: Tue Sep 27, 2016 10:02 pm    Post subject: Reply with quote

This should be possible, but I wouldn't recommend it. In essence it would be running the AD query on every keystroke. You could maybe create a list of All objects at the beginning, and then narrow down by keystroke.
Back to top
View user's profile Send private message
enahsyemotp
KiXforms Regular
KiXforms Regular


Joined: 22 Sep 2010
Posts: 40
Location: Tulsa, OK

PostPosted: Tue Sep 27, 2016 10:48 pm    Post subject: Reply with quote

Here is a basic example that demonstrates one way to do what you're asking.

Code:
Break On

$list = "abc","abcd","bcd","bcdef"

$Form = CreateObject("Kixtart.Form")

$TextBox = $Form.TextBox
$TextBox.Location = 0,0
$TextBox.OnKeyDown = "Search()"

$ListView = $Form.ListView
$ListView.Location = 10,$TextBox.Bottom+5
$ListView.Columns.Count = 1

$Exit = $Form.ToolButton
$Exit.Center
$Exit.Top = $ListView.Bottom + 5
$Exit.Text = "Exit"
$Exit.Icon = 37
$Exit.OnClick = "Quit()"

LoadList()

$Form.Center
$Form.Show
While $Form.Visible
 $=Execute($Form.DoEvents)
Loop

Exit 1

Function Search()
   For Each $item in $ListView.Items
      If Left($item.Text, Len($TextBox.Text)) <> $TextBox.Text
         $item.Remove()
      Endif
   Next
EndFunction

Function LoadList()
   For Each $item in $list
      $nul = $ListView.Items.Add($item)
   Next
EndFunction
Back to top
View user's profile Send private message
tmartinez
KiXforms Follower
KiXforms Follower


Joined: 25 Mar 2004
Posts: 15

PostPosted: Wed Sep 28, 2016 1:12 am    Post subject: Post subject: Dynamically populate dropdown box with selecta Reply with quote

enahsyemotp from -Tulsa, OK-

thank you.

I'll play w/ the code.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Advanced Scripting All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group