'Handles Galaxy\'s refresh_on_change for forms without ultimately submitting the form'

def refresh_form(self, control_name, value, form_no=0, form_id=None, form_name=None, **kwd):

    for (i, f) in enumerate(self.showforms()):
        if ((i == form_no) or ((form_id is not None) and (f.id == form_id)) or ((form_name is not None) and (f.name == form_name))):
            break
    formcontrols = self.get_form_controls(f)
    try:
        control = f.find_control(name=control_name)
    except:
        log.debug('\n'.join(formcontrols))
        control = f.find_control(name=control_name, nr=0)
    if ('refresh_on_change' in control.attrs.keys()):
        control.clear()
        tc.fv(f.name, control.name, value)
        control = ClientForm.SubmitControl('SubmitControl', '___refresh_grouping___', {'name': 'refresh_grouping'})
        control.add_to_form(f)
        control.fixup()
        tc.submit('___refresh_grouping___')
