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

When using Nuxeo.DocumentContentBehavior I need to be able to set the value of `params` in a more flexible way

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.10
    • Fix Version/s: None
    • Component/s: Web UI

      Description

      Currently Nuxeo.DocumentContentBehavior uses a computed binding to set the value of `params`. This poses a couple of problems:

      Problem 1: You cannot set the value of a property that has a computed binding directly. I.e. can't do something like:

      observers: ['_setParams(currentUser)'],
      _setParams: function(currentUser) {
        if (currentUser && currentUser.id) {
          this.params = { "alert_user": currentUser.id }
        }
      },
      

      Problem 2: the computing function only observes the `document` property. This is too restrictive as the page provider may have other parameter values that don't depend on the current document. So if you have:

      _computeParams: function(document) {
          return document ? { 'ecm_parentId': document.uid, 'someParam': myCustomParam } : {};
      }
      

      There's no guarantee `myCustomParam` has a value since the function only runs when the `document` property changes.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour
                  1h