How to attach simple Spring code as managed bean into amx:listView (list view in adf mobile application)

I found very simple code to fetch facebook feed here:
3. Facebook API Binding
it uses Spring Framework. I already added spring support into jDeveloper.
code to fetch feed is something like this:
String accessToken = "f8FX29g..."; // access token received from Facebook after OAuth authorization
Facebook facebook = new FacebookTemplate(accessToken);
List<Post> feed = facebook.feedOperations().getFeed();
I created managed bean for my amx:listView - Facebook.java. And inserted this code. But of course it is not enough. I need somehow to add spring managed bean (not like mine).
Can you help me with that?

Thanks for your answer. But its too wasteful for my app to run additional server. My app is very simple so i do not need server side. May be there is another way, without Spring. I mean something simpler then raw JDK 1.4 - some ready-made tool for the needs of these?
Thanks in advance

Similar Messages

  • How can I load the data of Manager Beans into an Array?

    Hi all!
    I have a problem when use the ADF model layer (JDeveloper 10g). I want to load the data of a Manager Bean into Array(such as: Array in JavaScript).But I don't know any ways to do.
    Are there any ways to do that?
    Please, help me!
    Thanks so much!

    Hi,
    there is a fundamental difference between an array in Java and an array in JavaScript as the latter is added to the output page while the first sits in a Java class on the server.
    Populating a Java array from a managed bean is straight froward: Just create the Array, loop through the source of the data - ADF binding or the ADF Faces table component - and fill it.
    For a JavaScript Array I would suggest to write the array into a js file and reference it from the web page (which might cause concurrency issues).
    Frank

  • How to attach the T.CODE to a report created through REPORT PAINTER

    Hi all,
    Please tell me "<b>How to attach the T.CODE to a report created through REPORT PAINTER".</b>.
    Please show me the way how to do it as its getting too firing issue !!
    Awaiting for the early responses !!
    M.Soni

    Dear All,
    I got some good inputs from <b>Jessie</b> on this issue and observed that the reports which are created through report painter are standard one having entries in the TSTCP table .
    <b>But the reports(Through Report Painter) which are creaed by us has no entry in TSTCP table !!</b>
    Kindly show the way, how to attach the T.code to the reports which are created through report painter. as its getting so buggy now !!
    Please tell me if someone know about this.
    <b>Please note all my reports are created directly in the 500(Production</b>).
    Waiting for quick inputs !!
    Regards,
    M.soni

  • How to Commit table by writting Java code in Managed Bean?

    Hi,
    Can anyone suggest me how to Commit table by writing Java code in Managed Bean?.
    I want to commit table manually after modifying in UI.
    Please suggest me guys.
    Thanks,
    Ramit Mathur

    Hi Friend Copy this two java files with same package of your bean package.
    1,*ADFUtils.java*
    package org.calwin.common.view.utils;(Your package name)
    import java.util.ArrayList;
    import java.util.List;
    import javax.el.ELContext;
    import javax.el.ExpressionFactory;
    import javax.el.MethodExpression;
    import javax.el.ValueExpression;
    import javax.faces.context.FacesContext;
    import javax.faces.model.SelectItem;
    import oracle.adf.model.BindingContext;
    import oracle.adf.model.binding.DCBindingContainer;
    import oracle.adf.model.binding.DCIteratorBinding;
    import oracle.adf.model.binding.DCParameter;
    import oracle.adf.share.logging.ADFLogger;
    import oracle.binding.AttributeBinding;
    import oracle.binding.BindingContainer;
    import oracle.binding.ControlBinding;
    import oracle.binding.OperationBinding;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.Key;
    import oracle.jbo.Row;
    import oracle.jbo.uicli.binding.JUCtrlValueBinding;
    * A series of convenience functions for dealing with ADF Bindings.
    * Note: Updated for JDeveloper 11
    * @author Duncan Mills
    * @author Steve Muench
    * $Id: ADFUtils.java 2513 2007-09-20 20:39:13Z ralsmith $.
    public class ADFUtils
    public static final ADFLogger _LOGGER = ADFLogger.createADFLogger(ADFUtils.class);
    * Get application module for an application module data control by name.
    * @param pName application module data control name
    * @return ApplicationModule
    public static ApplicationModule getApplicationModuleForDataControl(String pName)
    return (ApplicationModule) JSFUtils.resolveExpression("#{data." + pName + ".dataProvider}");
    * A convenience method for getting the value of a bound attribute in the
    * current page context programatically.
    * @param pAttributeName of the bound value in the pageDef
    * @return value of the attribute
    public static Object getBoundAttributeValue(String pAttributeName)
    return findControlBinding(pAttributeName).getInputValue();
    * A convenience method for setting the value of a bound attribute in the
    * context of the current page.
    * @param pAttributeName of the bound value in the pageDef
    * @param pValue to set
    public static void setBoundAttributeValue(String pAttributeName, Object pValue)
    findControlBinding(pAttributeName).setInputValue(pValue);
    * Returns the evaluated value of a pageDef parameter.
    * @param pPageDefName reference to the page definition file of the page with the parameter
    * @param pParameterName name of the pagedef parameter
    * @return evaluated value of the parameter as a String
    public static Object getPageDefParameterValue(String pPageDefName, String pParameterName)
    BindingContainer bindings = findBindingContainer(pPageDefName);
    DCParameter param = ((DCBindingContainer) bindings).findParameter(pParameterName);
    return param.getValue();
    * Convenience method to find a DCControlBinding as an AttributeBinding
    * to get able to then call getInputValue() or setInputValue() on it.
    * @param pBindingContainer binding container
    * @param pAttributeName name of the attribute binding.
    * @return the control value binding with the name passed in.
    public static AttributeBinding findControlBinding(BindingContainer pBindingContainer, String pAttributeName)
    if (pAttributeName != null)
    if (pBindingContainer != null)
    ControlBinding ctrlBinding = pBindingContainer.getControlBinding(pAttributeName);
    if (ctrlBinding instanceof AttributeBinding)
    return (AttributeBinding) ctrlBinding;
    return null;
    * Convenience method to find a DCControlBinding as a JUCtrlValueBinding
    * to get able to then call getInputValue() or setInputValue() on it.
    * @param pAttributeName name of the attribute binding.
    * @return the control value binding with the name passed in.
    public static AttributeBinding findControlBinding(String pAttributeName)
    return findControlBinding(getBindingContainer(), pAttributeName);
    * Return the current page's binding container.
    * @return the current page's binding container
    public static BindingContainer getBindingContainer()
    return (BindingContainer) JSFUtils.resolveExpression("#{bindings}");
    * Return the Binding Container as a DCBindingContainer.
    * @return current binding container as a DCBindingContainer
    public static DCBindingContainer getDCBindingContainer()
    return (DCBindingContainer) getBindingContainer();
    * Get List of ADF Faces SelectItem for an iterator binding.
    * Uses the value of the 'valueAttrName' attribute as the key for
    * the SelectItem key.
    * @param pIteratorName ADF iterator binding name
    * @param pValueAttrName name of the value attribute to use
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @return ADF Faces SelectItem for an iterator binding
    public static List<SelectItem> selectItemsForIterator(String pIteratorName, String pValueAttrName, String pDisplayAttrName)
    return selectItemsForIterator(findIterator(pIteratorName), pValueAttrName, pDisplayAttrName);
    * Get List of ADF Faces SelectItem for an iterator binding with description.
    * Uses the value of the 'valueAttrName' attribute as the key for
    * the SelectItem key.
    * @param pIteratorName ADF iterator binding name
    * @param pValueAttrName name of the value attribute to use
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @param pDescriptionAttrName name of the attribute to use for description
    * @return ADF Faces SelectItem for an iterator binding with description
    public static List<SelectItem> selectItemsForIterator(String pIteratorName, String pValueAttrName, String pDisplayAttrName, String pDescriptionAttrName)
    return selectItemsForIterator(findIterator(pIteratorName), pValueAttrName, pDisplayAttrName, pDescriptionAttrName);
    * Get List of attribute values for an iterator.
    * @param pIteratorName ADF iterator binding name
    * @param pValueAttrName value attribute to use
    * @return List of attribute values for an iterator
    public static List attributeListForIterator(String pIteratorName, String pValueAttrName)
    return attributeListForIterator(findIterator(pIteratorName), pValueAttrName);
    * Get List of Key objects for rows in an iterator.
    * @param pIteratorName iterabot binding name
    * @return List of Key objects for rows
    public static List<Key> keyListForIterator(String pIteratorName)
    return keyListForIterator(findIterator(pIteratorName));
    * Get List of Key objects for rows in an iterator.
    * @param pIterator iterator binding
    * @return List of Key objects for rows
    public static List<Key> keyListForIterator(DCIteratorBinding pIterator)
    List<Key> attributeList = new ArrayList<Key>();
    for (Row r: pIterator.getAllRowsInRange())
    attributeList.add(r.getKey());
    return attributeList;
    * Get List of Key objects for rows in an iterator using key attribute.
    * @param pIteratorName iterator binding name
    * @param pKeyAttrName name of key attribute to use
    * @return List of Key objects for rows
    public static List<Key> keyAttrListForIterator(String pIteratorName, String pKeyAttrName)
    return keyAttrListForIterator(findIterator(pIteratorName), pKeyAttrName);
    * Get List of Key objects for rows in an iterator using key attribute.
    * @param pIterator iterator binding
    * @param pKeyAttrName name of key attribute to use
    * @return List of Key objects for rows
    public static List<Key> keyAttrListForIterator(DCIteratorBinding pIterator, String pKeyAttrName)
    List<Key> attributeList = new ArrayList<Key>();
    for (Row r: pIterator.getAllRowsInRange())
    attributeList.add(new Key(new Object[]
    { r.getAttribute(pKeyAttrName) }));
    return attributeList;
    * Get a List of attribute values for an iterator.
    * @param pIterator iterator binding
    * @param pValueAttrName name of value attribute to use
    * @return List of attribute values
    public static List attributeListForIterator(DCIteratorBinding pIterator, String pValueAttrName)
    List attributeList = new ArrayList();
    for (Row r: pIterator.getAllRowsInRange())
    attributeList.add(r.getAttribute(pValueAttrName));
    return attributeList;
    * Find an iterator binding in the current binding container by name.
    * @param pName iterator binding name
    * @return iterator binding
    public static DCIteratorBinding findIterator(String pName)
    DCIteratorBinding iter = getDCBindingContainer().findIteratorBinding(pName);
    if (iter == null)
    throw new RuntimeException("Iterator '" + pName + "' not found");
    return iter;
    * @param pBindingContainer
    * @param pIterator
    * @return
    public static DCIteratorBinding findIterator(String pBindingContainer, String pIterator)
    DCBindingContainer bindings = (DCBindingContainer) JSFUtils.resolveExpression("#{" + pBindingContainer + "}");
    if (bindings == null)
    throw new RuntimeException("Binding container '" + pBindingContainer + "' not found");
    DCIteratorBinding iter = bindings.findIteratorBinding(pIterator);
    if (iter == null)
    throw new RuntimeException("Iterator '" + pIterator + "' not found");
    return iter;
    * @param pName
    * @return
    public static JUCtrlValueBinding findCtrlBinding(String pName)
    JUCtrlValueBinding rowBinding = (JUCtrlValueBinding) getDCBindingContainer().findCtrlBinding(pName);
    if (rowBinding == null)
    throw new RuntimeException("CtrlBinding " + pName + "' not found");
    return rowBinding;
    * Find an operation binding in the current binding container by name.
    * @param pName operation binding name
    * @return operation binding
    public static OperationBinding findOperation(String pName)
    OperationBinding op = getDCBindingContainer().getOperationBinding(pName);
    if (op == null)
    throw new RuntimeException("Operation '" + pName + "' not found");
    return op;
    * Find an operation binding in the current binding container by name.
    * @param pBindingContianer binding container name
    * @param pOpName operation binding name
    * @return operation binding
    public static OperationBinding findOperation(String pBindingContianer, String pOpName)
    DCBindingContainer bindings = (DCBindingContainer) JSFUtils.resolveExpression("#{" + pBindingContianer + "}");
    if (bindings == null)
    throw new RuntimeException("Binding container '" + pBindingContianer + "' not found");
    OperationBinding op = bindings.getOperationBinding(pOpName);
    if (op == null)
    throw new RuntimeException("Operation '" + pOpName + "' not found");
    return op;
    * Get List of ADF Faces SelectItem for an iterator binding with description.
    * Uses the value of the 'valueAttrName' attribute as the key for
    * the SelectItem key.
    * @param pIterator ADF iterator binding
    * @param pValueAttrName name of value attribute to use for key
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @param pDescriptionAttrName name of the attribute for description
    * @return ADF Faces SelectItem for an iterator binding with description
    public static List<SelectItem> selectItemsForIterator(DCIteratorBinding pIterator, String pValueAttrName, String pDisplayAttrName, String pDescriptionAttrName)
    List<SelectItem> selectItems = new ArrayList<SelectItem>();
    for (Row r: pIterator.getAllRowsInRange())
    selectItems.add(new SelectItem(r.getAttribute(pValueAttrName), (String) r.getAttribute(pDisplayAttrName), (String) r.getAttribute(pDescriptionAttrName)));
    return selectItems;
    * Get List of ADF Faces SelectItem for an iterator binding.
    * Uses the value of the 'valueAttrName' attribute as the key for
    * the SelectItem key.
    * @param pIterator ADF iterator binding
    * @param pValueAttrName name of value attribute to use for key
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @return ADF Faces SelectItem for an iterator binding
    public static List<SelectItem> selectItemsForIterator(DCIteratorBinding pIterator, String pValueAttrName, String pDisplayAttrName)
    List<SelectItem> selectItems = new ArrayList<SelectItem>();
    for (Row r: pIterator.getAllRowsInRange())
    selectItems.add(new SelectItem(r.getAttribute(pValueAttrName), (String) r.getAttribute(pDisplayAttrName)));
    return selectItems;
    * Get List of ADF Faces SelectItem for an iterator binding.
    * Uses the rowKey of each row as the SelectItem key.
    * @param pIteratorName ADF iterator binding name
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @return ADF Faces SelectItem for an iterator binding
    public static List<SelectItem> selectItemsByKeyForIterator(String pIteratorName, String pDisplayAttrName)
    return selectItemsByKeyForIterator(findIterator(pIteratorName), pDisplayAttrName);
    * Get List of ADF Faces SelectItem for an iterator binding with discription.
    * Uses the rowKey of each row as the SelectItem key.
    * @param pIteratorName ADF iterator binding name
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @param pDescriptionAttrName name of the attribute for description
    * @return ADF Faces SelectItem for an iterator binding with discription
    public static List<SelectItem> selectItemsByKeyForIterator(String pIteratorName, String pDisplayAttrName, String pDescriptionAttrName)
    return selectItemsByKeyForIterator(findIterator(pIteratorName), pDisplayAttrName, pDescriptionAttrName);
    * Get List of ADF Faces SelectItem for an iterator binding with discription.
    * Uses the rowKey of each row as the SelectItem key.
    * @param pIterator ADF iterator binding
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @param pDescriptionAttrName name of the attribute for description
    * @return ADF Faces SelectItem for an iterator binding with discription
    public static List<SelectItem> selectItemsByKeyForIterator(DCIteratorBinding pIterator, String pDisplayAttrName, String pDescriptionAttrName)
    List<SelectItem> selectItems = new ArrayList<SelectItem>();
    for (Row r: pIterator.getAllRowsInRange())
    selectItems.add(new SelectItem(r.getKey(), (String) r.getAttribute(pDisplayAttrName), (String) r.getAttribute(pDescriptionAttrName)));
    return selectItems;
    * Get List of ADF Faces SelectItem for an iterator binding.
    * Uses the rowKey of each row as the SelectItem key.
    * @param pIterator ADF iterator binding
    * @param pDisplayAttrName name of the attribute from iterator rows to display
    * @return List of ADF Faces SelectItem for an iterator binding
    public static List<SelectItem> selectItemsByKeyForIterator(DCIteratorBinding pIterator, String pDisplayAttrName)
    List<SelectItem> selectItems = new ArrayList<SelectItem>();
    for (Row r: pIterator.getAllRowsInRange())
    selectItems.add(new SelectItem(r.getKey(), (String) r.getAttribute(pDisplayAttrName)));
    return selectItems;
    * Find the BindingContainer for a page definition by name.
    * Typically used to refer eagerly to page definition parameters. It is
    * not best practice to reference or set bindings in binding containers
    * that are not the one for the current page.
    * @param pPageDefName name of the page defintion XML file to use
    * @return BindingContainer ref for the named definition
    private static BindingContainer findBindingContainer(String pPageDefName)
    BindingContext bctx = getDCBindingContainer().getBindingContext();
    BindingContainer foundContainer = bctx.findBindingContainer(pPageDefName);
    return foundContainer;
    * @param pOpList
    public static void printOperationBindingExceptions(List pOpList)
    if (pOpList != null && !pOpList.isEmpty())
    for (Object error: pOpList)
    _LOGGER.severe(error.toString());
    * Programmatic invocation of a method that an EL evaluates to.
    * The method must not take any parameters.
    * @param pEl EL of the method to invoke
    * @return Object that the method returns
    public static Object invokeEL(String pEl)
    return invokeEL(pEl, new Class[0], new Object[0]);
    * Programmatic invocation of a method that an EL evaluates to.
    * @param pEl EL of the method to invoke
    * @param pParamTypes Array of Class defining the types of the parameters
    * @param pParams Array of Object defining the values of the parametrs
    * @return Object that the method returns
    public static Object invokeEL(String pEl, Class[] pParamTypes, Object[] pParams)
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
    MethodExpression exp = expressionFactory.createMethodExpression(elContext, pEl, Object.class, pParamTypes);
    return exp.invoke(elContext, pParams);
    * Sets the EL Expression with the value.
    * @param pEl EL Expression for which the value to be assigned.
    * @param pVal Value to be assigned.
    public static void setEL(String pEl, Object pVal)
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
    ValueExpression exp = expressionFactory.createValueExpression(elContext, pEl, Object.class);
    exp.setValue(elContext, pVal);
    * Evaluates the EL Expression and returns its value.
    * @param pEl Expression to be evaluated.
    * @return Value of the expression as Object.
    public static Object evaluateEL(String pEl)
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
    ValueExpression exp = expressionFactory.createValueExpression(elContext, pEl, Object.class);
    return exp.getValue(elContext);
    }

  • How to get iterator values from a managed bean ?

    Due to a bug in selectOneChoice i'm not able to get the label list i want to display directly from an iterator when the value binding is a managed bean.
    To solve the problem i would like to create a managed bean that contains that list and use it as the selectItems to display.
    I would like that the values in that managed bean loaded from the a data control iterator.
    My question is :
    1) is it possible to access the iterator values from a managed bean, i mean without any reference to a page definition
    2) how to do ? is it documented somewhere ? any example ?
    Thank you

    I got it also with this code:
    package view.managedBeans;
    import classification.bean.ClassificationDocument;
    import classification.castor.ClassificationLanguage;
    import java.io.FileNotFoundException;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Hashtable;
    import java.util.List;
    import java.util.Locale;
    import javax.faces.context.FacesContext;
    import javax.faces.el.ValueBinding;
    import javax.faces.model.SelectItem;
    import oracle.adf.model.generic.DCGenericDataControl;
    import org.exolab.castor.xml.MarshalException;
    import org.exolab.castor.xml.ValidationException;
    public class ClassificationLanguageList {
    private java.util.List<SelectItem> supportedLanguages = new ArrayList();
    public ClassificationLanguageList() throws FileNotFoundException,
    MarshalException,
    ValidationException {
    FacesContext ctx = FacesContext.getCurrentInstance();
    ValueBinding vb = ctx.getApplication().createValueBinding("#{data.ClassificationDocumentDataControl}");
    DCGenericDataControl classificationDocumentDataControl = (DCGenericDataControl)vb.getValue(ctx);
    ClassificationDocument classificationDocument = (ClassificationDocument)classificationDocumentDataControl.getDataProvider();
    ClassificationLanguage[] classificationLanguage = classificationDocument.getClassification().getClassificationLanguageList().getClassificationLanguage();
    for (int counter = 1; counter < classificationLanguage.length; counter++) {
    SelectItem language = new SelectItem();
    language.setValue(classificationLanguage[counter].getClassificationLanguageCode());
    language.setLabel(classificationLanguage[counter].getClassificationLanguageLabel());
    supportedLanguages.add(language);
    public void setSupportedLanguages(java.util.List<SelectItem> supportedLanguages) {
    this.supportedLanguages = supportedLanguages;
    public java.util.List<SelectItem> getSupportedLanguages() {
    return supportedLanguages;
    }

  • How can long lines of code be cut / separated into multiple short

    In Java, How can long lines of code be cut / separated into multiple short lines?
    Example
    System.out.printf( "%d\t%d\t%s\t%s\t%s\t%s\t\t%s\n", arrayIndex ,  part[ arrayIndex ], name[arrayIndex], units[arrayIndex], price[arrayIndex], units[arrayIndex] * price[arrayIndex], total[ arrayIndex ]   );Thanks

    System.out.printf( "%d\t%d\t%s\t%s\t%s\t%s\t\t%s\n",
    arrayIndex , 
    part[ arrayIndex ],
    name[arrayIndex],
    units[arrayIndex],
    price[arrayIndex],
    units[arrayIndex] * price[arrayIndex],
    total[ arrayIndex ]   );P.S. It looks to me like you have an array for each attribute of something. This is not OO and you should consider creating a class holding the information about each 'Part' or whatever it is. You will then just need a collection of Parts.

  • How can I sort the words in a document into an alphabetical list?

    How can I sort the words in a document into an alphabetical list? Thanks!

    writer888 wrote:
    How can I sort the words in a document into an alphabetical list? Thanks!
    Copy the words to the Mac's clipboard (Edit menu> Copy)
    Paste into TextEdit 
    Next open the Edit > Find > Find window in Text Edit.
    Highlight a space between two words and Edit menu > copy, paste into the Find field
    Next create a return in the middle of your text and copy that and paste into the Replace field
    Click Replace All.
    Now Edit > Select All and Edit > Copy
    Open a Spreadsheet program with Sort ability and paste into the second column cell from the top
    place a "a" into the top column cell, select the entire colum
    Sort desending order
    Now if you need it out of spreadsheet format, then your going to need to copy just the data cells (not the entire column to avoid problems) and Paste "Special" as unformatted text into a word processing program
    If you need to get rid of the Returns, do the opposite you did in Text Edit, replace the Returns with Spaces
    A chore, but it's rare one needs to sort words into alaphabetical order.
    FYI, I used TextEdit and the free LibreOffice (Spreadsheet and Word Processing) for the above effects.

  • I just upgraded my ipad OS and now my ipad is not picking up the 3G network.  Why and how do I fix this?  When I go into cellular data and view account it says my ipad is activated and ready to go.  What gives???

    Why and how do I fix this?  When I go into cellular data and view account it says my ipad is activated and ready to go.  What gives???
      It was working fine up until I upgraded the OS which I hadn't done in many versions so the ipad was not working as well as it should.  Now it is searching for the network. 

        Hello noodles074!
    Let's get your device working again! It's possible that your device just needs to be reprovisioned on our network. Please go to Settings>General>Reset>Subscriber Services>Reprovision Account. This may take several minutes. After allowing about 5 minutes for completion, please power your iPad off and back on, and test it again. Let us know if this takes care of it!
    Thank you,
    MichelleH_VZW
    Follow us on Twitter @VZWSupport

  • Scope of managed bean for a modifiable list

    I have a business entity set stored in database. I want to show them with JSF as elements of a list with each element having a delete button. If the database changes in the background because entitites are removed or inserted, the delete function certainly must work well.
    I'm clear of the key stuff I have to use:
    -a managed bean, probably containing some list coming from database through dao or o/r mapper.
    -some iterator, e.g. t:dataList (using Tomahawk)
    -h:commandButton with action referring to methods in the managed-bean's elements.
    The question is, what usually would be the scope of the managed-bean.
    If the scope is "request", delete function may work wrong when database changes between the first and the "delete" request.
    -First request: managed-bean created with ids and event handlers.
    -Database changes: new entity is inserted.
    -Secont request: managed-bean created with id-s and event handlers according to the new database content. id-s have been shifted.
    It may help if I override somehow the default id generation of the JSF, by using directly id-s of business entities but I think it's an unproposed hack.
    If the scope of the managed bean is "session", the delete function works well, however we've a lot of stuff to store in the session.
    So, what would be the scope of the managed-bean?
    Or a completely different approach should be used?

    hi,
    faces-config:---------
    <faces-config version="1.2"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
    <!-- ***************Country************-->
    <managed-bean>
    <managed-bean-name>countryMBean</managed-bean-name>
    <managed-bean-class>com.tnhsp.mbeans.CountryMBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <!-- ***************country************-->
    <navigation-case> <!-- DEfault mode - Fetches all data in datatable -->
    <from-outcome>fetch_country</from-outcome>
    <to-view-id>/hospitalAdmin/country/countryDisplayContent.jsp</to-view-id>
    <redirect/>
    </navigation-case>
    <navigation-case> <!-- Displayes the screen to add data -->
    <from-outcome>add_country</from-outcome>
    <to-view-id>/hospitalAdmin/country/countryCreateContent.jsp</to-view-id>
    <redirect/>
    </navigation-case>
    </faces-config>
    MBEAN:-----
    public class CountryMBean {
    @EJB
    CountrySRemote countrySRemote;
    private Country country = new Country();
    public CountryMBean() {
    System.out.println("countryMBean.countryMBean()");
    country = new Country();
    fc = FacesContext.getCurrentInstance();
    public String actionAdd() {
    renderFlag = 1;
    errorStatus = "";
    System.out.println("countryMBean. - actionadd");
    retValue = "add_country";
    setLinkMode(ADD_MODE");
    setDisableCodeField("false");
    saveStatus = "false";
    listEmptyStatus = "false";
    country = new Country();
    Date dt = new Date();
    country.setEffectFromDt(dt);
    country.setCreatedDate(dt);
    country.setLastUpdatedDate(dt);
    country.setCreatedUser("user");
    country.setLastUpdatedUser("user");
    System.out.print("returning from actionadd");
    return retValue;
    Please help.

  • Is this right: How to create an instance of a managed bean?

    public static void setManagedBean(String name, Object obj) {
    FacesContext.getCurrentInstance().getApplication().createValueBinding("#{" + name + "}").setValue(FacesContext.getCurrentInstance(), obj);
    And how do I delete a managed bean attached to the session? (I don't
    need to do that but for the sake of completeness, I figure better to ask
    now.)
    Thanks - dave

    This is very dangerous ground because you give up compile-time safety, but you can get a Class object using Class.forName(String). Then you can use methods of the class Class to operate on it (including creating an instance).

  • How to set a value in a managed bean when click on a button

    Dear all
    I have a managed bean that contains an attribute of type string as follow:
    the attribute name is taskFlowId
    package dhamanADM.view.beans;
    import oracle.adf.controller.TaskFlowId;
    public class dynamicTaskFlowManager {
       private String taskFlowId = "/WEB-INF/flows/procedureMaster.xml#procedureMaster";   
        public dynamicTaskFlowManager() {
            super();
      public TaskFlowId getDynamicTaskFlowId() {
       return TaskFlowId.parse(taskFlowId);
    }I want to change the value of this attribute when clicking on a commandMenuItem as follow
       <af:commandMenuItem text="Mission Persons" id="pt_cmi1"
                                                action="missionPers">
       <af:setActionListener from="/WEB-INF/flows/editPersionMission.xml#editPersionMission"
                                      to="#{pageFlowScope.dmDynamicTaskFlowManager.dynamicTaskFlowId}"/>
       </af:commandMenuItem>at run time when clicking on the menu this error appears
    java.lang.IllegalArgumentException: Cannot convert /WEB-INF/flows/editPersionMission.xml#editPersionMission of type class java.lang.String to class oracle.adf.controller.TaskFlowId
    My target is just to change the value of the attribute "taskFlowId" when clicking on the commandMenuItem
    how can i do this?
    Thanks in advance
    Edited by: ta**** on Mar 29, 2011 1:24 PM

    You are setting to set a String value where a type of TaskFlowId is required.
    Looks like, you are trying to set the taskFlowId for the dynamic region. Modify the code as follows:
    public class dynamicTaskFlowManager {
    private String taskFlowId = "/WEB-INF/flows/procedureMaster.xml#procedureMaster";
    public dynamicTaskFlowManager() {
    super();
    *public TaskFlowId getDynamicTaskFlowId() {*
    AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
    String currentTaskFlowId =
    *(String)adfFacesContext.getPageFlowScope().get("CurrentTaskFlowId");*
    if (currentTaskFlowId == null ||
    *currentTaskFlowId.trim().equals("") == true) {*
    currentTaskFlowId = taskFlowId;
    return TaskFlowId.parse(currentTaskFlowId);
    In the MenuItem, modify it as follows:
    <af:commandMenuItem text="Mission Persons" id="pt_cmi1"
    action="missionPers">
    *<af:setActionListener from="/WEB-INF/flows/editPersionMission.xml#editPersionMission"*
    *to="#{pageFlowScope.CurrentTaskFlowId}"/>*
    </af:commandMenuItem>
    Thanks,
    Navaneeth

  • How to expose UI components in a managed bean?

    Dear all
    I created a jsf page without exposing UI components in managed beans.
    And the page is created successfully.
    But now I want to expose UI components in managed beans again
    How to make this??
    Please help

    select your component in Jdeveloper main menu, in the property inspector find Binding property -->click Edit to bind this component to a managed bean property.

  • How to implement this: Exception handler for managed bean

    Hi, i'm using jdev 11g rel 1 , and i know i can use custom java class to extends DCErrorHandlerImpl, and override some method to customize the output or other info of my exceptions.
    And then config it for databindings.cpx to make it available. But i found that this is only available for JboExceptions which are thrown from BC layer and through databindings.
    If my exceptions are from managed bean, or just use application module to use the methods in it, while encounter exceptions, there's no way to handle it.
    How can i handle it in managed bean in just one place(for architecuture layer)? <I just want to define a method to handle all managed bean's exceptions and use dcContainer.process it>,
    who can give some suggestion?

    If my exceptions are from managed bean, or just use application module to use the methods in it, while encounter exceptions, there's no way to handle it.
    How can i handle it in managed bean in just one place(for architecuture layer)? <I just want to define a method to handle all managed bean's exceptions and use dcContainer.process it>,
    who can give some suggestion?If you use application module methods in the managed bean, then use them through methodAction bindings so that the standard error handling works as expected.
    See: http://blogs.oracle.com/smuenchadf/no_createrootappmodule_in_backing_beans.html
    If you need to do a whole lot of error handling in the bean (instead of just showing a message once in a while), you might be putting too much business logic where it doesn't belong. Consider moving that logic to the AM

  • How to distinguish the ABAP Code in include program into different TRs

    Hello Friends,
      In our current project, two teams are working on the developments.  One team is for LES related developements and another team is for billing related developments.  As part of developments, same programs are sharing by two teams, example -
    Include - MV45AFZZ, the userexits in include are using by both the teams for their developments
    Now the issue was, since the same program is using by both the teams, and during program activation , system automatically includes the code in both the team TRs.  This was causing issue while testing and transport to other testing systems, since billing project is going live in next year and LES in coming november
    Hence, we need to understand how we can differentiate the code which should not impact with other TRs.
    Many thanks for your inputs
    Best Regards,
    Goutham

    Thanks all for the quick reply..
    I would like to brief more clear...
    In current project, Team 1 is working for Logistics developments, Team 2 is for Billing developments.  As part of project plan, Logistics is going live this november
    When two teams are working on the same include, Team 1 is activated the changes then the task is updated in their TR, later when Team 2 has made changes in the same inlcude then the task was includeded in their TR.    Now the problem facing was, Team 2 has developed statements like COMMIT  WAIT WORK  and also BAPI call etc... and these statements are causing performance issues and some other problems......
    Recently Logistics related TRs are moved to testing system for testing, in that all the development TRs are moved into testing system and also code related to Billing project (Team2)  as well.... when we cross check the reason then it was identified that the same include is using by both the teams for the development.    Now we need distinguish the code specific to team whcih should not impact other...
    Hope my explanation clear the criticality of the problem
    Thanks
    Best Regards,
    Goutham

  • How could i use resource bundle in managed bean instead of harding coding?

    component is created in managed bean programmatically, so how to set attributes(e.g. text, value) using resource bundling instead of hard coding, as like coding on the page directlly?
    Thanks for your help!
    Kevin.

    component is created in managed bean programmatically, so how to set attributes(e.g. text, value) using resource bundling instead of hard coding, as like coding on the page directlly?
    Thanks for your help!
    Kevin.

Maybe you are looking for