How to Open PopUp from Managed Bean?

Hi,
Can you please let me know how can we open a pop up from managed bean.
Thanks & Regards,
Kiran Konjeti

Hi,
I got the answer for this question.
Write the following code in Managed Bean
==========================
private RichOutputText errorText;
private RichPopup PopUp;
Generate accessors(setters & getters) for these 2 variablesAnd place this method in your managed bean.
> private void showPopup(RichPopup popUp, UIComponent source) {
> FacesContext context = FacesContext.getCurrentInstance();
> String popupId = popUp.getClientId(context);
> String alignId = source.getClientId(context);
> StringBuilder script = new StringBuilder();
> script.append("var popup = AdfPage.PAGE.findComponent('").append(popupId).append("'); ").append("if (!popup.isPopupVisible()) { ").append("var hints = {}; ").append("hints
[AdfRichPopup.HINT_ALIGN_ID] = '").append(alignId).append("'; ").append("hints[AdfRichPopup.HINT_ALIGN] = AdfRichPopup.ALIGN_AFTER_START; ").append("popup.show(hints);}");> ExtendedRenderKitService erks =
> Service.getService(context.getRenderKit(),
> ExtendedRenderKitService.class);
> erks.addScript(context, script.toString());
> }
Now, how to call this method from your managed bean ... depends upon situation.
public void sendEmailstoBorrowers(ActionEvent actionEvent) {
.....................some logic ...............> if(true){
> personHistoryStatus = defaultPreventionHelper.writeBorrowerHistory(borrowersList,getFormattedAction());
> this.errorText.setValue((borrowersList != null ? borrowersList.size() : "")+" E-mails have been sent successfully..!");
> }else{
> this.errorText.setValue("Unable to send emails. Please contact System Administrator..!");
> }
> showPopup(this.getPopUp(), actionEvent.getComponent());
}And ... what do we need to do on the UI??
Write the following code in UI -- Here is the button which calls sendEmail method
==================================================
><af:commandButton text="SEND" id="cb3"
>shortDesc="Click 'Send' to send emails."
>styleClass="defaultButton"
>blocking="true"
>disabled="#{pageFlowScope.DefaultPreventMB.disablePrintButton || bindings.DelinquentBorrowersList.estimatedRowCount == 0}"
>rendered="#{pageFlowScope.DefaultPreventMB.formattedAction eq 'E-mail'}"
>partialTriggers="t2:dlDelete"
>actionListener="#{pageFlowScope.DefaultPreventMB.sendEmailstoBorrowers}"/>
Once this button get clicked ... it calls sendEmailstoBorrowers, and based on the result(either true or false) the method sets the content for the pop up and opens the popup from managed bean.
And here is the code for which we have to keep inside the jsff and this gets invoked from managed bean.
><af:popup id="p1" binding="#{pageFlowScope.DefaultPreventMB.popUp}">
> <af:dialog id="d1" type="ok" title="E-mail Communication Status">
><af:outputText value="E-mails have been sent successfully..!"
> id="ot11"
>binding="#{pageFlowScope.DefaultPreventMB.errorText}"/>
></af:dialog>
></af:popup>
Let me know if you need more information about it.
Thanks & Regards,
Kiran Konjeti

