2

My application relies on the ability of users to enter text, and has several settings with a huge range of potential values best entered as strings (to comply with Wolfram's admonition to "choose your controls judiciously", if nothing else). However the Wolfram Demonstrations guidelines prohibit the use of InputField in Manipulate.

Is there a substitute that would allow my users to enter text and see the results of each keypress as they type?

orome
  • 12,819
  • 3
  • 52
  • 100
  • 1
    Unless this changed, I think you can use InputField, but it is restricted (for security) to accept only numbers (numeric values) and not strings. I know the link you have says InputField is not supported in Demonstrations. but I think this is meant for general input. You can try it and see if it works, to accept numbers only? There is no way to input Text for a demo. – Nasser Mar 14 '15 at 18:47
  • @Nasser: Unfortunately, it needs to be text. So the question remains: any (perhaps clever or tricky) approach to getting user-entered text into a Demonstration. (And, so I get it out of my system: a stupid limitation.) – orome Mar 14 '15 at 18:52
  • 2
    You can always create custom keyboard to append/deleted characters from string attached to a variable. – Kuba Mar 14 '15 at 21:30
  • @Kuba: Now that's a clever idea! Tell me more! – orome Mar 14 '15 at 21:53
  • 2
    Well, basic idea is simple but fully functional keyboard may be a lot of work. You can start with: DynamicModule[{input = ""}, Panel@Column[{ Dynamic@input, Row[Button[#, input = input <> #] & /@ CharacterRange["a", "z"]], Button["<-", input = StringDrop[input, -1]] }] ] – Kuba Mar 14 '15 at 22:08
  • @Kuba: I'll give that a try. I'd take more as an answer to this question, if you have the time. – orome Mar 14 '15 at 22:12
  • As to "stupid limitation": This isn't stupid from a business perspective. Allowing text input would make it possible to make a free application that mimics Mathematica's functionality. – Sjoerd C. de Vries Mar 14 '15 at 22:19
  • @SjoerdC.deVries: Oh I agree that there's a (characteristically Wolfram) business reason. – orome Mar 14 '15 at 22:23
  • 1
    Well, there are about 700 developers that make their living out of this. Do you suggest they should work for free? – Sjoerd C. de Vries Mar 14 '15 at 22:32
  • @SjoerdC.deVries: Of course that's what I'm suggesting. My irritation has nothing to do with already paying almost $800/year on a product that constantly throws up arbitrary limitations and requires me to figure out which of the many additional products I need to acquire to get the level of functionality that is clearly claimed by the one I've already paid (and paid and paid) for. – orome Mar 14 '15 at 22:38
  • You did't pay anything for the CDF player, right? Your complaint was about restrictions of the free CDF player and not Mathematica itself. I also beg to differ about the "many additional products" you need to acquire. Could you provide a few examples of claimed functionality of Mathematica for which you need additional products? – Sjoerd C. de Vries Mar 14 '15 at 22:46
  • @SjoerdC.deVries: We should stop. – orome Mar 14 '15 at 22:47
  • @Kuba: The keyboard works nicely (at least for the basic text input part), but I can't figure out how to get the variable it sets to be used in the Manipulate. It appears to be local to the DynamicModule. An answer that showed how to use the keyboard as a substitute for InputField in my Manipulate would be great! – orome Mar 15 '15 at 13:06
  • 1
    @raxacoricofallapatorius Try taking input out of the DynamicModule and making it a Manipulate variable with {{input, ""}, ControlType -> None}. – Michael E2 Mar 15 '15 at 15:22
  • @MichaelE2: Nice! That, and the keyboard, is an answer! Now if I can figure out how to position things so the don't look like crap; and deal with all the other input that really should be be an InputField but can't be. (What a dumb mercenary limitation on Demonstrations functionality!) – orome Mar 15 '15 at 15:26
  • @Kuba: Bumping again: your comments could be an answer. – orome Mar 27 '15 at 16:04

0 Answers0