bmichotte / ProMotion-XLForm

ProMotion-XLForm is a ProMotion plugin for XLForm
MIT License
20 stars 21 forks source link

Button Doesn't Appear #40

Open ricsrock opened 8 years ago

ricsrock commented 8 years ago

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!

apinrdw commented 8 years ago

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'
ricsrock commented 8 years ago

That fixed it. Thanks so much!

bmichotte commented 8 years ago

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

baramik commented 8 years ago

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

apinrdw commented 8 years ago

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