Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-12263

Extend SafeEdit JS API so thats widget can register callbacks for advanced save/restore mechanism

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.7.2
    • Fix Version/s: 5.7.3
    • Component/s: Seam / JSF UI

      Description

      SafeEdit is able to restore simple html input (such as html input, select, etc). But for more adavanced widget, safeEdit won't be able to restore by his own the saved values.

      Synchronization
      Some complex widgets are initialized via some asynchronous javascript. This is the case for tiny_mce which might take some time to load. The problem is that we cannot init the safeEdit mechanism before such widgets are completely loaded otherwise they won't be included in the save mechanism.

      To sort out this issue, safeEdit can provide a synchronization feature that would allow external scripts to register a wait function that will be called periodically until it returns true (meaning that the script which registered has finished).

      Advanced Restore
      This is the case of a select2 widget which needs to be intialized through the call of a specific JS function. Tiny_mce also needs a specific restore process.

      It would therefore be interesting to extend SafeEdit API to allow widgets to register their own additional restore actions. The idea is that safeEdit would held an array of callback functions where additional restore actions would be registered and called when restore is triggered.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 4 hours
                  4h
                  Remaining:
                  Remaining Estimate - 4 hours
                  4h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified