on 06-06-2008 5:22 AM
G'day,
I have a portal component representing a logon page. This component is a subclass of AbstractPortalComponent and displays a form with a "submit" button.
I would like to set a cookie when the form is submitted. I can do this in JavaScript by setting the form's "onClick" attribute, but I would like to handle this programmatically within the AbstractPortalComponent subclass.
I thought I would capture any form submit event with the doRequestEvent() method, but this does not get called. Neither does doComponentEvent() nor handleEvent().
Can anyone provide an example of programmatically handling a form submit in an AbstractPortalComponent?
Hi,
Is your submit botton a HTMLB button? Did you register a event on onClick method of this button?
If so the doRequestEvent method should be called.
Check the Request Flow here:
http://help.sap.com/saphelp_nw70/helpdata/EN/c1/69b8428e05c86ae10000000a155106/frameset.htm
So all the events should also execute doContent method.
Check this, for code that you should use in doContent method to capture the event:
Regards,
Praveen Gudapati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Geoffrey,
To handle the event in AbstractPortalComponent, first step is to create the event that is raised when the user clicks, for example, a button.The portal runtime provides the interface IPortalComponentURI to generate this events:
uri = request.createPortalComponentURI();
uri.setPortalRequestEvent(request.createRequestEvent("EVENTNAME"));
To create an URL that can be used, for example, in a HTML, you have to convert the uri into an url string:
uri.toString();
If the user clicks on the button, the portal runtime will dispatch this event to a method named do<Eventname>. You have to implement this method in your AbstractPortalComponent. The IPortalRequestEvent object cotnains the attributes of the event.
public void doEVENTNAME(IPortalComponentRequest request, IPortalRequestEvent event) {
}
Hope this helps.
Do reward points if found helpful.
Thanks & Regards
Gourav.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.