Jump to content

  •  

Photo

How do you get information from a dialog box?


  • Please log in to reply
9 replies to this topic

#1 Abel de Kock  newbie

Abel de Kock
  • Newbies
  • PipPip
  • 2 posts
  • FM Application:11 Advance
  • Platform:Mac OS X Snow Leopard
  • Skill Level:Intermediate

Posted 18 February 2012 - 09:05 AM

The scriptmaster dialog example allow you to have a dialog with dynamic buttons (Formatted Dialog with Dynamic Buttons), but in the example, it is unclear how to use the dialog to obtain user information as one can with Filemakers show custom dialog.

I want to use the dialog box and have the user enter a name and other information.

Is there any documentation anyone can point me to, on how to use this feature in the scriptmaster dialog.

Thanks

Abel
  • 0

#2 David Wikström  enthusiast

David Wikström
  • Members
  • 99 posts
  • FM Application:13 Advance
  • Platform:Cross Platform
  • Skill Level:Expert
  • Certification:8, 9, 10, 11, 12
  • Membership:TechNet, FileMaker Business Alliance
  • Time Online: 5d 17h 19m 8s

Posted 18 February 2012 - 10:36 AM

There's a line "return" or similar at the end . If you set a variable to call the ScriptMaster function, the result will be in the variable when the user has clicked the button in the dialogue.
  • 0

David Wikström
FileMaker 12/11/10/9/8 Certified Developer
CamelCase data
Heidelberg, Deutschland | Vancouver, BC, Canada
david@camelcase.com
www.camelcase.com


#3 john renfrew  enthusiast, with a bit of geek

john renfrew
  • Members
  • 418 posts
  • LocationUK
  • FM Application:13 Advance
  • Platform:Cross Platform
  • Skill Level:Intermediate
  • Certification:11, 12, 13
  • Membership:TechNet, FileMaker Business Alliance
  • Time Online: 10d 9h 49m 58s

Posted 20 February 2012 - 09:20 AM

This will not do what you want..
You need to research/ get some help with Swing Frames to get input boxes
  • 0

#4 john renfrew  enthusiast, with a bit of geek

john renfrew
  • Members
  • 418 posts
  • LocationUK
  • FM Application:13 Advance
  • Platform:Cross Platform
  • Skill Level:Intermediate
  • Certification:11, 12, 13
  • Membership:TechNet, FileMaker Business Alliance
  • Time Online: 10d 9h 49m 58s

Posted 21 February 2012 - 08:38 AM

Here is a simple single field entry box

// SwingInput ( message ; title ; type )
// 12_02_21 JR
// v1.0
// 'type' is 0 to 3 and controls the icon


import groovy.swing.SwingBuilder

type = type.toInteger()
if( type < 0 || type > 3){type = 0}
swing = new SwingBuilder()
swing.edt{
result = optionPane().showInputDialog(swing.frame(), message, title, type)
}

return result

  • 0

#5 Abel de Kock  newbie

Abel de Kock
  • Newbies
  • PipPip
  • 2 posts
  • FM Application:11 Advance
  • Platform:Mac OS X Snow Leopard
  • Skill Level:Intermediate

Posted 21 February 2012 - 12:53 PM

Thank you for that.

I suppose you need to know groovy to use this, and I don't. I will take a look a other dialog plugins which are easier to use.
  • 0

#6 Justin Morrow  newbie

Justin Morrow
  • Newbies
  • PipPipPip
  • 3 posts
  • FM Application:11 Advance
  • Platform:Windows 7
  • Skill Level:Intermediate

Posted 09 March 2012 - 12:47 AM

Here is me generated plugin code:

RegisterGroovy( "FormattedDialogWithDynamicButtons( message ; title ; option1 ; option2 )" ; "import groovy.swing.SwingBuilder¶
¶
SwingBuilder swing = new SwingBuilder()¶
def dialog = swing.optionPane(¶
  message:message,¶
  options:[option1, option2]¶
)¶
¶
dialog.createDialog(null, title).show()¶
return dialog.getValue()" )

At the last line it says return dialog.getvalue(). I don't know how to get that.

In the built-in function there is the get(lastmessagechoice), what is the equibalent of that in scriptmaster?


thanks :logik:
  • 0

#7 Justin Morrow  newbie

Justin Morrow
  • Newbies
  • PipPipPip
  • 3 posts
  • FM Application:11 Advance
  • Platform:Windows 7
  • Skill Level:Intermediate

Posted 11 March 2012 - 06:59 PM

Any one, please?
  • 0

#8 David Wikström  enthusiast

David Wikström
  • Members
  • 99 posts
  • FM Application:13 Advance
  • Platform:Cross Platform
  • Skill Level:Expert
  • Certification:8, 9, 10, 11, 12
  • Membership:TechNet, FileMaker Business Alliance
  • Time Online: 5d 17h 19m 8s

Posted 12 March 2012 - 08:45 AM

How do you call the plugin function?
  • 0

David Wikström
FileMaker 12/11/10/9/8 Certified Developer
CamelCase data
Heidelberg, Deutschland | Vancouver, BC, Canada
david@camelcase.com
www.camelcase.com


#9 john renfrew  enthusiast, with a bit of geek

john renfrew
  • Members
  • 418 posts
  • LocationUK
  • FM Application:13 Advance
  • Platform:Cross Platform
  • Skill Level:Intermediate
  • Certification:11, 12, 13
  • Membership:TechNet, FileMaker Business Alliance
  • Time Online: 10d 9h 49m 58s

Posted 13 March 2012 - 02:10 PM

Once you have registered the function it is available under the external functions drop down

Set a variable to this function with its parameters and whatever is returned in the code will be placed in your variable

I think thats all in th documentation.....
  • 0

#10 Justin Morrow  newbie

Justin Morrow
  • Newbies
  • PipPipPip
  • 3 posts
  • FM Application:11 Advance
  • Platform:Windows 7
  • Skill Level:Intermediate

Posted 14 March 2012 - 06:09 PM

How do you call the plugin function?


Hi Thanks for replying.

Here is my script to display the dialog


FormattedDialogWithDynamicButtons( "HELLO" ; "REQUIRED INPUT" ; "YES" ; "NO" )

The dialog box displays correctly. How do I get the result of the button thatw as pressed?

Thanks in advance

Once you have registered the function it is available under the external functions drop down Set a variable to this function with its parameters and whatever is returned in the code will be placed in your variable I think thats all in th documentation.....


Okay I got it now!!!.

Thanks!
  • 0




FMForum Advertisers