Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Enable Apply button only when Form is Dirty

  1. #11
    Join Date
    Aug 2004
    Location
    Northridge, CA
    Posts
    151

    Default

    Thanks snpe. NOw I see what you are saying. But I think there should be support for formDirty in composite dialog page context. I don't think my requirements are somewhat special.

    But I don't get a response Keith or Ollie then I will try to cook up something along the lines of your code.

    Thanks again!

    Amad

  2. #12
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    Take a look at AbstractForm. That's most likely where we will add this behaivior at some point. Notice the "getCommitCommand()" action, which encapsulates production of controls that apply a commit action to the formodel - e.g an apply button. It would be straightforward to have this command calculate its enabled state based on the dirty state of the form model. Is there a JIRA issue for this? It's a very good enhancement.
    Keith Donald
    Core Spring Development Team

  3. #13
    Join Date
    Aug 2004
    Location
    Northridge, CA
    Posts
    151

    Default

    Keith,

    I have lookek getCommitCommand() and tried to enable/disable it. Since I hae 3 forms in a TabbedDilalogPage and another control similar to TabbedApplicationDialog, which I call TabbedApplicationPanel, which has the button bar. And currently following TabbedApplicationDialog, it is enabled/dislabed on PageComplete porperty of DialogPage. I don't see how dialogPage gets information about each of its page's form?

    But I will log this issue to JIRA along with another issue that I had mentioned here regarding dependent properties.

    Amad

  4. #14
    Join Date
    Dec 2004
    Posts
    15

    Default Re: Enable Apply button only when Form is Dirty

    reload AbstractForm.setEnabled(boolean);

    like:
    Code:
    	public void setEnabled(boolean enabled) {
    		super.setEnabled(enabled);
    		helpBotton.setEnabled(!enabled);
    	}

Similar Threads

  1. Replies: 8
    Last Post: Oct 30th, 2012, 11:33 AM
  2. Replies: 3
    Last Post: Jun 8th, 2010, 03:27 AM
  3. Replies: 9
    Last Post: May 4th, 2006, 09:53 AM
  4. Replies: 1
    Last Post: Sep 22nd, 2005, 04:08 PM
  5. Replies: 4
    Last Post: Apr 15th, 2005, 05:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •