ProMotion-XLForm icon indicating copy to clipboard operation
ProMotion-XLForm copied to clipboard

Button Doesn't Appear

Open ricsrock opened this issue 9 years ago • 5 comments

Hoping this is something silly on my part.

I'm setting up a login form with a button at the bottom of the form. The button does not appear.

 class LoginScreen < PM::XLFormScreen
   title "Login Screen"

   form_options required:  :asterisks, # add an asterisk to required fields
                # on_save:   :save_the_form, # will be called when you touch save
                on_cancel: :cancel_form, # will be called when you touch cancel
                auto_focus: true # the form will focus on the first focusable field

   def form_data
     [
       {title: 'Login',
        cells: [
          { title: "Username",
            name: :username,
            type: :text,
            placeholder: "Username",
            required: true },
         { title: "Password",
           name: :password,
           type: :password,
           placeholder: "Password",
           required: true },
         { title: "Login Here",
           name: :login,
           type: :button,
           on_click: -> (cell){ save_the_form(values) } 
         }
        ]
      }
     ]
   end

   def save_the_form(values)
     mp values
   end
 end

Any help is appreciated. Thanks!

ricsrock avatar Feb 18 '16 23:02 ricsrock

i got same issue. the button is appeared, but the text didn't show up and on_click event didn't fired.

probably the problem is the current version of XL-Form cocoapod is 3.1.1 had some issue, i was able to use this gem before with XL-Form 3.1.0.

so, i fork this repo and replace Gemfile, u can use it until this issue solved.

gem 'ProMotion-XLForm', github: 'apinrdw/ProMotion-XLForm', branch: 'fix-version'

apinrdw avatar Feb 19 '16 13:02 apinrdw

That fixed it. Thanks so much!

ricsrock avatar Feb 19 '16 14:02 ricsrock

@apinrdw Is using the latest PM-XLForm fix the issue ?

bmichotte avatar Feb 19 '16 14:02 bmichotte

Hey, guys. Any joy to get this issue fixed. I used @apinrdw advice as a reference. But still facing the same issue. onclick event is not fired. Thanks in advance

baramik avatar Mar 03 '16 09:03 baramik

@bmichotte , yeah using latest version fix this issue. Thanks.

apinrdw avatar May 21 '16 05:05 apinrdw