Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to attach two submit handlers for one dynamic form?

    SmartClient Version: SC_SNAPSHOT-2011-05-03/LGPL Development Only (built 2011-05-03)

    I have a Change Password dynamic form. I display this form to the user in two different cases:
    case i) Normal. ie., User has option to change password in the displayed menu. If he click change password tab, change password view will be displayed. After submitting the form, password will be changed successfully and redirected to login page immediately.

    case ii)First Time User ie., If user is logging in for the first time, i will display one modal window which contains the same form which was displayed in case i. That means i force the user to change the password.
    But the after submit must be different here. ie.. after successfull submission, i will just close the popup window and shows the main panel.

    As i'm using same form in both cases, i need to register two submit handlers for the same form.

    I have one solution ie., taking two different submit buttons and showing either of them based on the case and providing SubmitValuesHandlers respectively. Here i got one problem. How to identify, whether the form is loaded inside modal window or inside main page?

    But it would be gud if i can find solution with single submit button and change SubmitValuesHandlers dynamically.

    How to de register the first submit handler and register the second one?

    Hope my problem is clear.
    Last edited by skaluva; 13 May 2011, 04:31.
Working...
X