Calling the refresh event of a portlet

Hi
Can I call the refresh event of a portlet in another page when I refresh the
current page?
Any thoughts?
Raghu

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class WindowClosingTest extends JFrame {
     public WindowClosingTest() {
          try {
               setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
               JButton button = new JButton("Close");
               button.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent ae) { performClose(); }
               addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent we) { performClose(); }
               getContentPane().add(button);
               pack();
               setLocationRelativeTo(null);
               setVisible(true);
          } catch (Exception e) { e.printStackTrace(); }
     private void performClose() {
          int n = JOptionPane.showConfirmDialog(null, "Close?", "Confirm", JOptionPane.YES_NO_OPTION);
          if (n != 1) { System.exit(0); }
     public static void main(String[] args) { new WindowClosingTest(); }
}

Similar Messages

  • Calling User Preference event from within portlet

    Not sure if anybody else has looked at this but we are in the process of rolling out a new G6 Portal and on a number of portlets want to take advantage of the ability to turn off the portlet header. However in doing so you loose access to the inbuilt support for providing access to the User Preference, if one has been defined as part of the portlet definition. This is relevant on a number of portelts that we want to migrate to the new G6 portal.
    So rather than try and re-invent this from scratch using a different 'link' in the portlet itself we were wondering if you can 'call' the inbuilt user preference functionality from within the portlet code. i.e. When a user clicks on the link within the portlet it performs exactly the same action and interaction within the portal as if they clicked on the User Preference icon in the portlet header.
    We have had a look around to see if this is possible but not come up with anything yet so thought we would seek comments from this forum.
    Many thanks in advance,
    Ross Ellard
    Devonport Management Ltd

    Hey Ross,
    I just realized I have to do the same thing on a very limited scale (3-5 portlets).
    SO I just wrote a little bit of (shoddy) code to show community preferences based on group membership.
    It works for me, but I get the feeling your looking for something like communityactionsdata geared toward portlets, which unfortunately I dont think exists. If you put it in as an enhancement request then support will contact you to discuss your options.
    Here is the code that I'm using for now:
    <pt:standard.choose>
    <pt:standard.when pt:test="stringToACLGroup('group=1,755,760;').isMember($currentuser)">
    <immg border="0" src="htttp://localhost/imageserver/plumtree/portal/public/img/action_portlet_edit.gif">
    </pt:standard.when>
    </pt:standard.choose>
    The only problem is that the preferences submit button refreshes the popup to the portal. So I might need to tweak that a hair so it just closes the popup.
    edited to prevent the forum from trying to use the code I provided
    Message was edited by:
    geoffgarcia

  • Which macros does BEx Analyzer use? How to call the refresh macro?

    Hi everybody,
    I would like to get an overview about which macros the BEx Analyzer uses, espacially the macro which is responsible for refreshing the workbook. I want to know what BEX Analyzer is doing when I open the variable screen, I assume there is an SAP macro that opens the variable screen?? I tried to look in the online help at help.sap.com but couldn't find a list of macros.
    The idea behind this is, that I have a BEx workbook with 5 queries in it. A colleague now wnats to write a VBA code that calls the variable screen, enters  company 1, period and year, runs the workbook and saves it. Then opens the variable screen again, enters company 2, period year, etc etc etc......
    What my colleague needs to know is which macro he has to call for the workbook refresh / variable screen in order to make his VBA coding.
    Many thanks in advance!!
    Michael

    Which version of Bex are you using ? Bex 3.5 or Bex 7 ? This will significantly affect the answer.
    For Bex 3.5, here is some useful information;
    http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a55f9e09411d2acb90000e829fbfe/frameset.htm
    Edited by: Charlie Belt on Jun 7, 2011 9:12 AM

  • Call the button click event programmically

    I have customised the billing.aspx page.  I now need to programmically call the click event of the continue image button to continue to the next page.  I can't fire the click event.  Does any one know the click event name of the continue button?
    I've tried using this line to call the event
    this.btnNext_Click(this, new EventArgs());
    or
    this.btnNext_Clicked(this, new EventArgs());

    Thomas,
    You could also just click the button client-side with javascript:
    function clickTheButton(theButton){
        fireAnEvent(theButton,'click','MouseEvents');
    function fireAnEvent(theControl, evtName, theModule){
        if(document.createEvent){
            var evObj = document.createEvent(theModule);
            evObj.initEvent(evtName,true,true);
            theControl.dispatchEvent(evObj);
        else if(document.createEventObject) {
            theControl.fireEvent('on' + evtName);
    Cheers,
    Corbin

  • How to call a struts application in a portlet

    How to call a struts application in a portlet. I have two different ear's. In one ear I have my struts application and in one war i have a struts portlet. In the struts portlet provider.xml defaultAction tag can i call the action class .do which in other ear (ie my struts application ear).Can anyone suggest me whether this is the right way or else can u suggest me with some other thing.
    Waiting for ur responses.
    Thanks and Regards,
    Dhanu.

    Hi Dhanu,
    Your Struts Portlet will not be avialble via a URL as it is completely dependent on Oracle Portal Environment. The Provider for the Portlet is alone available via a URL - you would have registered your Portlet using the URL of the Provider.
    Your Struts application, which does not rely on the Oracle Portal Environment, is defeitely accessible from a URL. It's just another web application that uses the popular Struts Framework.
    Hence, you can use the URL ( the starting point - a JSP, Servlet, etc. ) of your Struts Application to "call" the application in your Struts Portlet. I don't think you need to fiddle with the parameters in Provider.xml.
    Moreover, <defaultAction> in Provider.xml should have the URL of a Struts Action Class - the mapping in the
    struts-config.xml should map the .do action to the right JSP file.
    You can have a look at Metalink Note : 331069.1 for a good insight into the <defaultAction> Tag.
    Regards,
    Sandeep

  • Can not trigger the null event!

    Page newPage = new Page("ListAffirmSubmit_Java");
    EventResult result = new EventResult(newPage);
    return result;
    This way can not trigger the null event in the 'newPage'.I want to call the null event to init the viewobject in the 'newPage'.
    Can you tell me the reason or another way to init it?

    I have found a way from the help on line:
    Page nextPage = new Page("ListAffirmSubmit_Java");
    Page redirectPage = RedirectUtils.getRedirectPage(context, nextPage);
    return new EventResult(redirectPage);

  • Does the null event work in 9.0.5?

    <handlers>
    <event name="null">
    </event>
    </handlers>I have a null event and am calling a onNull event in the dataAction. The framework doesn't seem to call the onNull event.
    Thanks in advance.

    There is conceptually no 'null' event. The 'null' event handler is a special handler that is called when no events are triggered on a page (ie: no event signal is encoded on the URL of the page). Hence I dont think you can handle this in your dataAction.

  • Dynamically call htmlb button event

    Hi
    Does anybody know how to dynamically call the onClick event of an htmlb button?
    for regular html, you use <buttonID>.fireEvent("onClick")
    thanks in advance
    Anton Kruse

    Hi,
    Use both onClientClick to call the client event an use onClick to execute the server event.onClientClick is executed with first priority and then the onClink event is fired in the server.
    e.g :
    <hbj:button
              id="Send_Button"
              text="Send"
              tooltip="Sends my name"
              jsObjectNeeded="true" onClientClick="validate();"
              onClick="onSendButtonClicked"
              width="100"
              design="EMPHASIZED">
    First the validate javascript method executes then the onClick "onSendButtonClicked()" method in the controller executes.
    If helps reward with points.
    Regards
    Ritu
    Thanks

  • What r the main events called in an alv report.............

    what r the mandatory events called in an alv grid report ................pls lemme know
    Message was edited by:
            'GURU'

    Hi
    there are no mandatory events by default
    chk this prog
    Hi
    chk this sample programs
    report zkiran .
    Global ALV Data Declarations
    type-pools: slis.
    Internal Tables
    data: begin of ialv occurs 0,
    test1(10) type c,
    test2(10) type c,
    end of ialv.
    data: fieldcat type slis_t_fieldcat_alv.
    start-of-selection.
    perform get_data.
    perform call_alv.
    Form GET_DATA
    form get_data.
    ialv-test1 = 'ABC'.
    ialv-test2 = 'DEF'.
    append ialv.
    ialv-test1 = 'GHI'.
    ialv-test2 = 'JKL'.
    append ialv.
    ialv-test1 = '123'.
    ialv-test2 = '456'.
    append ialv.
    endform. "GET_DATA
    CALL_ALV
    form call_alv.
    perform build_field_catalog.
    Call ABAP List Viewer (ALV)
    call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
    it_fieldcat = fieldcat
    tables
    t_outtab = ialv.
    endform. "CALL_ALV
    BUILD_FIELD_CATALOG
    form build_field_catalog.
    clear: fieldcat. refresh: fieldcat.
    data: tmp_fc type slis_fieldcat_alv.
    tmp_fc-reptext_ddic = 'Test1'.
    tmp_fc-fieldname = 'TEST1'.
    tmp_fc-tabname = 'IALV'.
    tmp_fc-outputlen = '10'.
    append tmp_fc to fieldcat.
    tmp_fc-reptext_ddic = 'Test2'.
    tmp_fc-fieldname = 'TEST2'.
    tmp_fc-tabname = 'IALV'.
    tmp_fc-outputlen = '10'.
    append tmp_fc to fieldcat.
    endform. "BUILD_FIELD_CATALOG
    reward points to all helpful answers
    kiran.M

  • How to refresh the Expired Login Form on the onChange event of the password

    Hi,
    In the Expired Login Form I have places a custom label. My requirement is that on the onchange event of the password field the label color should change to orange if the entered password meets the password policy else red.
    I am trying the following code :
    Custom label:
    <Field name='Custom Label'>
    <Display class='Label'>
    <Property name='value' value='Custom label 1'/>
    <Property name='noNewRow'>
    <Boolean>true</Boolean>
    </Property>
    <Property name='color'>
    <block>
    <cond>
    <isTrue>
    <invoke name='checkStringQualityPolicy' class='com.waveset.ui.FormUtil'>
    <rule name='EndUserRuleLibrary:getCallerSession'/>
    <s>Default Password Policy</s>
    <invoke name='decryptToString'>
    <ref>resourceAccounts.password</ref>
    </invoke>
    <map/>
    <list/>
    <s>Configurator</s>
    </invoke>
    </isTrue>
    <s>orange</s>
    <s>red</s>
    </cond>
    </block>
    </Property>
    </Display>
    </Field>
    And on the password field i gave following in the onChange event:
    submitCommand(this.form, "Recalculate")
    But the above command is not refreshing the page. Instead on the onChange event its going back to the login.jsp.
    Any idea how to resolve the above issue.
    Thanks.

    I got it working as below but i dont know is this best practices?
    <%
        if(session.getAttribute("afterSet") != null){
             %>
        <div style="visibility:hidden">
          <iframe NAME="iframe1" src="/WebApplication2/TestController?fileDownload=test.pdf" WIDTH="40" HEIGHT="40"></iframe>
        </div>
        <%}       basically first time user visit the jsp page session attribute "afterSet" will be null so it wont create the hidden iframe tag . after it dispatched to the servlet controller and successfully processing the record it will set "afterSet" properties to some value and dispatch to itself
    after that it will popup/dialog box for user to save the pdf.
    this way the page already refreshes itself and wont have problem double clicking thing and so on

  • How to call servlet in action of the Form in jsr 286 portlet

    HI,
    We are using Portlet producer application to create JSR 286 Portle. In the View.jsp of a portlet we need to call a servlet by mention it in the action of the form. WHen I run the only view.jsp page , on form submission the servlet gets called.
    But when i consume the portlet in the portal application and click on submit of the portlet  , the doDispatch method of the portlet class gets called again and not the servlet doPost.
    PLease let me know what can be done in this case.

    hi all,
    can anyone please answer the Query ???

  • How to call  a javascript method after the PPR event has finished  ?

    Hi!
    How can we make a javascript method get called after the processing of ADF PPR event?
    My specific use case is,
    I want to call a javascript function after the data in the table is loaded...
    In 10g, that is not a problem, as the data used to get loaded directly during onLoad, and so i would call my js function on load;
    but in 11g , the table data is being loaded through PPR which is initiated onload, and so i needed to call my function after the PPR Response processing has been done; for which I need the name of the event triggered at that instance.
    Is it possible to do this?
    Regards,
    Samba

    Hey, I got it.
    I handled the ADF Controller's PREPARE_RENDER_ID phase of the lifecycle, and then called the
    script to get Executed.
    The code :
        public void afterPhase(PagePhaseEvent pagePhaseEvent) {
            FacesPageLifecycleContext ctx = (FacesPageLifecycleContext)pagePhaseEvent.getLifecycleContext();
                 if (pagePhaseEvent.getPhaseId() == Lifecycle.PREPARE_RENDER_ID) {
                    if(AdfFacesContext.getCurrentInstance().isPostback() )
                        afterRender();
        }is written in lifecycle listener , and my backing bean extended this listener ,
    and in the afterRender() method I did this :
       public void  afterRender(){
                System.out.println("AFTER RENDER CALLED");
               FacesContext context = FacesContext.getCurrentInstance();
               ExtendedRenderKitService service = (ExtendedRenderKitService)Service.getRenderKitService(context, ExtendedRenderKitService.class);
               service.addScript(context, "translate();");
           }That's it.
    It did work, magnificently.
    Thanks for the idea.
    Regards,
    Samba

  • How to control the call to a data control using portlet parameter

    hi,
    i'm using a web service data control on my portlet application. I'd like to know if there's a way where in the data control will not be called when the portlet is loaded,unless the portlet parameter is specified.
    thanks in advance!
    Rian

    thanks Yannick!
    Here's what I did
    1. Create a web service proxy
    2. Create a java class that will manually call the web service (instantiate the service and port first?)
    - Can I retrieve the portlet parameter in this class?
    3. Create Data Control out of the POJO class
    - Does this mean I have to code setters/getters inside Java class (for the input and output of web service) in order for me to put the fields onto my portlet?
    Given your sample, am i understanding it correctly that once it's converted to a data control, you'll drag the getUserList method onto the page as parameter form?
    ** EDIT***
    it's now working. I have a POJO that will call the service proxy and then I have a Bean that will call the POJO method. I created a Data Control out of the POJO class as well,so I can place elements in my page using drag and drop of POJO's methods/variable.
    thanks a lot for your help
    Rian
    Edited by: rian on Dec 28, 2010 11:24 AM

  • How to call the custom  code in Seeded OA pages when an event Occured.

    Hi,
    I need to call a Oracle Create Task API when User saves the data from Seeded OA Page(Sales OA Page).When User Pressed on the Save button,based on Value he selected in " Sales Methodology" Field ,I need to call Call API.
    How can I achieve it.Is it suggestable to call Custom Code in OA Page.
    Thanks
    Raju.

    hi
    extend the controller
    1.) In PFR method of controller capture the event of save button.
    2.) If the save button event ocurred capture the value of Sales Methodology.
    3.) if select Sales Methodology is required value then call the API using the below method (change it accordingly)
    import java.sql.CallableStatement;
    import java.sql.SQLException;
    import java.sql.Types;
    OADBTransaction txn = getDBTransaction();
    CallableStatement cs =
    txn.createCallableStatement("begin dbms_application_info.set_module(:1, :2);
    end;");
    try
    cs.setString(1, module);
    cs.setString(2, action);
    cs.execute();
    cs.close();
    catch (SQLException sqle)
    try { cs.close } catch (Exception(e) {}
    throw OAException.wrapperException(sqle);
    thanx
    Pratap

  • How to receive the custom event in the listening portlet (No backing file)

    I have couple of portlets (JPF based). Portlet A is firing an event
         public Forward processAction()
              PortletBackingContext context =PortletBackingContext.getPortletBackingContext(this.getRequest());
              String message = "XXXXX";
              context.fireCustomEvent("customevent", message);
              Forward forward = new Forward("success");
              return forward;
    I have configured the Portlet B's eventhandler to listen for the 'customEvent' and invoke the pageFlowAction 'listenForEvent'
         @Jpf.Action(forwards = { @Jpf.Forward(name = "success", path = "test2.jsp") })
         public Forward listenForEvent() {
              Forward forward = new Forward("success");
              return forward;
    Portlet B's method listenForEvent is indeed getting invoked, but is there a way I can retrieve the 'Event' object (as fired by Portlet A) inside the listenForEvent. I could have done this via the Backing file, but for some reasons i cann't use the backing file. Is there a way i can get the CustomEvent and the associated payload in my listening JPF portlet, without a backing file?
    The WLP version is 10.3

    Hello,
    I originally said:
    All you should need to do is to modify the method signature for your event-receiving method. The method signature should be:
    public void listenforEvent(HttpServletRequest request, HttpServletResponse response, Event event)
    where Event is a com.bea.netuix.events.Event object. You can then cast this to a CustomEvent object.
    But I mis-read your earlier post about catching the custom event and invoking a pageflow action. When you do that, you will lose the custom event's payload (your message), and there is no way to retrieve it from your pageflow action.
    The only way you can actually retrieve the event's payload is using a backing file for the portlet, with a method having the signature I mentioned above. You can then set a request attribute with the event's payload and still have it invoke the pageflow action, at which time you could retrieve the request attribute value-- assuming you don't need to run this portlet over WSRP. Over WSRP, the event-handling and pageflow action-invoking lifecycles will happen with independent request objects, so you would need to store the event payload in session to work over WSRP.
    Kevin
    Edited by: kfrender on Aug 31, 2009 3:34 PM

Maybe you are looking for

  • IPhone stopped showing up in itunes

    I recently updated itunes to the newest one and did some software updates on my computer. After doing these my iphone only is showing up as a camera, and does not come up in itunes. I reinstalled itunes but it still does not show up. Does anyone know

  • ACE routed mode design issue

    I am configuring ACE in routing mode , Below is my ACE interface config. interface vlan 28   description "CLIENT VLAN"   ip address 192.168.10.11 255.255.255.248   peer ip address 192.168.10.12 255.255.255.248   mtu 1500   mac-sticky enable   access-

  • How to improve profamance of this

    Hi Gurus, how to increase perfomance of this statement . LOOP AT HEADCOUNT_TABLE.     SELECT COUNT(*) INTO HEADCOUNT_TABLE-ZSEXEMPT       FROM PA0000 INNER JOIN PA0001         ON PA0000PERNR =  PA0001PERNR      WHERE PA0001~KOSTL =  HEADCOUNT_TABLE-K

  • Tethered, Iphone4 6.1.3 restarting by itself REPEATEDLY.

    Hello, i am having trouble with my iphone4. 6.1.3 i jailbroke it, and yes it was tethered. and yes it hasnt been updated to ios7 cause it has been messed up since before ios7 came out....I was listening to music one day and my phone froze and then i

  • After loading iTunes I can not access my iCloud especially I have reset my password and iCloud not recognize it

    After signing the agreement had to sign up with iTunes , I can not get access to my iCloud and find my phone. I had to reset my password on Apple.com and it's working but iCloud not recognize my new password. Also could not share my pictures in the i