• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Custom SubmitButton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom SubmitButton


  • Subject: Re: Custom SubmitButton
  • From: "Elim PDT" <email@hidden>
  • Date: Fri, 16 Jul 2010 16:36:02 -0600

I found performParentAction or valueForKeyPath can be used to solve the problem.


----- Original Message ----- From: "Chuck Hill" <email@hidden>
To: "Elim PDT" <email@hidden>
Cc: <email@hidden>
Sent: Friday, July 16, 2010 1:16 PM
Subject: Re: Custom SubmitButton



You have to be careful with action methods and re-usable components. Practical WebObjects describes how to do this.


How are you implementing MyReusableComponentWithSubmitButton?


Chuck


On Jul 16, 2010, at 11:21 AM, Elim PDT wrote:

I need to make several reusable components that handle custom bindings themselves to reduce duplicated code.
I found the idea is ok as long as the reusable components not include submitbutton.


Say I have a page called MyPage

MyPage.html
...
<webobject name=MyForm>
<webobject name=MyReusableComponentWithSubmitButton></webobject>
</webobject>
....

MyPage.wod
...
MyForm: WOForm {}
MyReusableComponentWithSubmitButton { action = nextStep; infoDict = ctrlEO.infoDictionary; user = session.sessionUser; }
....


MyPage.java
.....
    public WOComponent nextStep() {
........
        if(dataCheckOK()) {
               return pageWithName("NextStep");
        }
        return null;
    }

When click the submitbutton inside of MyReusableComponentWithSubmitButton, no matter dataCheckOK() returns what, it'll never bring me to the NextStep page.

The reason is that the action is fired in the subcomponent request-response loop, even it triggers MyPage's method nextStep(), it will not alter the page level response generator!

My question is: how to make the submitbutton inside of the subcomponent behavor as if it placed directly at page level?

Thanks for any thoughts!



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

-- Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects









_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Custom SubmitButton (From: "Elim PDT" <email@hidden>)
 >Re: Custom SubmitButton (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: [OT] WOWODC Hotel
  • Next by Date: Javamonitor adds session instead of stopping the instance.
  • Previous by thread: Re: Custom SubmitButton
  • Next by thread: Javamonitor adds session instead of stopping the instance.
  • Index(es):
    • Date
    • Thread