简体   繁体   中英

Issues with “Recurly.js” form generation and GWT / AJAX

I am building a user interface for Recurly account management in a GWT application. This means there is no actual browser navigation happening between "pages" in the app, and client DOM state is maintained in memory until the user actually refreshes their browser.

In other words, when the user leaves the billing information "page" - the input elements still exist in memory and are simply detached from the visible area of the user interface.

Unfortunately, the fields that are being provided by "Recurly.js" are somewhat problematic here as they seem to be designed for use in a conventional framework where the user submits the form and then is redirected to a new page.

While they work perfectly for an initial submission of updated billing information (ie the first time the "form" is instantiated), if someone re-visits the screen multiple times without refreshing their browser, the fields do not accept input.

I have tried the following:

  • clearing the inner HTML of the wrapping recurly div elements (into which the provided fields are drawn by Recurly.JS) and calling configure() again
  • Not calling configure() after the first time it is called (in this case, subsequent visits to the page result in unresponsive inputs)

Is there a way I can tell Recurly.js to reset itself so that the provided fields can be redrawn? Or (and preferably) is there a way to configure recurly to use my own "input" fields for number, date, month, and cvv instead of those that are rendered into divs by Recurly.js?

Thank you

Edit:

I have discovered that Recurly.js is setting the visibility of their provided billing inputs to "visibility:hidden" after the form is accessed after being instantiated. If I can't force recurly to redraw the inputs, then I need to prevent this from happening some how...

I discovered a "readyState" variable in Recurly.js. If I set that back to "0" before calling "reconfigure", the fields correctly reconfigure themselves. This seems to fix my issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM