Announcement

Collapse
No announcement yet.

Can you call blockUI from within the postBackProc?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can you call blockUI from within the postBackProc?

    I'm trying to call BlockUi from within postBackProc before I call a long running process. I have tried this:
    Code:
    this.pageCommands.Add("executefunction", "$.blockUI({ message: '<h2><img src=\"/images/" + hspi.IFACE_NAME + "/spinner.gif\" /> Deleting Occupancy Devices...</h2>' });");
    Unfortunately it doesn't execute until after the postBackProc has completed and my long running process is complete.

  • #2
    Hi,

    I have been having this issue as well.. Solved by calling blockUI as a "functionToCallOnClick" from the jQuery = object..

    Code:
              clsJQuery.jqDropList Foo = new clsJQuery.jqDropList(.....);
              Foo.functionToCallOnClick = Util.JsFuncStr_BlockUi();
    
    
             static internal string JsFuncStr_BlockUi()
            {
                return 
                    "$.blockUI({ css: { " +
                    "border: 'none', " +
                    "padding: '15px', " +
                    "backgroundColor: '#000', " +
                    "'-webkit-border-radius': '10px', " +
                    "'-moz-border-radius': '10px', " +
                    "opacity: .5, " +
                    "color: '#fff' } })";
            }

    Comment


    • #3
      I do something similar to what you are doing when I don't need an intervening confirmation dialog.
      Code:
      btnHT.functionToCallOnClick = "$.blockUI({ message: '<h2><img src=\"/images/" + hspi.IFACE_NAME + "/spinner.gif\" /> Changing Thermostat Heat Temperature Ranges...</h2>' });";
      The problem arose when I had the control open a confirmation dialog. There was no functionToCallOnClick. I was able to work around it after I found a useBlockUI parameter included with the AddDialog call.
      Code:
      Public Shared Function AddDialog(ByVal p_id As String, ByVal p_class As String, ByVal p_selected_index As Integer, ByVal p_add_submit_cancel As Boolean, ByVal p_page As String, ByVal p_form_post_id As String, ByVal p_title As String, p_submit_button_label As String,
                  //Optional x As Integer = -1, Optional y As Integer = -1, Optional modal As Boolean = False, Optional submit_on_cancel As Boolean = False, Optional useBlockUI As Boolean = False) As String
      This causes a "Please Wait" dialog to display while the work is being done.

      Comment

      Working...
      X