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 =
"" 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!
|