Events in AbstractPortalComponent

Hi,
My AbstractPortalComponent dynamically builds a Form component with a collection of InputFields, RadioButtons and a Button for submit.
I can handle the "submit" event just fine, but what I would like to do is retrieve an array of components (all input fields and radio buttons attached to the form).  The reason is that my component ids are generated dynamically, but with a specific naming convention.  I was trying to avoid having to persist the component id names.
I have tried using getComponents from IPageContext and Form.iterator, but my array is empty. 
Does anyone know if this is possible or do I just need to accept having to persist the component ids?
Thanks in advance for any advice.
Regards,
Ann

Hi Umair,
I finally figured it out.  I found a method that produced exactly what I needed.
Below is a snipet of code that will list ids of the components associated with a form.  For my case, it listed my radio buttons, input fields and button.  I did not "id" my text views, so I am not sure if it will list those.
Iterator nameList = context.getOldForm().getRegisteredElementNames();
if (nameList == null)
   response.write("Name List is null<br>");
else
   while (nameList.hasNext())
     String name = nameList.next().toString();
     response.write("<br>Element Name:" + name);
Thanks for your reply though!
Ann

Similar Messages

  • HTMLB events in AbstractPortalComponent

    Hello,
    I have a portal component that inherits from AbstractPortalComponent. I'd like to use HTMLB and its controls (tableView for example) to display the data in the portal. But how do I have to do the event handling for the HTMLB controls? Usually one would say:
    <hbj:tableView onNavigate="onNavigate" ... />
    But how do I have to handle this event in my class that inherits from AbstractPortalComponent? Do I have to use the doRequestEvent() method? If so, what's the name of the event? Or do I have to implement a onNavigate() method - as if I would use a JSPDynPage?
    Or is it not possible to use HTMLB controls and a AbstractPortalComponent together?
    Kind regards, Lars

    hi,
       Try this.
    IPageContext context = PageContextFactory.createPageContext(request, response);
    // get the event
        Event event = context.getCurrentEvent();
    if (event.getAction().equalsIgnoreCase("onNavigate")) {
    //write your event handling method
    Regards,
    Srinath

  • Handling form submmit in AbstractPortalComponent?

    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 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.

  • Communication between jsp and abstractportalcomponent

    Hello All
    Communication between jsp and abstractPortalComponent.
    jsp contains one input text field and one submit button.
    when the user clicks on submit button it will call the component and that input value will
    display in same jsp page.
    how this communication will happen?
    Rgrds
    Sri

    Hi Srikanth,
    In the JAVA File, 
    OnSubmit Event,
    String inputvalue ;
    InputField myInputField = (InputField) getComponentByName("Input_Field_ID");
    if (myInputField != null) {
                   inputvalue = myInputField.getValueAsDataType().toString();
    request.putValue("textvalue", inputvalue);
    request is IPORTALCOMPONENTREQUEST Object.
    In JSP File,   to retreive the value,
    <%
    String  textstring = (String) ComponentRequest.getValue("textvalue");
    %>
    In PORTALAPP.XML File,
    <component name="component name">
          <component-config>
            <property name="ClassName" value="classname"/>
            <property name="SafetyLevel" value="no_safety"/>
          </component-config>
          <component-profile>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
          </component-profile>
        </component>
    Using the code above, You can pass and read values between abstract portal component and Jsp Page.
    Instead of this, I suggest you to use JSPDYNPAGE Component for Data Exchange.
    Check the [Link|http://help.sap.com/saphelp_nw2004s/helpdata/de/ce/e0a341354ca309e10000000a155106/frameset.htm].
    Hope this helps you.
    Regards,
    Eben Joyson

  • Calling a method in AbstractPortalComponent from JSP without htmlb

    Hi,
    I am trying to trigger an event in a java method in an AbstractPortalComponent from a jsp.
    The event is caught in method doContent:
    IPageContext myContext = PageContextFactory.createPageContext(request, response);
    Event lastEvent = myContext.getCurrentEvent();
    if ((lastEvent != null) && (lastEvent.getComponentName().equals("Compute"))) {
      response.write("Compute");
    The problem is that I cannot trigger it from my jsp. In the jsp is used:
    <%
    IPortalComponentURI uri = componentRequest.createPortalComponentURI();
    uri.setPortalRequestEvent(componentRequest.createRequestEvent("Compute"));
    String linkEvent = uri.toString();
    %>
    and
    <.a href="<%=linkEvent%>">click</a.>     
    (i put some dots because otherwise the editor sees it as html)
    Please help.
    Raymond

    Hi Praveen,
    It still does not work. presentEvent is null.
    In line: if (null != event && "Compute".equalsIgnoreCase(presentEvent.getAction())) you wrote "event" Shouldn't that be presentEvent. I changed it to presentEvent.
    I think the problem is in the jsp. It seems to me that the jsp is not sending a correct event.
    Please keep in mind that I am not using htmlb in my jsp.
    Raymond

  • Event Handling in portal application

    Hi friends,
      In portal application i have defined two methods called "docontent" and "docompute".here iam giving the code.
    package com.seal;
    import com.sapportals.portal.prt.component.*;
    public class abstract1 extends AbstractPortalComponent
    public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
    response.setContentType(PortalComponentContentType.HTML);
    IPortalComponentURI uri = equest.createPortalComponentURI);
    uri.setPortalRequestEventrequest.createRequestEven"compute"));response.write("<form action=\"" + uri.toString() +
    "\" method=\"post\">" + "<table>" + "<tr><td>" + "Enter your name" + "</td>" +"<td>" + "<input type=\"text\" me=\"expression\" value=\"" +name + "\">" + "</td></tr>" + "<tr><td></td><td>" +     "<input type=\"submit\" value = \"Tell" + "\">" +"</td></tr>" + "</table>" + "</form>");
    public void doCompute(IPortalComponentRequest request, IPortalRequestEvent event)
    System.out.println("doCompute");
    try {
    name = event.getData().getAttribute("expression");
    state = WELCOME_STATE;
    } catch (NullPointerException npe) {
    For the doCompute method am getting the following the
    error: no other errors am getting xcept this.   
    IportalRequestEvent cannt be resolved(or is not valid type) for the argument of the method docompute.
    Can anybody please help me how to solve it.
    Thanks and regards
    sireesha

    hi sireesha,
    glad to know that I have been of some help to you .
    When you do source->Organise Imports the NWDS automatically calls all the imports that are necessary for your code provided that these import packages are on your build path . Hope this answers your question.

  • Event Handling in Abstract Portal Component

    Hi Friends,
    I am using HTMLB Classlib in an Abstract Portal Component to develop a Dropdownlistbox. Now I want to handle the event of change of selection in this dropdown. However, this event is not getting captured. Sample code is as follows:
    public class dropdownsimple extends AbstractPortalComponent
                           public void onClick(Event event)
                           public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
                                                    IPageContext myContext1 = PageContextFactory.createPageContext(request, response);
              Form myForm = myContext1.createFormDocument("CRMForm");
              GridLayout myGrid = new GridLayout();
              DropdownListBox drp = new DropdownListBox("drp");
              drp.addItem("Key 1","Item 1");
              drp.addItem("Key 2","Item 2");
              drp.setOnSelect("onClick");
                                                     myGrid.addComponent(1, 1, drp);
              myForm.addComponent(myGrid);
              myContext1.render();
    I am able to see the dropdown box along with values when I preview the PAR iView created from this component. Please let me know how to capture the event of change of selection in the dropdown?
    Edited by: Shetul Chothani on Jun 21, 2011 6:37 AM

    Hi,
    Change this line
    drp.setOnSelect("onClick");
    to
    drp.setOnSelect("click");
    and leave the line
    public void onClick(Event event)
    as it is, and it should work just fine.
    I.e., if you name your event "fooBar", the event handler should be named "onFooBar"
    Cheers,
    Robin

  • How to trigger navigation to a portal iView from server side event handler

    Hi,
    I am modifying the workset map application. I have created custom URL links under each iView which should navigate to different iViews depending on some business logic. So I had to provide a custom event handler for these iVIew links and the path to the next iview is dynamically created by the code in the event handler. Once the new PCD path is generated, the event handler should trigger a navigation to that PCD object. Which APIs can I use to trigger this navigation from the server side event handler? I have done this before in webdynpro where we used WDPortalNavigation (.absoluteNavigation or .relativeNavigation). Is there something similar that i can use in this case (i.e. when developing a simple Portal Application from an AbstractPortalComponent)?

    Hi,
    On my understanding of your requirement.
    the best solution what i think is use Object Based Navigation(OBN).
    Is much suitable to your requirement.
    Moreover you can use
    1.Relative navigation
    2.Absolute navigation.
    In the same way how you used in web dynpro.
    Same thing can be done in abstract portal component also.
    Try using that.
    Thanks & Regards,
    Lokesh
    Edited by: lokesh kamana on Aug 11, 2008 7:23 AM

  • Calling a Function in a AbstractPortalComponent Class from a JSP

    Hello,
    i got a class witch extends AbstractPortalComponent. In this class I call in the function doContent this
    response.include(request, request.getResource(IResource.JSP, "pagelet/TestComponent.jsp"));
    now i want to define another function in this class.
    This function should be called from the JSP. For Example when a Button is pressed. I know I can do this with a JSPDynPage but i need it this way.
    How can i realise this?
    Thanks for your replies.
    Greetings
    Christoph

    Never mind - I was doing something very stupid and wasn't
    calling the function as a method of a movie clip. I was simply
    calling checkTarget(event) rather than
    event.currentTarget.checkTarget(event); which seems to work.

  • VC eventing error

    Hello All,
    I have created a model in Visual Composer with two BI queries using eventing.  The first query works fine, but when i click on the a row in order to populate the second query i get the following error:
    Cannot execute BW query:Nested Exception. Failure to execute native function. Nested Exception. NO_AUTHORITY:Nested Exception. Failure to execute native function. Nested Exception. NO_AUTHORITY
    [EXCEPTION]
    com.sap.portal.guimachine.bikit.util.BIKitException: Cannot execute BW query:Nested Exception. Failure to execute native function. Nested Exception. NO_AUTHORITY:Nested Exception. Failure to execute native function. Nested Exception. NO_AUTHORITY
         at com.sap.portal.guimachine.bikit.designtime.bw.BWResultsetProcessor$ExecuteHandler.execute(BWResultsetProcessor.java:363)
         at com.sap.portal.guimachine.bikit.designtime.BIConnectionDiscover.dispatchRequest(BIConnectionDiscover.java:319)
         at com.sap.portal.guimachine.bikit.designtime.BIConnectionDiscover.doContent(BIConnectionDiscover.java:240)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
         at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)
         at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:645)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
         at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)
         at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)
         at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:522)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:405)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:160)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    I do not belive it to be an authorisation issue on the BI side as I have BI_ALL.
    Any other ideas?
    Cheers,
    Nick.

    Maybe this link give some more information about the settings:
    <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/f8/ba7eb84fc142b8af781a5fec180bfd/content.htm">SAP Help</a>

  • Subscribe to Portal Events

    Hi
       Im tryng to make a AbstractPortalComponent subscribe to a Client-side Portal event raised by EPCM. I know this is possible using javascript code as EPCM.subscribevent but i need to run some Java Logic when the event happens.
       Basicly i want every Portal Navigation ( EPCM.Navigate Event) to raise a eventhandler on my portal component/service that will validate if i have to pass aditional parameters to the navigation node). This parameters are based on an array of correspondencies Navigation_Node_Path / Parameters in Java.  The Parameters are generated used a number of portal services methods like navigation helperservice etc.
    Thanks in advance

    Hi Jason,
    EPCM.raiseEvent('urn:com.sapportals:framework','CollapseNavPanel', "");
    EPCM.raiseEvent('urn:com.sapportals:framework','ExpandNavPanel', "");
    Best regards, Maksim Rashchynski.

  • Training and Event Management - report on list of cancelled courses

    Hi All,
    Is there any standard report available to get the list of cancelled courses (be it business event grp , type or business event) Would appreciate your inputs on this.
    Kind regards
    Sathya

    S_AHR_61016216 - Cancellations per Attendee , i think there is no standard report for cencelation of business events, type and group.
    for cancellations per attendee reports is available in the system.
    good luck
    Devi

  • How can I see Calendar event END times at a glance?

    How can I display my Calendar event titles exactly as I type them? I do not want Calendar to remove duration from the titles of my events. Otherwise I can't see event END times at a glance in month view; only start times. How can I "trick" Calendar to just show my titles as I type them - as I always could before I upgraded. I used to be able to enter "Seminar 9am-5:45" and it would appear that way regardless of how or what I chose to enter (or not enter) for duration.
    I am running OSX 10.9.3.

    It's a bit weird, but if you type in the time info TWICE into the event title then Calendar uses/deletes one of them to populate the event details and leaves the other.
    Apple - Mac OS X - Feedback

  • Event List view in iCal?

    I would love to have an Event List view in iCal like I do on the calendar on my iPhone. Is there such a thing? The particular reason for wanting it (this time) is that one of the calendars in the ON MY MAC list has a number in a oval to the right.
    I believe this is trying to tell me that there is a new event that I need to do something about. Problem is, I don't know where to find it.

    ecernek,
    There is no event list option on iCal like the one on the iPhone.
    That number means that you have an event invitation. Use iCal>View>Show Notifications to choose what to do with the notification.

  • Can I show a color bar instead of a color bullet in iCal Monthly view for all my events in all calendars?

    In the Monthly view of iCal the only events that show a color bar in the event is the Birthday Calendar. All other events in all my other calendars only show a color bullet next to the event (unless I click on that event which then shows as a color bar). I would like to know if it is possible for all the calendar events to have a color bar in the monthly view instead of just that tiny color bullet.

    Greetings Judith,
    Before making any attempts at deleting calendar data, backup what you have just in case:
    Click on each calendar on the left hand side of iCal one at a time highlighting it's name and then going to File Export > Export and saving the resulting calendar file to a logical location for safekeeping.
    iCal has an automated function located in iCal > Preferences > Advanced > Delete events "X" days after they have passed.  By typing in a value for days you can tell iCal to delete all events before that time frame.
    Example:
    Today is 4-16-2012.
    If I wanted to delete all events prior to 1 year ago (4-16-2011) I would type in "365" for the number of days.
    Once you type in the number of days you want kept in iCal, close the preferences and then quit iCal.
    Re-open iCal and check to see if the events are gone.  If not you may want to leave it open for several minutes and then quit again.
    Once the events are removed go back to  iCal > Preferences > Advanced > Delete events "X" days after they have passed and make sure the check mark is removed to prevent future deletion.
    Hope that helps.

Maybe you are looking for