Hi Business Apps Guys,
Seems we are all running around trying to solve the problems with edit fields under Corona. So lets get going
This is a new thread after Renato wisely proposed we all merge our attempts to get our best workable solution - please contribute with ideas, proposals, code snippets etc.
Current contributions :
Renato RGB -Â https://bitbucket.org/redbeach/
Mine - https://github.com/atanasster/framework-widget/blob/master/widgetLibrary/widget_editfield.lua
Let me post some of the current features in my check-in. Renato please also update here the features from your so we can start the discussion since we went at it a little differently (my implementation is based on the newSearchField widget).
– ability to hide the field when not in focus - this allows us to have scenes/graphics on top of edit fields
– ability to move/group the field with other graphical objects
– uses a 3-frame slice for theming
– ability to place icons or buttons around the field
– ability to place a lebel in front of the field
– ability to make the field non-editable for usage like a combo box with a list for selection when clicked instead of showing the textfield
– ability to specify a “placeholder” (hint) when the field is empty
– Ability to have a “cancel” button to clear the field
– Reverts back to the newSearchField theme if you do not have a editField theme available in your app
– limit the number of chars
– onSubmit event when the user leaves the field or when pressed Done button
Here is an example usage
local labelField = widget.newEditField
  {
    Â
    x = display.contentCenterX,
    y = 130,
    width = 300,
    label = “Field with Label:”,
    labelColor =
[sharedmedia=core:attachments:1175]labelColor
,
    placeholder = “Enter a city…”,
    maxChars = 10,
    editFont = font,
    editFontSize = fontSize,
    editFontColor = fontColor,
    onSubmit = onSubmit,
    widgets = {Â
      {kind = “icon”, defaultFile = “images/coffee_cup.png”, align=“left”},
      {defaultFile = “images/filling.png”, align=“right”, onRelease = onSelectCoffee},
      {style = “clear”, defaultFile = “images/clear.png”}
    }
  }
Here is a screenshot of a form with edit fieldsÂ