• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2676
  • Last Modified:

Inputbox's with dropdown option - LotusScript

Hello All,

I needed to create input boxes in Notes, but these input boxes need to have drop down boxes in them, where the user can select certain items.  For example, when the user clicks on the new button on a form, an inputbox should appear stating: "Please select Interface Type:", and the choices for for interface type should be: "Ethernet", "Tolken Ring".  Anyone have any suggestions?  This is being programmed in LotusScript...

Thanks,
Faraz
0
fiqbal
Asked:
fiqbal
  • 6
  • 4
  • 2
  • +1
1 Solution
 
ArunkumarCommented:
Have a subform with a layout region with one field in it called choices.

use this script in a button that will prompt with choices.

===================
     Dim ss As New notessession
     Dim curdb As notesdatabase
     Dim doc As notesdocument
     Dim dialogdoc As notesdocument
     Dim item As notesitem    
     Dim ws As New notesuiworkspace    
     Set curdb = ss.CurrentDatabase
     
     
     Set DialogDoc = curdb.createDocument()
     Set Item = dialogdoc.replaceItemValue("Choices", "")
     
     
     Call Item.appendToTextList("Value-1")
     Call Item.appendToTextList("Value-2")
     Call Item.appendToTextList("Value-3")          
     
     DialogDoc.Text = "Please select from the list below:"
     tvMsg$ = "Routing"
     If WS.DialogBox("DialogChooser", True, True, False, False, False, False, tvMsg$, DialogDoc) = False Then Exit Sub

=======================

Good Luck!
Arun.
0
 
ArunkumarCommented:
The subform name is DialogChooser FYI:
0
 
ArunkumarCommented:
To check for the values selected use the following code after the previous one....

If dialogdoc.Choices(0) = "Value-1" then
'Do your action here !!!
Elseif dialogdoc.Choices(0) = "Value-2" then
'Do your second action here
Else
'Third action...
End if

Hope this helps!

-Arun.
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
ArunkumarCommented:
Oops!

The choices field in the layout region on the subform "DialogChooser" should be of ComboBox type and the value should be from formula, and write the formula as "Choices" without quotes !

:-)
0
 
HemanthaKumarCommented:
With R5, there is a new method equivalent to @prompt.

Use this in a button
Sub Initialize
     Dim ws As New NotesUIWorkspace
     Dim v As Variant
     Dim choices(1) As String
     choices(0) = "Ethernet"
     choices(1) =  "Tolken Ring"
     v = ws.Prompt( PROMPT_OKCANCELCOMBO, "TITLE", "Please select Interface Type:", choices(0), choices )
     Print v
End Sub

For R4, I have a different approach. If you are interested I can give it to you.

~Hemanth
0
 
Jean Marie GeeraertsApplication EngineerCommented:
Listening...
0
 
ArunkumarCommented:
See i am so dumb!  Such an easy thing i got so very confused !
0
 
Jean Marie GeeraertsApplication EngineerCommented:
Hee hee :-)
0
 
ArunkumarCommented:
;-)
0
 
fiqbalAuthor Commented:
Hello Hemanth,

I get an error, "Object variable not set"...Any suggestions?
0
 
fiqbalAuthor Commented:
Thank you for your input...
0
 
fiqbalAuthor Commented:
Thank you all for your inputs....it was greatly appreciated!!!
0
 
HemanthaKumarCommented:
Sorry I couldn't get to this immediately. Is the problem solved ?
0
 
fiqbalAuthor Commented:
yes thank you...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 6
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now