Uploaded image for project: 'Kuali Rice Development'
  1. Kuali Rice Development
  2. KULRICE-7068

Add option to specify the loading message on action field

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 2.2.0-m4, 2.2
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Rice Module:
      KRAD
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required

      Description

      Currently when the page or component is loading a message of 'loading' or 'saving' is displayed which is hard coded into the script. It was requested an option to specify this message by added to the action field. The message would then get picked up based on what action was selected.

      property: loadingMessage

        Attachments

          Issue Links

            Activity

            Hide
            mztaylor Martin Taylor (Inactive) added a comment -

            source to review/update:

            • krad.message.js
            Show
            mztaylor Martin Taylor (Inactive) added a comment - source to review/update: krad.message.js
            Hide
            mztaylor Martin Taylor (Inactive) added a comment -

            Todo:

            • looking for an example of action button cases (currently see a number of page or collection update blockUI calls)
            • figure out if current loading message can be reused
            • review blockUI/unblockUI to make sure the action and the resulting page is display/accessible
            • test in portal/non-portal situation (current logic deals with portal/window:self/window:top cases)

            Notes:
            krad.message.js

            • add function - getDefaultLoadingMessageText to handle loading/saving logic;
            • change createLoading to include variable loadingMessageText
            • created overloaded createLoading(showLoading) to return createLoading(showLoading, getDefaultLoadingMessageText())
              Action.java:
            • add loadingMessage (/loadingMessageText? - do we need to formatting options?)
            • determine where between Action and the message.js to connect the two
            Show
            mztaylor Martin Taylor (Inactive) added a comment - Todo: looking for an example of action button cases (currently see a number of page or collection update blockUI calls) figure out if current loading message can be reused review blockUI/unblockUI to make sure the action and the resulting page is display/accessible test in portal/non-portal situation (current logic deals with portal/window:self/window:top cases) Notes: krad.message.js add function - getDefaultLoadingMessageText to handle loading/saving logic; change createLoading to include variable loadingMessageText created overloaded createLoading(showLoading) to return createLoading(showLoading, getDefaultLoadingMessageText()) Action.java: add loadingMessage (/loadingMessageText? - do we need to formatting options?) determine where between Action and the message.js to connect the two
            Hide
            jkneal Jerry Neal (Inactive) added a comment -

            Hey Martin,

            Here are some thoughts I had that might be helpful:

            1) Currently the createLoading is setup for Ajax calls in krad.initialize.js as the default ajax setup. I would propose taking this out here and instead adding it to the beforeSend in krad.ajax.js ajaxSubmitForm (here we can get the context of the button clicked).
            2) A side cleanup, I think it would be better to create a removeLoading or something that does the unblockUi, instead of having the boolean parameter to createLoading.
            3) Add the loadingMessageText property to Action. In performFinalize of Action, if loadingMessageText was set (not empty) add it as a data attribute for the action component (dataAttributes.put("loadingMsg", loadingMessageText).
            4) In ajaxSubmitForm (and other methods if needed), get the jquery object the event was triggered on with $(this), then get the loadingMsg from the data: $(this).getData("loadingMsg"). We can then use the returned string to pass to createLoading. I am not exactly sure $(this) will be exposed here from the onclick. If not, we might have to build out our calls to the JS method (done in Action#performFinalize) to pass the id of the button then we can use a selector in ajaxSubmitForm.

            Things are kind of messy with the ajax and action stuff now. I have an m2 item to work on cleaning it up. I think we will be ok to not have formatting options for the loading message on Action. They should be able to do what they need to through the plugin (once we add a widget class and stick on the view for the other Jira work).

            Jerry

            Show
            jkneal Jerry Neal (Inactive) added a comment - Hey Martin, Here are some thoughts I had that might be helpful: 1) Currently the createLoading is setup for Ajax calls in krad.initialize.js as the default ajax setup. I would propose taking this out here and instead adding it to the beforeSend in krad.ajax.js ajaxSubmitForm (here we can get the context of the button clicked). 2) A side cleanup, I think it would be better to create a removeLoading or something that does the unblockUi, instead of having the boolean parameter to createLoading. 3) Add the loadingMessageText property to Action. In performFinalize of Action, if loadingMessageText was set (not empty) add it as a data attribute for the action component (dataAttributes.put("loadingMsg", loadingMessageText). 4) In ajaxSubmitForm (and other methods if needed), get the jquery object the event was triggered on with $(this), then get the loadingMsg from the data: $(this).getData("loadingMsg"). We can then use the returned string to pass to createLoading. I am not exactly sure $(this) will be exposed here from the onclick. If not, we might have to build out our calls to the JS method (done in Action#performFinalize) to pass the id of the button then we can use a selector in ajaxSubmitForm. Things are kind of messy with the ajax and action stuff now. I have an m2 item to work on cleaning it up. I think we will be ok to not have formatting options for the loading message on Action. They should be able to do what they need to through the plugin (once we add a widget class and stick on the view for the other Jira work). Jerry
            Hide
            mztaylor Martin Taylor (Inactive) added a comment -

            Note:
            related to 7054

            • Create a widget object for BlockUI similar to Growl
            • Create widget for the page/component
            • (create default loading message text]
            • review blockUI styling in css, user may be able to control themselves
            • note: no style classes for widget
            Show
            mztaylor Martin Taylor (Inactive) added a comment - Note: related to 7054 Create a widget object for BlockUI similar to Growl Create widget for the page/component (create default loading message text] review blockUI styling in css, user may be able to control themselves note: no style classes for widget
            Hide
            jkneal Jerry Neal (Inactive) added a comment -

            Assigning back to Martin and we will work to finish up

            Show
            jkneal Jerry Neal (Inactive) added a comment - Assigning back to Martin and we will work to finish up

              People

              • Assignee:
                mztaylor Martin Taylor (Inactive)
                Reporter:
                jkneal Jerry Neal (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: