How to access backing bean of a xml component , in a managed bean of ADF

Hi,
We wrote a xml component in JSF and this component is used in ADF project by including the component as jar .
In a master detail page , we need to update the value of the xml component, when the master row is changed. How to do this.
We are trying to do this by accessing the backing bean of the xml component in ADF project's managed bean. So when ever the row changes, we can access the managed bean in ADF and then can set the value of the xml component by accessing it's backing bean
But i can't access the backing bean instance of the xml component in the ADF managed bean. Could you let me know how to do this. Thanks .

Thanks for the response Shay. The xml component is added as a custom component , with a separate faces-config.xml file . This component is added to ADF project as a jar with a custom tag.
In the ADF project , i'm having different managed beans and i can access them from a different managed bean.
The issue is, i can't access the added custom component's backing bean which is available from a different jar , defined in a separate faces-config.xml file . This backing bean is defined with request scope.

Similar Messages

  • How to set the value of process variables/payload using a managed bean?

    Hello,
    Someone can give me an example about how to set the values of a process payload in a managed bean?
    thank you!

    Try this:
    jsf page:
    <af:selectOneChoice label="Select Suburb"
    requiredMessageDetail="Select a suburb"
    valueChangeListener="#{selectOneChoiceBean.onValueChanged}"
    validator="#{selectOneChoiceBean.validate}"
    unselectedLabel="None" autoSubmit="true"
    binding="#{selectOneChoiceBean.selectOneChoice}"
    value="#{selectOneChoiceBean.value}">
    <f:selectItems value="#{selectOneChoiceBean.selectionList}"/>
    </af:selectOneChoice>
    backing bean:
    public class SelectChoiceBean {
    private List<SelectItem> selectionList;
    private String value = "B";
    private RichSelectOneChoice selectOneChoice;
    public SelectChoiceBean() {
    initSelectionList();
    public void setSelectionList(List<SelectItem> selectionList) {
    this.selectionList = selectionList;
    public List<SelectItem> getSelectionList() {
    return selectionList;
    public void onValueChanged(ValueChangeEvent valueChangeEvent) {
    System.out.println(valueChangeEvent.getNewValue());
    // Add event code here...
    public void validate(FacesContext facesContext, UIComponent uIComponent,
    Object object) {
    // Add event code here...
    private void initSelectionList() {
    selectionList = new ArrayList<SelectItem>();
    selectionList.add(new SelectItem("A", "A label"));
    selectionList.add(new SelectItem("B", "B label"));
    selectionList.add(new SelectItem("C", "C label"));
    public void setValue(String value) {
    this.value = value;
    public String getValue() {
    return value;
    public void setSelectOneChoice(RichSelectOneChoice selectOneChoice) {
    this.selectOneChoice = selectOneChoice;
    public RichSelectOneChoice getSelectOneChoice() {
    return selectOneChoice;
    }

  • How am I able to use an injected EJB in a Managed Bean Constructor?

    JSF 1.2
    EJB 3.0
    Glassfish v1
    Summary:
    Managed bean injected EJB is null when referencing EJB var in constructor.
    Details:
    In my managed bean, I have a constructor that tries to reference an injected EJB, such as:
    public class CustomerBean implements Serializable {
    @EJB private CustomerSessionRemote customerSessionRemote;
    public CustomerBean() {
    List<CustomerRow> results = customerSessionRemote.getCustomerList();
    }The call within the constructor to customerSessionRemote is null - I've double checked this in Netbeans 5.5.
    How am I able to use an injected EJB in a Managed Bean Constructor?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    OK, I was reading the article Web Tier to Go With Java EE 5: A Look at Resource Injection and I understand your statement too.
    Is there any way possible to Inject the EJB prior to the bean instance creation at all?
    Maybe, I need to approach it with the old fashion Java EE 1.4 route and using JNDI in the PostConstruct annotated method to reference the EJB in the managed bean.
    This had to been thought out before, I don't understand why a manged bean's life cycle places any injections at the end of the bean creation.
    Also, now that I understand that the @PostConstruct annotated method will be called by the container after the bean has been constructed and before any business methods of the bean are executed.
    I am trying to reference my EJB as part of the creation of the managed bean.
    What happens: the JSF page loads the managed bean and I need to populate a listbox component with data from an EJB.
    When I try to make the call to the EJB in the listbox setter method, the EJB reference is null.
    Now, I'm not for sure if the @PostConstruct annotation is going to work... hmmmm.
    ** Figured it out. ** I just needed to move the EJB logic that was still in the setter of the component I wanted to populate into the annotated PostConstruct method.

  • How to access a method in webservice catalogued component in BPM Process

    Hi
    Can anyone explain me how to access a method in webservice catalogued component in BPM Process using an imported jsp in bpm process.
    Thanks & Regards
    Ashish

    If Class B only has a reference to an Interface A, and that reference points to a concrete instance of Class A, then of course Class B can still call the method on Interface A. The method for concrete instance Class A is called behind the scenes.
    That's how interfaces work. That's what they're good for.
    Look at the code in the java.sql package for examples. Connection, Statement, ResultSet - all are interfaces. But behind the scenes you're using the concrete implementations provided by your JDBC driver. You don't know or care what those classes are or their package structure. All you do is make calls to the java.sql interface API, and it all works. - MOD

  • Changing row selection of a af:table component in a managed bean

    Hi,
    how can ich programmatically change the selected row of a <af:table> component within a managed bean class?
    I have a table which depends on the date settings of a <dvt:timeSelector> of a <dvt:lineGraph> component. Now when the timeSelector is moved to new dates the table should be refreshed by executing the query for the table again with the new dates. The problem is when the query of the table's view object is executed again the first row will be automatically selected after executing.
    Now I want to achieve that the last row I have selected will be selected again after moving the time selector.
    I searched already in the OTN Discussion Forum but didn't find a fitting solution.
    Thanks in advance!

    The problem is that executing the query moves the current roe to the first one.
    What you can do is to save the current row (its pk), execute the query and then set the current row to the pk of the saved selected one. Set the table attribute displayRow="selected" and set the selected row of the table to the now current row.
    One problem is that you have to be sure the last selected row is still in the record set of the new query result.
    Here are some pointers with code:
    Keep the scroll position on partial commit in <af:table>
    Jdev 11G ADF BC: rollback and keeping current row problem
    How can I programmatically select row to edit in ADF - 11g
    Timo

  • How to get ADF UI Component value in managed bean

    JDev version 11.1.1.1.3.0
    I have written a managed bean method and calling that method on valueChangeEvent of a Select boolean Checkbox ADF Component.
    I want to retreive the value of some other component located in the same page as the checkbox. I need the value of the component into the manged bean. I know how to get the value of the checkbox eg:
    public void selectCheckBoxListener(ValueChangeEvent evt){ 
    boolean selectedValue = (Boolean)evt.getNewValue();
    String oldvalue = (String)evt.getOldValue();
    How can I access the value of an input text component in the above managed bean ? Can someone help on this?

    Hi Sackam,
    String selectedRowId = (String)(evt.getComponent().findComponent("rowId")).getAttributes().get("value");
    The above coding will work fine
    but wht u have specified rowId???? whether the "value" field is inside a af:table????? if so i have doubt on the above code's working.....
    Regards,
    Suganth.G

  • How can access every item on a HorizontalList Component

    Hi,
           I would like to know how can I access every item on a HorizontalList component. What I want to do is something like this:
    My HorizontalList:
    <mx:HorizontalList
            bottom="0"
            backgroundAlpha="0.0"
            id="catalogoOpciones"
            columnCount="3"
            height="80"
            hideEffect="{esconderse}"
            horizontalScrollPolicy="on"
            selectable="false"
            showEffect="{mostrarse}"
            width="100%">
            <mx:itemRenderer>
                <mx:Component>
                    <mx:VBox  height="100%" verticalGap="0" horizontalAlign="center">
                        <mx:Label id="titulo" text="{data.nombre}"  textAlign="center" styleName="nombreOpcionDetallePlato" />
                        <mx:ComboBox id="seleccion" dataProvider="{data.opciones}" labelField="label" labelFunction="funcionLabelComboBox"                                         styleName="comboOpcionDetallePlato" change="dispatchEvent(new Event('cambioOpcion',true))"/>
                        <mx:Script>
                            <![CDATA[
                                public function funcionLabelComboBox(item:Object):String {
                                        return item.label + ", $" + item.precio;
                            ]]>
                        </mx:Script>
                    </mx:VBox>               
                </mx:Component>
            </mx:itemRenderer>
        </mx:HorizontalList>
    What I want to do is to show on an Alert screen the selected index in every ComboBox on the horizontallist:
    for(var i:Number=0;i<horizontalListt.dataProvider.length;i++){
         var indice:Number = (horizontalListt.dataProvider.getChildAt(i) as ComboBox).selectedIndex;
        Alert.show(indice.toString());
    I must add, that the horizontalList is working just fine, the only thing that's giving me problems is the access to every item in the list.
    Thank you very much for your time and help.
    Sebastián Toro O.

    Greg, thank you for your quick response, but your answer is a little ambiguous for me. How can my dataProvider change when the user selects another index? the itemRenderer it's supposed get the information off the dataProvider to fill its ComboBoxes, but when the user selects another index, that change shouldn't have any effect on the dataProvider.
    remember that the itemRenderer is:
    <mx:itemRenderer>
                <mx:Component>
                    <mx:VBox  height="100%" verticalGap="0" horizontalAlign="center">
                        <mx:Label id="titulo" text="{data.nombre}"  textAlign="center" styleName="nombreOpcionDetallePlato" />
                        <mx:ComboBox id="seleccion" dataProvider="{data.opciones}" labelField="label" labelFunction="funcionLabelComboBox"                                                   styleName="comboOpcionDetallePlato"  change="dispatchEvent(new Event('cambioOpcion',true))"/>
                        <mx:Script>
                            <![CDATA[
                                public function funcionLabelComboBox(item:Object):String {
                                        return item.label + ", $" + item.precio;
                            ]]>
                        </mx:Script>
                    </mx:VBox>               
                </mx:Component>
            </mx:itemRenderer>
    So what I whant to access, is every Component that the itemRenderer created:
    Alert.show(((catalogoOpciones.dataProvider.getItemAt(0) as VBox).getChildByName("seleccion") as ComboBox).selectedIndex.toString());
    I want to get the selectedIndex of the ComboBox of the First Item that was created on the  HorizontalList. I thought the last line of code would do the trick but it doesn't. Could you be more specific please?
    Thanks again
    Sebastián Toro O.
    PS:don't worry that if you answer my question you'll get the 10 pts

  • How to call partial trigger on JSFF component from separate managed bean?

    Guys and Gals,
    Using JDev 11.1.1.2.0. Looked on the forums and google. Initial results aren't so great.
    Is it possible to call a PPR on a JSFF component from a separate managed bean? It seems calling the FacesContext in this instance calls the root JSPX, which only contains one child: the RichDocument.
          UIComponent component =
             FacesContext.getCurrentInstance().getViewRoot().findComponent("pc1:table1");
          if (component != null)
             AdfFacesContext context = AdfFacesContext.getCurrentInstance();
             context.addPartialTarget(component);
          System.out.println(FacesContext.getCurrentInstance().getViewRoot().getChildCount());Returns 1 :(
    Ideas for a workaround?
    Edited by: LovettWB on Nov 17, 2010 3:39 AM
    Edited by: LovettWB on Nov 17, 2010 4:11 AM
    Edited by: LovettWB on Nov 17, 2010 4:12 AM

    Thanks! Joonas, you've been a great help.
    The code on the page you referenced was close, but the code on a page referenced in the user comments was even better:
    http://www.jroller.com/mert/entry/how_to_find_a_uicomponent
    My region is located in a facet, which the page you posted doesn't quite cover, but the page above fixed that. Here's the fix below:
    In Managed Bean
          // search for the region ID (or task flow) in the base page
          UIComponent base = jsfUtils.findComponentInRoot("dynamicRegion");
          // now find component ID from within that region
          UIComponent partTable = jsfUtils.findComponent(base, "partTable");
          // call PPR on your found component
          AdfFacesContext.getCurrentInstance().addPartialTarget(partTable);In JSFUtils utility class
       // used to locate region.  Could also find any component
       // located in the base ViewRoot()
       public static UIComponent findComponentInRoot(String id) {
        UIComponent component = null;
        FacesContext facesContext = FacesContext.getCurrentInstance();
        if (facesContext != null) {
          UIComponent root = facesContext.getViewRoot();
          component = findComponent(root, id);
        return component;
        // Recursive method which finds your component within JSFF
        // regardless of facet or other UIComponents which may have children
    public static UIComponent findComponent(UIComponent base, String id) {
        if (id.equals(base.getId()))
          return base;
        UIComponent kid = null;
        UIComponent result = null;
        Iterator kids = base.getFacetsAndChildren();
        while (kids.hasNext() && (result == null)) {
          kid = (UIComponent) kids.next();
          if (id.equals(kid.getId())) {
            result = kid;
            break;
          result = findComponent(kid, id);
          if (result != null) {
            break;
        return result;
    }Good stuff to know!

  • Get component Id in managed bean

    Hi experts,
    I am going to ask a foolish question, but since i'm a newbie i hope you'll forgive me .
    I am using JDev version: 11.1.2.3.0. My question is: Is it possible to get a component id inside a managed bean? By components i mean, buttons or menu items. The scenario i would like to create is this:
    I am using JasperReports to generate some required reports. I would like to do something like having a Menu with different items. By clicking each one of them, set a string in the managed bean i'm using to generate the reports (actually the string would be the name of the jrxml file i am going to load). And this string would get it's value based on which menu item is selected.
    Is it possible to do such a thing? Or may be some other way would be more suitable?
    Thank you in advance!

    MenuRenderer  is a class that renders the current value of
      UISelectOne  or  UISelectMany  component as a list of
       menu options and makes use of getId.
    https://www.google.ca/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CCwQFjAA&url=http%3A%2F%2Fjava.net%2Fprojects%2Fmoja…

  • HT4946 how to access backed up notes in itunes

    Hi please help me access Notes on the iTunes which were backed up by iTunes
    It seems like some notes got deleted from the iPhone
    Thank you!

    Restoring from a backup is all or none. There is no option to restore select data only.
    You can use a 3rd party utility such as this one to extract select data from your iPhone's backup for viewing and access on your computer but not for transferring back to your iPhone.
    http://msb.macsupport-pr.com/

  • How to access %programfiles% environment variable in XML

    Hi
    I am trying to install BEA JRockit 1.4.2 JVM silently and I need help in modifying the silent.xml file. Typically, in batch files, one would use the environment variable %programfiles% to install to the system's program files directory. However I want to do this within the silent install file that BEA recommends. The line that I want to modify is:
    <data-value name="USER_INSTALL_DIR" value="D:\Program Files\Java\jrockit-24.5.0-j2sdk1.4.2_08" />
    To something more like:
    <data-value name="USER_INSTALL_DIR" value="<b>${programfiles}</b>\Java\jrockit-24.5.0-j2sdk1.4.2_08" />
    However this does not work for me. Any help is greatly appreciated.
    Thanks,
    Jaaved

    Hi Jaared,
    You will have to create an additional wrapper that generates the silent.xml
    of your choice with a value of USER_INSTALL_DIR based on the value of the
    %PROGRAMFILES% environment variable. The value of USER_INSTALL_DIR is
    currently interpreted literally and there does not exist any support for
    expansion of environment variables in it. Based on your question we might
    consider this feature for a future release though.
    Regards
    /Robert
    <Jaaved Mohammed> wrote in message news:[email protected]..
    Hi
    I am trying to install BEA JRockit 1.4.2 JVM silently and I need help in
    modifying the silent.xml file. Typically, in batch files, one would use
    the environment variable %programfiles% to install to the system's program
    files directory. However I want to do this within the silent install file
    that BEA recommends. The line that I want to modify is:
    <data-value name="USER_INSTALL_DIR" value="D:\Program
    Files\Java\jrockit-24.5.0-j2sdk1.4.2_08" />
    To something more like:
    <data-value name="USER_INSTALL_DIR"
    value="<b>${programfiles}</b>\Java\jrockit-24.5.0-j2sdk1.4.2_08" />
    However this does not work for me. Any help is greatly appreciated.
    Thanks,
    Jaaved

  • How to access specific control event in other component

    Hi to all friends out there.
    I have created few components in which i am doing comunication through events. But my problem is that for achieving this i have to make event bubble and than add listner to where i want to use.As event it bubble and same ype of event is bubled by other compononents.
    So please tell me how i fillter specific event to that componet where i am adding eventlistener.
    Thank you in advance.

    If you want specific rows, you can always load the values from the ResultSet into a Map and access them that way. You shouldn't be noodling around with a ResultSet that way - it's a database cursor, not a substitute for a data structure.
    If you really need just a few rows, you'd be better off writing a narrower query to get just what you need. Bringing back 1,000 rows for the sake of accessing a handful is a waste.

  • Managed Bean "Name" Access  with in the Managed Bean

    Hi,
    I have faces-config.xml in which I have registered a managed bean
    and I have a base class for all the managed bean.
    The JSP's invoke the action/method defined in the base bean and I want to remove the managed bean from session upon a particular event.
    To remove the managed bean from session, as far as I know - we need to know the managed-bean-name in the faces config.
    I wanted to know if there is any way to get the name of the managed bean in the faces-config.xml at run time?.
    Thanks,

    Thanks for your recommendations. The issue that I get stuck on is how to call this method that retrives employee data. When I had the code in the constructor, it executed when I accessed the view.jsp page. Then I populated the fields from the Employee class fields. But once I create non-constructor method, how do I invoke it from my JSF page.

  • How to pass js variable to be used in managed bean constractor?

    Hi,
    I got a list of items that i present in <h:selectOneMenu on my page (the first page the user sees)
    the labels that are shown in the ><h:selectOneMenu are date + time , and the time itself is stored in the db in UTC without any + or - timezone offset (e.g UTC +2)
    In order to show the correct time in the labels of the ><h:selectOneMenu I'm adding the needed offset of the user timezone
    the problem is that the ><h:selectOneMenu is being populated from the managed bean before I'm passing the offset from the xhtml page itself using jQuery $.post(
    like this
    <h:head>
    <script type="text/javascript">
              jQuery(document).ready(function($) {
                   d = new Date();
                   var tz = -1 * d.getTimezoneOffset()/60;
                   $.post("/servlets/TimeZoneFromClientServlet",{timezone : tz});
           </script>
         </h:head>any ideas how can i pass the TimezoneOffset to the application before the managed bean is loaded?
    Thanks ahead!
    Daniel.

    You know, any website I've encountered so far ASKS for your timezone. Why do you think that is?
    In any case, if you really want to go ahead and do what you want, you need a single point of entry in your web application that sets the timezone in the session once so you can reuse it. It could be something as simple as doing it in a login page if you have one; just create a hidden input field that is prefilled with the timezone you find using Javascript; then simply submit it to the server and stick it in the session there. When the session times out the user would have to login again, which would give you the timezone value back.
    another option: is the managed bean session scoped? If so you can simply fetch it in your servlet and update the appropriate property of the managed bean. This one makes me feel some shame for suggesting it though.

  • How to access the content in the configuration files

    Hi, Folks,
    To make it easy, the questions can be like this:
    how to access the content in web.xml in a web application?
    Through ServletConfig and context?
    how to access the content in ejb-jar.xml in an ejb?
    initial context?
    Thanks

    There is no documented way to delete data stored in archived log files: you can only remove the archived log files if needed.

Maybe you are looking for