Similar Messages

  • Open popup from managed bean

    How can i open a popup from a managed bean function?
    Suppose i have an inputfield that is bound to a function getValue(), how can i open a specific popup from that function?

    Essential you have to put the popup somewhere on the page and you have to know the popup id (or search for it in the page). Then you call
         * Opens the RichPopup based on the key.
        public static void showPopup(String popupId)
            FacesContext context = FacesContext.getCurrentInstance();
            ExtendedRenderKitService extRenderKitSrvc =
                Service.getRenderKitService(context, ExtendedRenderKitService.class);
            extRenderKitSrvc.addScript(context,
                                       "AdfPage.PAGE.findComponent('" + popupId + "').show();");
        }with the popup id as parameter.
    Timo

  • How to invoke popup from managed bean

    Hi Can anyone give me idea for invoking a pop-up from method in the managed bean plz,
    Here my coding,
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1" binding="#{backingBeanScope.backing_untitled5.d1}">
    <af:form id="f1" binding="#{backingBeanScope.backing_untitled5.f1}">
    <af:commandButton text="commandButton 2"
    binding="#{backingBeanScope.backing_untitled5.cb2}"
    id="cb2"
    action="#{backingBeanScope.backing_untitled5.cb2_action}"/>
    </af:form>
    <af:popup binding="#{backingBeanScope.backing_untitled5.p1}" id="p1">
    <af:panelWindow binding="#{backingBeanScope.backing_untitled5.pw1}"
    id="pw1"/>
    </af:popup>
    </af:document>
    </f:view>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_untitled5-->
    </jsp:root>
    Managed bean coding,
    import javax.faces.context.FacesContext;
    import oracle.adf.view.rich.component.rich.RichDocument;
    import oracle.adf.view.rich.component.rich.RichForm;
    import oracle.adf.view.rich.component.rich.RichPanelWindow;
    import oracle.adf.view.rich.component.rich.RichPopup;
    import oracle.adf.view.rich.component.rich.nav.RichCommandButton;
    import org.apache.myfaces.trinidad.render.ExtendedRenderKitService;
    import org.apache.myfaces.trinidad.util.Service;
    public class Untitled5 {
    private RichForm f1;
    private RichDocument d1;
    private RichPopup p1;
    private RichPanelWindow pw1;
    private RichCommandButton cb2;
    public void setF1(RichForm f1) {
    this.f1 = f1;
    public RichForm getF1() {
    return f1;
    public void setD1(RichDocument d1) {
    this.d1 = d1;
    public RichDocument getD1() {
    return d1;
    public void setP1(RichPopup p1) {
    this.p1 = p1;
    public RichPopup getP1() {
    return p1;
    public void setPw1(RichPanelWindow pw1) {
    this.pw1 = pw1;
    public RichPanelWindow getPw1() {
    return pw1;
    public void setCb2(RichCommandButton cb2) {
    this.cb2 = cb2;
    public RichCommandButton getCb2() {
    return cb2;
    public String cb2_action() {      .
    FacesContext context = FacesContext.getCurrentInstance();
    ExtendedRenderKitService extRenderKitSrvc =
    Service.getRenderKitService(context, ExtendedRenderKitService.class);
    extRenderKitSrvc.addScript(context,"AdfPage.PAGE.findComponent('" + p1 + "').show();");
    return null;
    looking for ur reply
    Regards,
    Tom

    If you are using JDev 11.1.1.3, then in a managed bean method use the following to show or hide the popup:
    RichPopup.PopupHints hints = ...<set_the_hints>...;
    p1.show(hints);
    // or
    p1.hide();If you are using an older JDev 11g, then use the following:
       * Hides a popup.
       * @param popup Popup to be hidden.
      public static void hidePopup(RichPopup popup) {
        FacesContext context = FacesContext.getCurrentInstance();
        String popupId = popup.getClientId(context);
        StringBuilder script = new StringBuilder();
        script.append("var popup = AdfPage.PAGE.findComponent('").append(popupId).append("'); ")
              .append("if (popup.isPopupVisible()) { ")
              .append("popup.hide();}");
        ExtendedRenderKitService erks =
          Service.getService(context.getRenderKit(), ExtendedRenderKitService.class);
        erks.addScript(context, script.toString());
       * Shows a popup.
       * @param popup Popup to be shown
      public static void showPopup(RichPopup popup) {
        showPopup(popup, null);
       * Shows a popup alligned to the start of specified UI component.
       * @param popup Popup to be shown
       * @param component UI component to allign to
      public static void showPopup(RichPopup popup, UIComponent component) {
        FacesContext context = FacesContext.getCurrentInstance();
        String popupId = popup.getClientId(context);
        String alignId = (component==null) ? null : component.getClientId(context);
        StringBuilder script = new StringBuilder();
        script.append("var popup = AdfPage.PAGE.findComponent('").append(popupId).append("'); ")
              .append("if (!popup.isPopupVisible()) { ")
              .append("var hints = {}; ");
        if (alignId!=null) {
          script.append("hints[AdfRichPopup.HINT_ALIGN_ID] = '").append(alignId).append("'; ")
                .append("hints[AdfRichPopup.HINT_ALIGN] = AdfRichPopup.ALIGN_AFTER_START; ");
        script.append("popup.show(hints);}");
        ExtendedRenderKitService erks =
          Service.getService(context.getRenderKit(), ExtendedRenderKitService.class);
        erks.addScript(context, script.toString());
      }You can find these methods in the Steve Muench's utility class JSFUtils.
    Dimitar
    Edited by: Dimitar Dimitrov on Nov 15, 2010 2:59 PM

  • ADF Show popup from managed bean

    Hi, i have one popup in jspx. On click of a command button a method in managed bean should be called and that has to decide whether to show the popup or not. I have a check and using that i need to show this popup. How to show/invoke the popup from managed bean? I used script also but it was not working. Kindly help me.
    Thank you,
    Sankari Kannan

    Hi,
    Which JDeveloper Release You Use?
    In JDeveloper11g the structure View---->Document----->Form.
    Try one of these solutions:
    - Try to put it outside of your pageTemplate tage as:
    <af:view>
    <af:popup>
    </af:popup>
    <af:pageTemplate>
    <f:facet>
    <af:decorativeBox>
    <af:view>
    I don't know is it possible or not.
    - you can put the ids of your popup container as
    StringBuilder strb =
    new StringBuilder("AdfPage.PAGE.findComponent(\"container1:container2:popup5\").show();");
    Sameh Nassar

  • Show Popup From Managed Bean

    Hi,
    how i show a inline popup from managed bean , triggered by a certain action in bean, like satisfying a condition or something else?
    normally, showing a popup from bean involves clicking some userinterface components on page.
    in my case, showing a popup should totally automated by a managed bean.
    i m using jdev 11.1.1.2 .
    Plz , help me in this context.
    Regards,

    Hi John,
    I used the above code but it doesnt work.Can you please look into my code.
    In Jspx page,
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1" binding="#{backingBeanScope.backing_untitled5.d1}">
    <af:form id="f1" binding="#{backingBeanScope.backing_untitled5.f1}">
    <af:commandButton text="commandButton 2"
    binding="#{backingBeanScope.backing_untitled5.cb2}"
    id="cb2"
    action="#{backingBeanScope.backing_untitled5.cb2_action}"/>
    </af:form>
    <af:popup binding="#{backingBeanScope.backing_untitled5.p1}" id="p1">
    <af:panelWindow binding="#{backingBeanScope.backing_untitled5.pw1}"
    id="pw1"/>
    </af:popup>
    </af:document>
    </f:view>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_untitled5-->
    </jsp:root>
    In backing bean,
    package view.backing;
    import javax.faces.context.FacesContext;
    import oracle.adf.view.rich.component.rich.RichDocument;
    import oracle.adf.view.rich.component.rich.RichForm;
    import oracle.adf.view.rich.component.rich.RichPanelWindow;
    import oracle.adf.view.rich.component.rich.RichPopup;
    import oracle.adf.view.rich.component.rich.nav.RichCommandButton;
    import org.apache.myfaces.trinidad.render.ExtendedRenderKitService;
    import org.apache.myfaces.trinidad.util.Service;
    public class Untitled5 {
    private RichForm f1;
    private RichDocument d1;
    private RichPopup p1;
    private RichPanelWindow pw1;
    private RichCommandButton cb2;
    public void setF1(RichForm f1) {
    this.f1 = f1;
    public RichForm getF1() {
    return f1;
    public void setD1(RichDocument d1) {
    this.d1 = d1;
    public RichDocument getD1() {
    return d1;
    public void setP1(RichPopup p1) {
    this.p1 = p1;
    public RichPopup getP1() {
    return p1;
    public void setPw1(RichPanelWindow pw1) {
    this.pw1 = pw1;
    public RichPanelWindow getPw1() {
    return pw1;
    public void setCb2(RichCommandButton cb2) {
    this.cb2 = cb2;
    public RichCommandButton getCb2() {
    return cb2;
    public String cb2_action() {
    // Add event code here...
    FacesContext context = FacesContext.getCurrentInstance();
    ExtendedRenderKitService extRenderKitSrvc =
    Service.getRenderKitService(context, ExtendedRenderKitService.class);
    extRenderKitSrvc.addScript(context,"AdfPage.PAGE.findComponent('" + p1 + "').show();");
    return null;
    Please correct my mistake if any.
    Regards,
    Tom

  • How to show popup from backing bean code immediately?

    Hi,
    I'm using JDeveloper 11.1.2.1.0 and have problems with showing popups. I have a button with an action on my page and a method in backing bean.
    I want to rise up few popups from this method in backing bean (for example just an anouncement that something will happen) or a dialog
    (for example a question if you want to continue).
    I understand how to get a dialog response to deal with it in code, but the problem is that the popup doesn't show up immediately, but only when
    this method called on button finishes. I'd like to handle dialog responses in the middle of the action and then the code to continue with the execution.
    Here is my backing bean code:
    private RichPopup popup;
    public String test() {
    //Some code...
    RichPopup.PopupHints hints = new RichPopup.PopupHints();
    popup.show(hints);
    //Here is the place for code which I want to be executed after popup closes,
    //but is executed before the popup shows...
    return null;
    And here is part of my jssf:
    <af:commandButton text="Test" id="cb1"
    action="#{popupBean.test}"/>
    <af:popup id="popup" binding="#{popupBean.popup}">
    <af:dialog id="dialog" type="yesNo"
    title="Dialog"
    dialogListener="#{popupBean.onDialogAction}"
    binding="#{popupBean.dialog}" clientComponent="true">
    <af:outputText value="Do you want to continue?" id="ot1"/>
    <af:clientListener method="onDialogCancel" type="dialog"/>
    <af:serverListener type="DialogCancelHandlerEvent" method="#{popupBean.onDialogCancel}"/>
    </af:dialog>
    </af:popup>
    Can someone give me some answer how to show the popup from backing bean code immediately?
    Thanks in advance,
    Tina

    If you want to execute code after popup closes, then put this code in PopupCanceledListener or in DialogListener(you can't block method execution).
    Dario

  • How to open a jspx in a popup from managed bean.

    Hello,
    I'm using Studio Edition Version 11.1.1.4.0.
    I have a JSPX that is to be used as an application monitor screen. So it contains 5 af:tables with plenty of columns & query search criteria. Each of the tables has context sensitive menus as well as double click functionality.
    When I write everything in a single JSPX, the code functions as expected. i.e. menu items & double click actions open new popups with requisite data. However, single JSPX becomes huge in size and hence difficult to maintain.
    When I transfer code to another JSPX, How do I call the new JSPX in a popup from the managed bean?
    Regards,
    Amar

    Try this:
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/53-taskflow-in-popup-169196.pdf

  • Error while opening a popup from managed bean

    Hi,
    I am trying to open a popup from bean, after another popup is closed. When I open the second popup either through ActionListener(on first popup button) or DialogListener(on first popup), I am getting the below error on browser status bar(!); and the second popup doesn't open. There is no error in the log.
    *'AdfPage.PAGE.findComponent(...)' is null or not an object.*
    Although the popup id is there on the jspx page.
    <af:popup id="confirmationStatus" binding="#{MyBean1.confirmationStatus}">
    <af:dialog cancelVisible="false"
    closeIconVisible="false" binding="#{MyBean1.d2}"
    title="Appointment Confirmation Status">
    <af:outputText value="Appointment is successfully confirmed"/>
    </af:dialog>
    </af:popup>
    public void confirmAppointment_dialogListener(DialogEvent dialogEvent) {
    FacesContext context = FacesContext.getCurrentInstance();
    ExtendedRenderKitService service = Service.getRenderKitService(context, ExtendedRenderKitService.class);
    String popupId = "confirmationStatus";
    service.addScript(context,"AdfPage.PAGE.findComponent('" + popupId + "').show();");
    Please tell me why my popup is not getting open from the managed bean and I am getting an error in below line.
    service.addScript(context,"AdfPage.PAGE.findComponent('" + popupId + "').show();");

    To find out the right address of a component related to an other component, open your page select the component you want to add a partial trigger, go to the partial trigger property, select the down arrow at the right end and select 'Edit'. Now look for the popup in the component tree shown on the left side. When you have found the popup shuffle it the the selected side and click OK. The string you see in the field is the full address of the popup related to he component you've selected. Try the string you see there in your bean code. Remove the string from the partial trigger property, it's just to get the correct path.
    One other thing to check is that your popup has the ClientComponent property set to true.
    Next thing to try, is to use AdfPage.PAGE.findComponentByAbsoluteId(...)
    Timo

  • How to call popup from backing bean

    Hi,
    I have an application under jdev 11.1.1.1.0
    I am using the explorer template.
    I have my popups in one page and from another page i need to call these popups.
    I cannot use the <af:showPopupBehavior> because i am using the <af:setActionListener> in my command button.
    So in the action attribute I called my backing bean
    public String showDelBoxPopup() {
       FacesContext context = FacesContext.getCurrentInstance();
       ExtendedRenderKitService extRenderKitSrvc =
         Service.getRenderKitService(context,ExtendedRenderKitService.class);
       extRenderKitSrvc.addScript(context,"AdfPage.PAGE.findComponent('delBoxPopup').show()");
       return null;
    }But i always receive a null error.
    How can i call a popup in one page from another page using backing bean.
    Thank you in advance.
    Emile BITAR

    Hi,
    You can use <af:setActionListener> with <af:showPopupBehavior>, if you set triggerType="click" on the showPopupBehavior and contentDelivery="lazyUncached" on the popup to ensure the popup will be raised after setActionListener.
    I also don't understand what you mean by calling the popup from another page (is that page included as a region?), but if you say it works then your other option could be to bind the popup to the backing bean and use popup.getClientId() in your javascript.
    String script = "var popup = AdfPage.PAGE.findComponent(\"" + popup.getClientId(fc) +  "\"); popup.show();";Pedja

  • Re:How to get the vo from managed bean

    Hi all,
    I am using Jdev11.1.2.3.0
    My requirement is : I have one jspx page.In that page i have created one form,so i need to get the values from managed bean.here i wont create by using data control view instance.so finally i have to get the table values from managed bean.so how can i get it.can anyone help me please.
    Thanks,
    G.Shilpa

    So you're not using ADF BC at all, right ?
    From JSF point of view, it does not matter how you provide UI control values.
    What you can do, for example, is to use pure JDBC in order to get and display the database values.
    What you need in your backing bean, is appropriate properties (setter/getter method pairs).
    In the getter, you can obtain DB values by using JDBC
    Take a look at:
    JSF 2.0 + JDBC integration example
    JSF JDBC Integration
    JDBC in JSF - YouTube

  • How to call a AM method with parameters from Managed Bean?

    Hi Everyone,
    I have a situation where I need to call AM method (setDefaultSubInv) from Managed bean, under Value change Listner method. Here is what I am doing, I have added AM method on to the page bindings, then in bean calling this
    Class[] paramTypes = { };
    Object[] params = { } ;
    invokeEL("#{bindings.setDefaultSubInv.execute}", paramTypes, params);
    This works and able to call this method if there are no parameters. Say I have to pass a parameter to AM method setDefaultSubInv(String a), i tried calling this from the bean but throws an error
    String aVal = "test";
    Class[] paramTypes = {String.class };
    Object[] params = {aVal } ;
    invokeEL("#{bindings.setDefaultSubInv.execute}", paramTypes, params);
    I am not sure this is the right way to call the method with parameters. Can anyone tell how to call a AM method with parameters from Manage bean
    Thanks,
    San.

    Simply do the following
    1- Make your Method in Client Interface.
    2- Add it to Page Def.
    3- Customize your Script Like the below one to Achieve your goal.
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("GetUserRoles");
    operationBinding.getParamsMap().put("username", "oracle");
    operationBinding.getParamsMap().put("role", "F1211");
    operationBinding.getParamsMap().put("Connection", "JDBC");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    return null;
    i hope it help you
    thanks

  • Problem while invoking popup from backing bean

    I am invoking a popup from backing bean method.
    The same backing bean method has the business logic which depends on the data collected from popup(user enters some data on popup).
    So I need the business logic to be executed after popup comes up.
    The popup is coming after the execution of return statement in backing bean method . How do i make popup trigger at earlier point in the method.
    <af:commandToolbarButton text="#{corePostupgradeuiBundle.SIGN_OFF_MIG}"
    id="socb52"
    partialSubmit="true"
    actionListener="#{viewScope.signoffBean.signOffAgents}"
    partialTriggers="t3"/>
    public void signOffAgents(ActionEvent event) throws SQLException {
    DCBindingContainer bc =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding summaryIter =
    bc.findIteratorBinding("Signoff1Iterator");
    showPopup("credentials"); //will get credential details from user and store in credential Bean
    //Following logic uses the data collected from popup
    EMCredentialReference credRef= credentialBean.getCredReference();
    submitJOb(credRef);
    public static void showPopup(String popupId) {
    FacesContext context = FacesContext.getCurrentInstance();
    StringBuilder script = new StringBuilder();
    script.append("AdfPage.PAGE.findComponent(\"").append(popupId).append("\").show();");
    ExtendedRenderKitService erks =
    Service.getService(context.getRenderKit(),
    ExtendedRenderKitService.class);
    erks.addScript(context, script.toString());
    UIComponent component = context.getViewRoot().findComponent(popupId);
    RequestContext.getCurrentInstance().addPartialTarget(component);
    }

    Well, your work flow is wrong.
    What you try to accomplish should work out of the box as
    1) user hit toolbar button
    2) this opens a popup "credentials" which have listeners for ok and cancel
    3) use fills in data in popup and hit ok or cancel
    4) one of the listeners gets fired
    5a) if OK listener you do your business logic
    5b) if cancel you do something else
    So all you have to do is the use a af:af:showPopupBehavioron the toolbar button, add a popup canel listener (if you need to act on canel) dependign on your popup design (dialog or simple button) add the appropriate listeners and in the listener method so your business logic.
    Timo

  • Disabling a checkbox which is in a table, from managed bean

    disabling a checkbox which is in a table, from managed bean -
    i am able to iterate table and get/set value of checkbox but i want to disable it, how can i do that?
    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp = elFactory.createValueExpression(elContext, "#{bindings}", Object.class);
    DCBindingContainer bindings = (DCBindingContainer) valueExp.getValue(elContext);
    DCIteratorBinding iter = bindings.findIteratorBinding("dogsIterator");
    RowSetIterator rit = iter.getRowSetIterator();
    rit.reset();
    while(rit.hasNext()) {
    Row currentRow = rit.next();
    Attribute attr = (Attribute)row.getAttribute("checked");
    what code should come here to disable checkbox?
    rit.closeRowSetIterator();
    thanks.

    Wes Fang wrote:
    You might find it easier to simply use EL and evaluate that value on the disable property:
    <af:column ...>
    <af:selectBooleanCheckbox ... disabled="#{row.bindings.checked.inputValue==YOUR_DISABLE_VALUE?true:false}"/>
    </af:column>
    i used this approach.
    kept a bean in session and used it's property in disabled attribute - now setting this property in my bean...

  • How to add property through managed-beans.xml

    Hi,
    I am trying to take a hard coded value property from managed-beans.xml file. I tried using :
    <managed-property>
    <property-name> filename </property-name>
    <value> xx </value>
    I called getProperty("filename"); from one of my bean classes and it did not recognise it.
    I am not sure how to do this one. any help will be appreciated.
    Thanks

    I'm not sure what getProperty method you are referring to in your original posting. Is this a method on your managed bean class?
    Managed beans are implemented as regular JavaBeans so you will need to add a setFilename(String) and getFilename() method to your backing bean class to get this to work correctly. The setter method will get called automatically when the bean is first instantiated, either by accessing it from a JSP value-binding expression as a result of calling context.getApplication().getVariableResolver().resolve(context, beanName) where context is an instance of FacesContext and beanName the name of the managed bean as specified in faces-config.xml. You can then use the getter method to access the property value from within your application code.
    Alternatively, if you don't want to implement a JavaBean class, you can specify java.lang.HashMap as the managed bean class and use myBean.get("filename") to access the property instead.
    Hope this helps.
    -- Keith

  • Header value in data table can be fetched from managed bean.

    hi
    My requirement is to display a report in which column headers are also retrieved from data base, it cannot be hardcoded.
    instead of My Column it should come from managed bean
    <f:facet name="header">
    <h:outputText value="My Column"/>
    </f:facet>
    I am not able to fetch the header value from the managed bean.
    I tried
    <f:facet name="header">
    <h:outputText value="#{character.name}"/>
    </f:facet>
    but failed.
    Is there any way i can fetch these values at run time.

    Is that bean the main bean or the row object? It should be the main bean. There is only one column per table, its value is not to be derived from the row object.

Maybe you are looking for