Programmatically close a popup of a bean managed

Hello

in the following blog [http://thepeninsulasedge.com/frank_nimphius/2008/02/14/adf-faces-rc-programmatically-closing-a-popup-from-a-managed-bean/ | http://thepeninsulasedge.com/frank_nimphius/2008/02/14/adf-faces-rc-programmatically-closing-a-popup-from-a-managed-bean/]

the following statement made at the end...

The JavaScript call is published as "window.exitPopup ()", because the script is called from the root of the page. You can easily see how the JavaScript code can be modified to have 'exitPopup' becomes a generic function avoiding coded hard popup ID as in my example.

I don't understand how avoid the popup hard ID could someone please explain that to me.

Thank you
Brahim

Hello

You can modify the JavaScript function to get the popup ID passed as an argument. Then you get the ID of popup in the managed for example by JSF binding and add to the function call.

Frank

Tags: Java

Similar Questions

  • How to close a popup by backing bean?

    How to close a popup by backing bean?
    StringBuilder script = new StringBuilder();
            FacesContext context =  FacesContext.getCurrentInstance();
                      script.append("var popup = AdfPage.PAGE.findComponent('").append().append("'); ")
                            .append("if (popup.isPopupVisible()) { ")
                            .append("popup.hide();}");
                      ExtendedRenderKitService erks =
                        Service.getService(context.getRenderKit(), ExtendedRenderKitService.class);
                        erks.addScript(context, script.toString());
    
  • How can I close a Popup calendar of Adf in my managed bean?

    Hello.

    I use the calendar to the Adf.

    When I call the method to close the pop-up window:

    {} public static void hidePopUp (RichPopup popUp)
    FacesContext facesContext = FacesContext.getCurrentInstance ();
    ExtendedRenderKitService = service
    Service.getRenderKitService (facesContext,
    ExtendedRenderKitService.class);
    String serviceScript = "AdfPage.PAGE.findComponent (" "+ popUp.getClientId (facesContext) +)"
    "(. hide()')";
    service.addScript (facesContext, serviceScript);
    }

    and after calling the method "AdfFacesContext.getCurrentInstance ().addPartialTarget(this.calendar//my ADF Calendar);"the updating of the calendar and my popup not close. "

    If I do not call the method "AdfFacesContext.getCurrentInstance ().addPartialTarget(this.calendar//my ADF Calendar);" my popup close works normally. "

    Can someone help me?

    Thanks

    Hello..
    To hide the popup code tips use also set for popup partialTriggers

    partialTriggers = "componentIdThatCallHideThePopup" the binding = "#{SampleBean.samplePopUp}" > "

    Private RichPopup samplePopUp;
    {} public void setSamplePopUp (RichPopup samplePopUp)
    this.samplePopUp = samplePopUp;
    }
    public RichPopup getSamplePopUp() {}
    Return samplePopUp;
    }

    to close the popUp use. hide() and after that to share partialtrigger for the calendar

    getSamplePopUp () .hide ();
    AdfFacesContext.getCurrentInstance () .addPartialTarget (this.calendar//my ADF calendar); »

    hope it will be useful

  • Close the Popup by clicking on the OK button on the dialog box information Message

    JDev ADF BC 11.1.1.5.0

    I have a popup and a dialog box on the inside where the user enters data and click Save.
    I show an Information message when the click on save on having managed the insertion of data in the database.
    What I want to achieve, it's that I want to close the popup window with the click on the OK button located in the information message dialog box which has proved on memorizing data.
    There is already a similar thread Close popup in adf , but that was not a correct answer.

    (1) linking the main popup to a bean variable:

    
    
    public class MyBean
    {
      private RichPopup myPopup;
      ...
    }
    

    (2) add a DialogListener to the of the informational message:

    
      
        ... Info message here ...
      
    
    

    (3) use this DialogListener to close the main popup programmatically:

      public void infoPopupDialogListener(DialogEvent dialogEvent) {
        myPopup.hide();
    }
    

    Dimitar

  • Don't make a left click or close the popup settings for Flash Player local storage

    New book from Surface, 200% display scaling. cannot left click or close the popup of local storage settings Flash Player (which is not scaled). Make a right click works, but cannot get rid of blocked dialogue. I see people saying Flash dialogues only work with the scaling to screen 100%, but this would make the screen of 3000 x 2000 pretty unusable. Is there a better solution?

    I just ordered a couple for the team the other day.  It took some time for our supplier of equipment start their storage.

    These dialog boxes are problematic for a number of reasons.  I'd love to see them disappear entirely.  In most cases, what you run is our protection fromclickjacking anti - being overzealous.  Flash Player is in an uncomfortable position, where it is difficult to ensure that we are the object of above and that our security dialogue box is not obscured by something malicious that tries to make you click on it.  This is particularly problematic if the dialog box appears on things that move, such as video.  Fixed bugs in the logic of clickjacking is a game of whack-a-mole, so usually set us on a config and finds that he has beaten another combination of factors of density/zoom screen/resolution.

    The best way to deal with the situation is to simply stop the dialog box to display in the first place.  The days when disabling Local Shared Objects in Flash you bought anything in terms of protection personal information are over long - HTML5 provides much more powerful functions to develop behavioral followed resilience.  The best approach in trying to stay private is to use only the browser incognito-private browsing mode.  This tricks Flash into thinking it has access to whatever he wants to write, but it happens in a temporary directory that is destroyed when you exit the private browsing session.

    Since Flash Player think actually that it runs with rein in Incognito mode, without dialog boxes to throw (unless you have set the default privacy preferences in the drive).  Incognito mode is far superior to management of granular controls of the Flash, because it also beats the approaches to monitoring of client - side HTML5 equivalent * and * is not usually degrade the user experience.  We do also some extra stuff to help the hurt to do server side footprints, like turning a very minimal list, sorted by alphabetical order of the policies in Incognito mode.  If you're curious about what can be done exclusively on the coast Server (and want to be depressed), check out https://panopticlick.eff.org/.

    Anyway, for this purpose, you can configure Flash Player to always allow sites to store local shared objects, or you can allow it on a site-by-site basis if it is a site of particular video or something that gives you consistent headaches.

    To do this, go to control panel > Flash Player > storage and choose an option.

    It is also interesting to note that there is a lot of superstition there since the beginning of the 1990s on the 'Flash Cookies' / shared/LSO local objects that holds true anymore.

    When you clear the cache of your browser, we remove our LSO.  The feature was scheduled for things like game save data and caching assets, but some smart marketing people find it useful to backup the data in the cookie of the user store, so that they had followed who survived a user to delete their cookies.  While the unfortunate and embarrassing, we corrected for a long time that, by adopting a behavior that we believe best match user expectations.  Unfortunately, once you get the stench on you, it is difficult to reverse.

    Hope that helps!

  • When you close the popup only proceed

    Hello

    In my fieldChanged(), I ask a pop-up message. The popup has a close button that closes the popup. I don't want the application to perform the work until the context menu does not close. I am not able to do this. The code is:

        public void fieldChanged(Field f, int context) {
            System.out.println("Into ------------ BUTTON CLICKED = " + f + " C0NTEXT = " + context + " btnClicked = " + btnClicked);
            if (f instanceof CheckboxField) {
                CheckboxField cb = (CheckboxField) f;
                // Get details associated with the selected checkbox
                UiApplication.getUiApplication().invokeAndWait(new Runnable() {
                        public void run() {
                            getScreen().getUiEngine().pushScreen(new MessagePopup(mm1));
                            return;
                        }
                    });
                    // Change some data and invalidate
                    if (mm.read == false) {
                        mm.read = true;
                        cb.setCookie(mm);
                        unreadCount -= 1;
                        if (unreadCount < 0)
                            unreadCount = 0;
                        System.out.println("UNREADCOUNT =  " + unreadCount + " ******************* ");
                        inboxBtn.setText("Inbox " + unreadCount);
                        invalidate();
                    }
                    System.out.println("CheckBox Complete");
                 }
            }
    
       // POPUP CLASS
        class MessagePopup extends PopupScreen  implements FieldChangeListener  {
            private BitmapButtonField okBtn;
    
            public MessagePopup(MailMessage mm) {
                super(new VerticalFieldManager(VERTICAL_SCROLL | VERTICAL_SCROLLBAR));
                okBtn = new BitmapButtonField(Bitmap.getBitmapResource("res/cancel_btn.png"));
                okBtn.setChangeListener(this);
                add(new LabelField("Label "));
                add(okBtn);
            }
    
            public void fieldChanged(Field field, int context) {
                if (field == okBtn)
                    this.close();
            } 
    
            protected boolean keyChar(char key, int status, int time) {
                if (Keypad.KEY_ESCAPE == key) {
                    this.close();
                    return true;
                } else
                    return super.keyChar(key, status, time);
            }
        }
    

    The output is: popup appears and I see the following SOP

    CheckboxField Selected * READ = false *.
    UNREADCOUNT = 4 *.

    Complete box

    According to me, when I click on the Ok button in the pop-up window and then 2 lines that is below

    UNREADCOUNT = 4 *.

    Complete box

    must be executed.

    No idea how to work with this scenario. Any help is very appreciated.

    Thank you

    As I understand it, you don't want "if(mm.read == false)" to get executed until the screen closes?

    If this is correct then replace "pushScreen' by 'pushModalScreen '. Block screens mode until the screen is closed. You have not need surgery of invokeAndWait from the modal screen will block the execution anyway.

  • How to close a popup screen pushed as a global screen

    I want to close a popup screen but my application is in background so

    UiApplication.getUiApplication () .popScreen (getScreen ());

    or

    UiApplication.getUiApplication () .getActiveScreen () m:System.NET.Sockets.Socket.close ();

    does not work is not something

    same Ui.getUiEngine () .getActiveScreen () m:System.NET.Sockets.Socket.close () does not work...

    in the popup screen, I have a custoListView (written own filed) there is an item when you click on an event

    listner function is called by there, I have to close popup screen... my class is like that

    SerializableAttribute public class SelectSms extends PopupScreen {}

    private vector _data;

    public boolean onClose() {}
    try {}
    Close();
    Returns true;
    } catch (Exception e) {}
    Returns false;
    }
    }

    public SelectSms() {}
    Super (new VerticalFieldManager(), Field.FIELD_VCENTER);
    _data = null;
    _data = MessageStore.getMessage ();
    last post [] message = Message [_data.size (new)];
    MSGC [] CustomListField = null;
    MSGC = new CustomListField [_data.size ()];
    for (int i = 0; i)<>
    message [i] = (Message) _data.elementAt (i);
    MSGC [i] = new CustomListField (message [i] .getMSG_BODY (), message [i] .getMSG_NO (), and [i] .getMSG_STUS ());
    last post mesg = message [i];
    MSGC [i] .setChangeListener (new FieldChangeListener() {}
    ' Public Sub fieldChanged (field field, int context) {}
    onClose();
    }
    });
    Add (MSGC [i]);
    }
    can someone help me how to close the popup screen.
            
    }
    }

    Place the UiApplication.popScreen () call in an executable object and pass this object to UiApplication.invokeLater ().

  • Custom attributes of access in a bean managed to webcenter 12 c

    WebCenter Portal: Webcenter 12 c

    How can I access custom attributes in a bean managed to webcenter 12 c.. ?

    I found the following blogpost to 11.1.1.8: http://blog.vassit.co.uk/knowledge/access-global-custom-attributes

    It is said to add libraries:

    • Model of WebCenter spaces
    • WebCenter spaces customer

    Cannot find these libraries in snapshot .ee 12 c.

    Update:

    The class I used in this blog post only works in 11g and it is an internal class that should be avoided to use as it may change in future versions.

    It is an example of change.

    It is offered in the Public Oracle Fusion Middleware Java QAnywhere for Oracle WebCenter Portal class WCApplicationContext that will allow you to access using Java through many steps.

    WCApplicationContext wcAppCtx = WCApplicationContext.getCurrentInstance();
    WCApplication wcApp = wcAppCtx.getApplication();
    WebCenterType wcMeta = wcApp.getApplicationConfig();
    CustomAttributes customAttr = wcMeta.getCustomAttributes();
    ...
    

    This course may not be available in the libraries provided by JDeveloper 12.2.1 and you include library webcenter-core - api .jar manually.

    I don't know why these classes are in the library and not offered public API catalog of libraries of the ADF in the JDeveloper 12.2.1

    Anyway, as suggested by the use of Vinay and his colleagues the EL Expression as he goes to work.

    Note: I'll blog in my personal blog

    Hope this information helps everybody.

    Kind regards.

  • How to display the HTML page generated from a bean managed OUCSSPortalADFLibrary?

    ? Hello

    I have an af:commandButton in my jsff. By clicking on the button will perform an action of the managed bean located in the OUCSSPortalADFLibrary. The action of the method generates the HTML string of the new page to display in the same window. I tried what follows but failed to make it work.

    In my jsff:

    < af:commandButton action = "#{pageFlowScope.MyManagedBean.generateHtml}" id = "cb1"/ > "

    < af:outputText value = "#{pageFlowScope. . "{MyManagedBean.html}" id = "ot1" escape = "false" / >

    In my bean managed:

    SerializableAttribute public class MyManagedBean extends SSBaseManagedBean {}

    private String html;

    public void generatehtml() {}

    generate the html string

                   html = "<! "" DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional / / as"------"http://www.w3.org/TR/html4/loose.dtd------" > < html >... < / html > "; " "

    }

    public String getHtml() {}

    Returns the html;

    }

    }

    Kindly help/tips how to operate or any other way.

    Thank you in advance.

    Hi Lena,.

    ADF managed beans, you can use ExtendedRenderKitService to call the javascript. Something like window.location.href or similar can be used to replace the URL data: text / html mentioned in response format.

    Kind regards

    SAI

  • How to associate a bean managed with model custom content presenter

    Hello

    We use webcenter Portal 11.1.1.8.

    We have created the model of presenter content customized by using application portal Webcenter Framework. We use the Portal Server model Extension to extend Webcenter portal. The requirement is to associate a bean managed with the presenter of custom content model.

    Thanks in advance for your help.

    Nikhil,

    You can download DesignWebCenterSpaces to the URL http://download.oracle.com/otndocs/tech/webcenter/files/DesignWebCenterSpaces_11.1.1.8.0.zip

    It has the "WebCenterSpacesResources" project, which helps you to organize the active portals (including the content presenter models) and resources of portal to create/update.

    If you want to use beans controlled inside the presenter content model:

    (Development of components in ADF for WebCenter portal using the PortalExtension project http://docs.oracle.com/cd/E29542_01/webcenter.1111/e27739/jpsdg_wcsres.htm#JPSDG14173)

    1. you create the bean managed in PortalExtension project

    2. set up in faces-config. XML

     

        myManagedBean

        com.Portal.CP. MyManagedBean

        request

     

    3 deploy a part of extend.spaces.webapp.war.

    After deployment, the managed bean will be available for the presenter content model.


    K

  • [ADF, JDev12.1.3] How to hide the LOV "magnifying glass" through a bean managed?

    Hallo,

    I want to hide the "magnifying glass" to a field LOV.

    This is possible only by using a CSS approach like this Ashish Awasthi (Jdev/ADF) Blog: search to hide from af icon: inputListOfValues using CSS & StyleClass-Oracle ADF?

    Since then, I need to calculate in a bean managed if the magnifying glass must be hidden or not... I would like to know if there is an appproach simple and clean alternative.

    Thank you

    Federico

    Hi Federico,.

    You can use the same approach, as mentioned in the blog. Just you need not set the StyleClass on the page.

    In the method of bean managed when you calculate that there should be no magnifying glass, then get the reference to lov and set its styleclass (LOV.setStyleClass) and refresh the LOV.

    This way you can conditionally hide and display magnifying glass.

    Thank you

  • Problem with binding components of fragments of page in bean managed when rendered as region

    I detected a problem when I bind a component in a managed bean for a page fragment which is a view of a TaskFlow exposed to JSF as a region.


    This problem happened when I exhibited same TaskFlow as region of two or more instances in the same Joint Strike Fighter. The component that is only returned in the latter region.


    JDeveloper 12 c (12.1.2.0) ADF12c.

    This is the code:

    The page fragment:

    <?xml version='1.0' encoding='UTF-8'?>
    <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <af:panelGroupLayout id="pgl1">
        <af:inputText label="Label 1" id="it1" binding="#{bindingComponentBean.inputText}"/>
        <af:button text="button 1" id="b1"/>
      </af:panelGroupLayout>
    </ui:composition>
    

    Bean managed (within the scope of the request)

    package com.edisa.test.errors.view.backing;
    
    
    import oracle.adf.view.rich.component.rich.input.RichInputText;
    
    
    public class BindingComponentBean {
        private RichInputText inputText;
    
    
        public BindingComponentBean() {
        }
    
    
        public void setInputText(RichInputText inputText) {
            this.inputText = inputText;
        }
    
    
        public RichInputText getInputText() {
            return inputText;
        }
    }
    

    TaskFlow

    <?xml version="1.0" encoding="UTF-8" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <task-flow-definition id="TestTaskFlow">
        <default-activity>test_fragment</default-activity>
        <managed-bean id="__1">
          <managed-bean-name>bindingComponentBean</managed-bean-name>
          <managed-bean-class>com.edisa.test.errors.view.backing.BindingComponentBean</managed-bean-class>
          <managed-bean-scope>request</managed-bean-scope>
        </managed-bean>
        <view id="test_fragment">
          <page>/fragments/test_fragment.jsff</page>
        </view>
        <use-page-fragments/>
      </task-flow-definition>
    </adfc-config>
    

    JSF page

    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE html>
    <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
        <af:document title="index.jsf" id="d1">
            <af:form id="f1">
                <af:pageTemplate viewId="/oracle/templates/threeColumnTemplate.jspx" id="pt1">
                    <f:facet name="center">
                        <af:panelGridLayout id="pgl1" inlineStyle="border: 1px solid #eee;">
                            <af:gridRow marginTop="5px" height="auto" marginBottom="5px" id="gr1">
                                <af:gridCell marginStart="5px" width="50%" id="gc1" inlineStyle="border: 1px solid #eee;"
                                             halign="stretch">
                                    <af:panelBox text="Region 1" id="pb1">
                                        <f:facet name="toolbar"/>
                                        <af:region value="#{bindings.TestTaskFlow2.regionModel}" id="r2"/>
                                    </af:panelBox>
                                </af:gridCell>
                                <af:gridCell marginStart="5px" width="50%" marginEnd="5px" id="gc2"
                                             inlineStyle="border: 1px solid #eee;" halign="stretch">
                                    <af:panelBox text="Region 2" id="pb2">
                                        <f:facet name="toolbar"/>
                                        <af:region value="#{bindings.TestTaskFlow1.regionModel}" id="r1"/>
                                    </af:panelBox>
                                </af:gridCell>
                            </af:gridRow>
                        </af:panelGridLayout>
                    </f:facet>
                    <f:facet name="header"/>
                    <f:facet name="end"/>
                    <f:facet name="start"/>
                    <f:facet name="branding"/>
                    <f:facet name="copyright"/>
                    <f:facet name="status"/>
                </af:pageTemplate>
            </af:form>
        </af:document>
    </f:view>
    

    Component to bind to the support extended to bean bean would be.

    In fact, it is solely to support the scope of the bean - to distinguish two or more instances of the page fragment component.

    It has the same duration of life as the requestScope, but for different instances of the components parts / declarative, you have separate instances of scope backingBean controlled beans.

    http://adfpractice-Fedor.blogspot.com/2012/03/managed-bean-scopes-for-page-fragments.html

  • favorite way to bean managed from the context

    I am aware of below two ways that we can use to get an instance of bean managed in the ADF:

    (A) ADFContext.getCurrent ().getScope("PageFlowScope").get ("myBean");

    (B) elFactory.createValueExpression(elctx,_"#{pageFlowScope.MyBean}",Object.class).getValue (elctx);

    I don't know, but y at - it a preference between these 2 approaches.   If there is, can someone let me know what it is.

    Thanks for your information.

    HM, I use both methods. I don't have another preference that the first is easier to remember. The 2nd way is slower that EL is first analyzed and rated then.

    Timo

  • How to transfer values to the popup while the bean in application scope?

    Hi all

    I use JDeveloper 11.1.1.4

    My scenario is that I have a < af:popup > with a component of < af:outputText >.

    I need pass values of output text dynamically according to the scenarios.

    My grain of support is application scope . So I'm not able to pass values using get and methods.

    My Design as,

    < af:popup id = "p1" contentDelivery = "lazyUncached" >

    < af:outputText value = "#{managedBean.getDynamicText}" id = "ot1" / > "

    < / af:popup >

    Now I run the application I'm not get all values in text during debugging output, I am able to set the value, but it didn't reflect on the page.

    How to transfer values to the popup while the bean in application scope?

    Thank you...

    At the bean, why don't you set the value to a variable pageflowscope and point the outputtext popup to the pageflowscope variable?

    () .getpageflowscope, set AdfFacesContext.getCurrentInstance ("nomvar", value);


    Thank you

    Alisson

  • Web, portal center-list of buddies in bean managed

    Hi all

    I'm working on the webcenter Portal project and I need to get the list of buddies from the playlists of the connection in the bean managed so that I can make a business logic on them.

    Any help appreciated.

    Thanks in advance.

    Kind regards

    Faye

    I followed the procedure to retrieve the friends/connections from a user in below managed bean. For the below work to drag and drop the data connections of people webcenter getConnetions() control on page jspx API and the corresponding bean we can access by getting links, as shown below:

    BindingContainer bc =

    BindingContext.getCurrent () .getCurrentBindingsEntry ();

    OperationBinding links =.

    bc.getOperationBinding ("getConnections");

    {if(Bindings!=null)}

    System.out.println ("Got the link to connectionLists");

    try {}

    Map params = bindings.getParamsMap ();

    params.put ("userid", loginuserid);

    params.put ("connectionListName", "");

    params.put ("filterPattern", "");

    params.put ("sortBy", "");

    params.put ("startIndex", 0);

    params.put ("fetchSize", 10);

    ArrayList buddylist = (ArrayList) bindings.execute ();

    System.out.println ("size Executed connectionLists DC," + buddylist.size () + "-> list of buddies from dB" + buddylist);

    }

    Thank you

    Kind regards

    Faye.

Maybe you are looking for