• RELEVANCY SCORE 3.50

    DB:3.50:Problem With Creating Mediaoutput In Javabean j3






    helloI tried to create MediaOutput component in javabean, bu nothing was seen here is the code; MediaOutput myMedia = new MediaOutput (); String style = "width:600px ; height:450px ; border=1px"; myMedia.setStyle(style); myMedia.setCacheable(false); myMedia.setId("foto2"); ExpressionFactory expressionFactory = FacesContext.getCurrentInstance().getApplication().getExpressionFactory(); ELContext elContext = FacesContext.getCurrentInstance().getELContext(); MethodExpression mediaMethodExpression = expressionFactory.createMethodExpression(elContext, "#{haritaBean1.drawFoto}", null, new Class[] {OutputStream.class,Object.class} ); myMedia.setCreateContentExpression(mediaMethodExpression); myMedia.setCacheable(false); children.add(myMedia); // a PanelGrid component. how can I solve this problem ? regards

  • RELEVANCY SCORE 3.37

    DB:3.37:Weld-001409 Ambiguous Dependencies For Type [Elcontext] az






    Hello friends,

    I 've tried to use in the same project seam-faces and seam-persistence but both has a dependency with solder, seam-faces with solder and seam-persistence with seam-solder.

    The problem is that when I start jBoss AS 7 the follow error was showed:

    Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type Ambiguous dependencies for type [ELContext] with qualifiers Ambiguous dependencies for type [ELContext] at injection point [[parameter 1] of Ambiguous dependencies for type [ELContext] @Inject public org.jboss.solder.el.Expressions(ELContext, ExpressionFactory)]. Possible dependencies [[Producer Method Ambiguous dependencies for type [ELContext] with qualifiers Ambiguous dependencies for type [ELContext] declared as [[method] @Produces org.jboss.seam.solder.el.ELContextProducer.createELContext()], Producer Method Ambiguous dependencies for type [ELContext] with qualifiers Ambiguous dependencies for type [ELContext] declared as [[method] @Produces org.jboss.solder.el.ELContextProducer.createELContext()]]]

    Apparently this problem was resolved: https://issues.jboss.org/browse/SOLDER-316

    but I still receive the same error.

    Versions:

    DB:3.37:Weld-001409 Ambiguous Dependencies For Type [Elcontext] az


    Use the seam-bom artifact in your dependencyManagment section to make sure you have the correct versions for everything.

  • RELEVANCY SCORE 3.34

    DB:3.34:How To Programmatically Add Af:Setpropertylistener To Commandimagelink 83





    Hi All,

    My Requirement: programmatically add af:setPropertyListener to CommandButton

    I referred this post how to programmatically add af:setPropertyListener to CommandButton and followed the following code.

    Code:

    // create a value expression
    ValueExpression vx =
    elFactory.createValueExpression(elContext, "#{pageFlowScope.clockNo}",
    String.class);
    // set a default value if desired
    vx.setValue(elContext, clockNo);

    SetPropertyListener spl =
    new SetPropertyListener(ActionEvent.class.getName());
    spl.setFrom(clockNo);
    spl.setValueExpression("to", vx);

    // add the listener to the button
    newOpButton.addActionListener(spl);

    My Code:

    af:commandImageLink id="editInsuraceDetLink"
    icon="/resources/images/Edit.jpg"
    iconPosition="trailing"
    rendered="#{not row.deleted}"
    action="addEndorsement"
    useWindow="true"
    inlineStyle="vertical-align:bottom;"
    partialSubmit="true"
    shortDesc="Edit"
    *actionListener="#{pageFlowScope.GetEndorsementTypeListener.execute}"*
    returnListener="#{GetEndorsementDetailsListener.execute}"
    windowEmbedStyle="window"
    windowModalityType="applicationModal"
    windowHeight="650" windowWidth="740"
    /af:commandImageLink

    Action Listener - .GetEndorsementTypeListener.execute code:

    RichCommandImageLink a_button = (RichCommandImageLink) a_component.findComponent("editInsuraceDetLink");
    FacesContext fctx = FacesContext.getCurrentInstance();
    Application application = fctx.getApplication();
    ELContext elContext = fctx.getELContext();
    ExpressionFactory elFactory = application.getExpressionFactory();

    ValueExpression vx = elFactory.createValueExpression(elContext, "#{pageFlowScope.controlFlowName}", String.class);
    // set a default value if desired
    //vx.setValue(elContext, clockNo);

    SetPropertyListener spl = new SetPropertyListener(ActionEvent.class.getName());
    spl.setFrom(a_target.getEndorsementFor().toString());
    spl.setValueExpression("to", vx);

    System.out.println("From= "+spl.getFrom());
    System.out.println("To= "+spl.getValueExpression("to"));

    // add the listener to the button
    a_button.addActionListener(spl);

    I got the following output.

    From= Nominee / Appointee
    To= ValueExpression[#{pageFlowScope.controlFlowName}]

    Now my Problem is: the pageFlowScope variable ControlFlowName is not set.
    And also I got a *link*: https://blogs.oracle.com/vijaymohan/entry/usage_of_setpropertylistener_and_setactionlistener

    Whats wrong with my code. Is my problem related with above *link*.

    Please suggest me how to add SetPropertyListener programmatically.

    -Thanks
    Mohanraj

    DB:3.34:How To Programmatically Add Af:Setpropertylistener To Commandimagelink 83

    Hi All,

    My Requirement: programmatically add af:setPropertyListener to CommandButton

    I referred this post how to programmatically add af:setPropertyListener to CommandButton and followed the following code.

    Code:

    // create a value expression
    ValueExpression vx =
    elFactory.createValueExpression(elContext, "#{pageFlowScope.clockNo}",
    String.class);
    // set a default value if desired
    vx.setValue(elContext, clockNo);

    SetPropertyListener spl =
    new SetPropertyListener(ActionEvent.class.getName());
    spl.setFrom(clockNo);
    spl.setValueExpression("to", vx);

    // add the listener to the button
    newOpButton.addActionListener(spl);

    My Code:

    af:commandImageLink id="editInsuraceDetLink"
    icon="/resources/images/Edit.jpg"
    iconPosition="trailing"
    rendered="#{not row.deleted}"
    action="addEndorsement"
    useWindow="true"
    inlineStyle="vertical-align:bottom;"
    partialSubmit="true"
    shortDesc="Edit"
    *actionListener="#{pageFlowScope.GetEndorsementTypeListener.execute}"*
    returnListener="#{GetEndorsementDetailsListener.execute}"
    windowEmbedStyle="window"
    windowModalityType="applicationModal"
    windowHeight="650" windowWidth="740"
    /af:commandImageLink

    Action Listener - .GetEndorsementTypeListener.execute code:

    RichCommandImageLink a_button = (RichCommandImageLink) a_component.findComponent("editInsuraceDetLink");
    FacesContext fctx = FacesContext.getCurrentInstance();
    Application application = fctx.getApplication();
    ELContext elContext = fctx.getELContext();
    ExpressionFactory elFactory = application.getExpressionFactory();

    ValueExpression vx = elFactory.createValueExpression(elContext, "#{pageFlowScope.controlFlowName}", String.class);
    // set a default value if desired
    //vx.setValue(elContext, clockNo);

    SetPropertyListener spl = new SetPropertyListener(ActionEvent.class.getName());
    spl.setFrom(a_target.getEndorsementFor().toString());
    spl.setValueExpression("to", vx);

    System.out.println("From= "+spl.getFrom());
    System.out.println("To= "+spl.getValueExpression("to"));

    // add the listener to the button
    a_button.addActionListener(spl);

    I got the following output.

    From= Nominee / Appointee
    To= ValueExpression[#{pageFlowScope.controlFlowName}]

    Now my Problem is: the pageFlowScope variable ControlFlowName is not set.
    And also I got a *link*: https://blogs.oracle.com/vijaymohan/entry/usage_of_setpropertylistener_and_setactionlistener

    Whats wrong with my code. Is my problem related with above *link*.

    Please suggest me how to add SetPropertyListener programmatically.

    -Thanks
    Mohanraj

  • RELEVANCY SCORE 3.29

    DB:3.29:Can Seam Persistence Be Used Without Needing Jsf I.E. From A Base Httpservlet Class? s3



    I'm new to Seam and liking the look of the Persistence mechanism. For the view/presentation side I am using a library which is based around HttpServlet i.e. not JSF based.

    I'm using JBoss AS 7 and Seam 3.1.0.Final

    When I put these together with my Servlet library and get to the first method marked "@Begin" I get an exception because I don't have a ConversationScoped Context defined. I confess, I half expected something like this.

    org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.enterprise.context.ConversationScoped

    I tried a variation of the suggestion in http://stackoverflow.com/questions/4828504/how-to-inject-conversationscoped-beans-in-a-servlet but found that no ConversationContext was set (null pointer).

    Again I half expected this not to work, as I clearly haven't set anything in the http headers for the "cid" part.

    I've also tried following some of the setup for Seam Booking example it uses

    interceptors

    classorg.jboss.seam.faces.context.conversation.ConversationBoundaryInterceptor/class

    /interceptors

    and hence starts to drag in faces stuff - I get this compiled but then get a Weld Deployment Exception

    org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [ELContext] with qualifiers [@Default] at injection point [[parameter 1] of [c

    onstructor] @Inject public org.jboss.solder.el.Expressions(ELContext, ExpressionFactory)]. Possible dependencies [[Producer Method [ELContext] with qualifiers [@Any @Default] decla

    red as [[method] @Produces org.jboss.seam.solder.el.ELContextProducer.createELContext()], Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produce

    s org.jboss.solder.el.ELContextProducer.createELContext()]]]

    So my questions are:

    1) Am I trying to do something that Seam Persistence is not designed for? I see lot's of references which all point to JSF. Is it intimately linked with JSF?

    2) Is there parts of the Seam Library that I can use at App Startup, Session Startup and/or on each Request so that ConversationContext (and other required Contexts) are set?

    I can post other stuff from my application, but I'm not looking to get anyone to debug my app - just a pointer to a good example of Seam Persistence without JSF and/or a good manual.

    Thanks

    DB:3.29:Can Seam Persistence Be Used Without Needing Jsf I.E. From A Base Httpservlet Class? s3


    Jozef

    Not sure whether to open another thread given this may be quite specific to Weld 2 - quite happy to if required

    I'm now trying to add this into my Servlet and Seam Persistence example (to run in your JBoss/Weld 2 Alpha) - can you tell me what library provides the @Begin and @End annotations? My assumption is that these are provided by Seam Faces (in a JSF program) and Weld 2.0.0 (now) for a base Servlet example - is this correct?.

    When I try to compile (with maven) I get "cannot find symbol" (for @Begin and @End) and in Eclipse I get "Begin cannot be resolved to a type".

    My POM now has:

    dependency

    groupIdorg.jboss.seam.persistence/groupId

    artifactIdseam-persistence/artifactId

    version3.1.0.Final/version

    /dependency

    dependency

    groupIdorg.jboss.weld/groupId

    artifactIdweld-core/artifactId

    version2.0.0.Alpha1/version

    /dependency

    and in my "beans.xml" - as per Seam Persistence documentation http://docs.jboss.org/seam/3/persistence/latest/reference/en-US/html/persistence.html#d0e37

    interceptors classorg.jboss.seam.transaction.TransactionInterceptor/class /interceptors

    Cheers

    Dave

  • RELEVANCY SCORE 3.27

    DB:3.27:String Cannot Be Cast To Oracle.Adf.View.Rich.Component.Rich.Fragment cx


    Hi,

    i am getting class cast exception when pressing next button on toolbar. I am using following code of Oracle Fusion developer Guide, which i think have error in line number 7

    private DCIteratorBinding getIteratorBinding() {
    1 FacesContext fctx = FacesContext.getCurrentInstance();
    2 ELContext elctx = fctx.getELContext();
    3 Application app = fctx.getApplication();
    4 ExpressionFactory elFactory = app.getExpressionFactory();
    5 ValueExpression valueExpr = elFactory.createValueExpression(elctx, "{#comp}", Object.class);
    6 RichDeclarativeComponent _this = null;
    7 _this = (RichDeclarativeComponent)valueExpr.getValue(elctx);
    return (DCIteratorBinding)_this.getAttributes().get("Iterator");
    }

    code for next button is as following

    public void nextRow_Action(ActionEvent actionEvent) {

    DCIteratorBinding iter = getIteratorBinding();
    if (iter.getViewObject().hasNext()) {
    iter.getViewObject().next();

    }
    invokeActionListenerExpression(actionEvent);
    }

    the error log is as

    javax.el.ELException: //C:/Users/a/AppData/Roaming/JDeveloper/system11.1.2.3.39.62.76.1/o.j2ee/drs/ToolBarUsage/ViewControllerWebApp.war/untitled1.jsf @8,99
    nextMethod="#{backingBeanScope.ToolBarBean.nextRow_Action}":
    java.lang.ClassCastException: java.lang.String cannot be cast to oracle.adf.view.rich.component.rich.fragment.RichDeclarativeComponent

    DB:3.27:String Cannot Be Cast To Oracle.Adf.View.Rich.Component.Rich.Fragment cx

    Hi,

    the expression in this line is not correct

    ValueExpression valueExpr = elFactory.createValueExpression(elctx, *"{#comp}"*, Object.class);

    The # tag must be before the brackets. Also the error message seems to be wrong because you don't cast this to rich fragment but RichDeclarativeComponent, so the exception should complain about this.

    In addition, I would not navigate on the underlying View Object but the DCIteratorBinding reference if you want to see the change after PPR

    Frank

  • RELEVANCY SCORE 3.18

    DB:3.18:Getting " All Variable Resolvers Have Been Deprecated" Error Message ks


    Hi Experts,

    Currently we have an ADF application (using ADF Faces BC4J) developed on jdeveloper 11.1.2.1. I am getting the following error in the log file

    [ERROR] [] [oracle.adf.share.el.VariableResolverELContext] [tid: [ACTIVE].ExecuteThread: '17' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: 140558] [ecid: 0000012hN6eDSc0Lnyp2iZ01902C001Lc^,0:1] [APP: XXX-application] [URI: /bve/faces/home.jsf] The variable resolver, oracle.adf.model.binding.DCVariableResolverImpl, was used to evaluate expression, data. All variable resolvers have been deprecated. Please consult the documentation for the variable resolver and modify the expression to not depend upon the variable resolver.

    I am using the following code to resolve my expression,

    ADFContext.getCurrent().getExpressionEvaluator().evaluate(expression);

    Is the error due to the above code?

    Apart from that can i use the following

    JSFUtils.resolveExpression("#{XXXXX}");

    which is

    public static Object resolveExpression(String expression) {
    FacesContext facesContext = getFacesContext();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp =
    elFactory.createValueExpression(elContext, expression,
    Object.class);
    return valueExp.getValue(elContext);
    }

    Can we use the FacesContext and JSF related methods inside the ADF application? If yes will that break any ADF page life cycles?

    Thanks

    DB:3.18:Getting " All Variable Resolvers Have Been Deprecated" Error Message ks

    Hi Experts,

    Currently we have an ADF application (using ADF Faces BC4J) developed on jdeveloper 11.1.2.1. I am getting the following error in the log file

    [ERROR] [] [oracle.adf.share.el.VariableResolverELContext] [tid: [ACTIVE].ExecuteThread: '17' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: 140558] [ecid: 0000012hN6eDSc0Lnyp2iZ01902C001Lc^,0:1] [APP: XXX-application] [URI: /bve/faces/home.jsf] The variable resolver, oracle.adf.model.binding.DCVariableResolverImpl, was used to evaluate expression, data. All variable resolvers have been deprecated. Please consult the documentation for the variable resolver and modify the expression to not depend upon the variable resolver.

    I am using the following code to resolve my expression,

    ADFContext.getCurrent().getExpressionEvaluator().evaluate(expression);

    Is the error due to the above code?

    Apart from that can i use the following

    JSFUtils.resolveExpression("#{XXXXX}");

    which is

    public static Object resolveExpression(String expression) {
    FacesContext facesContext = getFacesContext();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp =
    elFactory.createValueExpression(elContext, expression,
    Object.class);
    return valueExp.getValue(elContext);
    }

    Can we use the FacesContext and JSF related methods inside the ADF application? If yes will that break any ADF page life cycles?

    Thanks

  • RELEVANCY SCORE 3.09

    DB:3.09:Client Listener On Mouseover df


    Hello,

    I posted in a wrong forum previously, I am posting it here again..Kindly reply.

    Requirement : I need to Create a command button and when you hover your mouse on it, a function has to be called . Everything has to be done programmatically.

    My Procedure: I have already created a RichCommandButton programmatically with a binding to a method(HandleImagePress) which triggers when I click the button. This method inturn creates, populates and displays the necessary information in the form of a popup. However , With the new requirement, I am just supposed to hover onto my button to trigger this method (HandleImagePress). I believe I need to create ClientListener and so I tried it. But it doesnt work the way I want ...

    This is what I have tried:
    public void handleImagePress(ActionEvent event){
    // There is code to create , populate and display and popup . It works fine
    }

    private UIComponent ImageButton(UIComponent parent){
    RichCommandButton img = new RichCommandButton();
    String imagestyle = "width:120pt; height:120.0pt;margin:10.0pt;";
    img.setInlineStyle(imagestyle);
    // Compose method expression to invoke action event handler when button is pressed.
    FacesContext fctx = FacesContext.getCurrentInstance();
    Application application = fctx.getApplication();
    ExpressionFactory elFactory = application.getExpressionFactory();
    ELContext elContext = fctx.getELContext();
    MethodExpression methodExpression =null;
    // Make sure the EL expression references a valid managed bean method. Ensure the bean scope is properly addressed.
    methodExpression = elFactory.createMethodExpression( elContext,"#{pageFlowScope.pinint.handleImagePress}",Object.class,new Class[] {ActionEvent.class});
    // Create the command button action listener reference.
    MethodExpressionActionListener al = null;
    al= new MethodExpressionActionListener(methodExpression);
    img.addActionListener(al);
    // Add new command button to parent component and PPR the component for the button to show.
    parent.getChildren().add(img);
    ClientListenerSet set = img.getClientListeners();
    if (set == null) {
    set = new ClientListenerSet();
    img.setClientListeners(set);
    }
    set.addBehavior("new AdfShowPopupBehavior('popup',AdfRichPopup.ALIGN_AFTER_END,null,'mouseOver')");
    // set.addListener("mouseOver", "handleImagePress");
    AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
    adfFacesContext.addPartialTarget(parent);
    return img;
    }

    With this code, I need to click on image atleast once to create a popup . Is it possible to call the method without clicking but by just hovering on it? (bcoz the HandleImagePress method takes care of everything regarding to popup)

    Help will be greatly appreciated

    Thank You

    DB:3.09:Client Listener On Mouseover df

    I have tried adding a Mouse event instead of an Actionevent this way ..

    public void handleImagePress(MouseEvent event){
    int m = event.MOUSE_ENTERED;
    System.out.println(m);
    System.out.println("--mouse clicked");
    System.out.println(event.MOUSE_CLICKED);
    //code to create , display, popup
    }

    private UIComponent ImageButton(UIComponent parent){
    //I have changed the following line..
    methodExpression = elFactory.createMethodExpression( elContext,"#{pageFlowScope.pinint.handleImagePress}",Object.class,new Class[] {MouseEvent.class});
    }

    But it complains java.lang.IllegalArgumentException: argument type mismatch, when I click on the button.

    Please let me know of a work around with this issue.

  • RELEVANCY SCORE 3.06

    DB:3.06:Checkbox + A4j:Commandlink Select 8c



    Hello.

    I have several dynamically generated checkboxes which I need to check/uncheck using a4j:commandLink . Here is part of the code which is used to generate the checkboxes:

    MethodExpression checkboxValueChangeExpression = expressionFactory
    .createMethodExpression(elContext,
    "#{bean.checkBoxClicked}", null,
    new Class[] { ActionEvent.class });
    MethodExpressionActionListener checkboxValueChangeListener = new MethodExpressionActionListener(
    checkboxValueChangeExpression);

    HtmlSelectBooleanCheckbox checkBox = new HtmlSelectBooleanCheckbox();
    String checkboxId = "checkBox_id_" + getNumber();
    checkBox.setId(checkboxId);
    checkBox.setSelected(false);
    checkBox.setStyleClass("checkbox");

    HtmlAjaxSupport asCheckbox = new HtmlAjaxSupport();
    String ajaxCheckboxId = AJAX_CHECBOX_ID_PREFIX
    + getNumber();
    asCheckbox.setId(ajaxCheckboxId);
    asCheckbox.setEvent("onclick");
    asCheckbox.addActionListener(checkboxValueChangeListener);

    checkboxValues.put(ajaxCheckboxId, false);

    ValueExpression checkBoxValueExpression = expressionFactory
    .createValueExpression(elContext, "#{bean.checkboxValues."
    + ajaxCheckboxId + "}", Boolean.class);
    checkBox.setValueExpression("value", checkBoxValueExpression);
    checkBox.getChildren().add(asCheckbox);

    DB:3.06:Checkbox + A4j:Commandlink Select 8c


    Hi again.

    Here are some strange observations...

    Actually I have construction like that:

    ui:define ..

    a4j:form id="form1"

    h:panelGroup layout="block" id="test"

    ... some generaeted content (see the post above) ...

    /a4j:form

    /ui:define

    ui:define ..

    a4j:form id="form2"

    a4j:commandLink ... reRender="test" ...

    /a4j:form

    /ui:define

    When the page is loaded and I try to use the command link from form2 it does not work (it calls the backing bean and changes the checkbox value holder but does not refresh the UI). When I manually click on a checkbox then everything starts working and the command link refreshes the form1 UI.

    I hope that I am not writing only to myself and someone can give me a hand

  • RELEVANCY SCORE 3.06

    DB:3.06:Clientlistener On Button - Programmatically sz


    Hello,

    Requirement : I need to Create a command button and when you hover your mouse on it, a function has to be called . Everything has to be done programmatically.

    My Procedure: I have already created a RichCommandButton programmatically with a binding to a function(HandleImagePress) which triggers when I click the button. This function inturn creates, populates and displays the necessary information in the form of a popup. However , With the new requirement, I am just supposed to hover onto my button to trigger this function (HandleImagePress). I believe I need to create ClientListener and so I tried it. But it doesnt work the way I want ... :-(

    This is what I have tried:

    public void handleImagePress(ActionEvent event){
    // There is code to create , populate and display and popup . It works fine
    }

    private UIComponent ImageButton(UIComponent parent){
    RichCommandButton img = new RichCommandButton();
    String imagestyle = "width:120pt; height:120.0pt;margin:10.0pt;";
    img.setInlineStyle(imagestyle);
    // Compose method expression to invoke action event handler when button is pressed.
    FacesContext fctx = FacesContext.getCurrentInstance();
    Application application = fctx.getApplication();
    ExpressionFactory elFactory = application.getExpressionFactory();
    ELContext elContext = fctx.getELContext();
    MethodExpression methodExpression =null;
    // Make sure the EL expression references a valid managed bean method. Ensure the bean scope is properly addressed.
    methodExpression = elFactory.createMethodExpression( elContext,"#{pageFlowScope.pinint.handleImagePress}",Object.class,new Class[] {ActionEvent.class});
    // Create the command button action listener reference.
    MethodExpressionActionListener al = null;
    al= new MethodExpressionActionListener(methodExpression);

    img.addActionListener(al);
    // Add new command button to parent component and PPR the component for the button to show.
    parent.getChildren().add(img);
    ClientListenerSet set = img.getClientListeners();
    *if (set == null) {*
    set = new ClientListenerSet();
    img.setClientListeners(set);
    *}*

    set.addBehavior("new AdfShowPopupBehavior('popup',AdfRichPopup.ALIGN_AFTER_END,null,'mouseOver')");
    // set.addListener("mouseOver", "handleImagePress");
    AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
    adfFacesContext.addPartialTarget(parent);
    return img;

    }

    With this code, I need to click on image atleast once to create a popup . Is it possible to call the function without clicking but by just hovering on it? (bcoz the HandleImagePress function takes care of everything regarding to popup)

    Help will be greatly appreciated :-)

    Thank You

    DB:3.06:Clientlistener On Button - Programmatically sz

    Thank You for the reply, I have created a command button in Jdeveloper, ADF Faces component. It doesn't have "addMouseMotionListener" . So i have tried this way,

    import java.awt.event.MouseEvent;
    import java.awt.event.MouseMotionListener;
    I have tried adding a Mouse event instead of an Actionevent this way ..

    public void handleImagePress(MouseEvent event){
    int m = event.MOUSE_ENTERED;
    System.out.println(m);
    System.out.println("--mouse clicked");
    System.out.println(event.MOUSE_CLICKED);
    //code to create , display, popup
    }

    private UIComponent ImageButton(UIComponent parent){
    //I have changed the following line..
    methodExpression = elFactory.createMethodExpression( elContext,"#{pageFlowScope.pinint.handleImagePress}",Object.class,new Class[] {MouseEvent.class});
    }

    But it complains java.lang.IllegalArgumentException: argument type mismatch, when I click on the button.

    Please let me know of a work around with this issue.

  • RELEVANCY SCORE 3.06

    DB:3.06:Weld-001409 Ambiguous Dependencies For Type Elcontext sk


    Hello, I'm getting a "WELD-001409 Ambiguous dependencies for type [ELContext] with qualifiers [@Default]" error message when trying to deploy a 3.1.0.Beta5 SEAM3 project under JBOSS 7.0.2. Any ideas why this might happen? Below the stack trace you'll find my pom.xml.As I'm new to SEAM3/WELD, your help is really appreciated.Hubert21:35:21,560 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.deployment.unit."owl2.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."owl2.war".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [ELContext] with qualifiers [@Default] at injection point [[parameter 1] of [constructor] @Inject public org.jboss.solder.el.Expressions(ELContext, ExpressionFactory)]. Possible dependencies [[Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.jboss.solder.el.ELContextProducer.createELContext()], Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.jboss.seam.solder.el.ELContextProducer.createELContext()]]] at org.jboss.as.weld.services.WeldService.start(WeldService.java:96) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.7.0] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.7.0] at java.lang.Thread.run(Thread.java:722) [:1.7.0]Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [ELContext] with qualifiers [@Default] at injection point [[parameter 1] of [constructor] @Inject public org.jboss.solder.el.Expressions(ELContext, ExpressionFactory)]. Possible dependencies [[Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.jboss.solder.el.ELContextProducer.createELContext()], Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.jboss.seam.solder.el.ELContextProducer.createELContext()]]] at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:274) at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:106) at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:129) at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:351) at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:336) at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:404) at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:82) at org.jboss.as.weld.services.WeldService.start(WeldService.java:89) ... 5 more---POM----?xml version="1.0" encoding="UTF-8"?project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" modelVersion4.0.0/modelVersion groupIdnet.hrrbrt.owl/groupId artifactIdowl2/artifactId version1.0.0-SNAPSHOT/version packagingwar/packaging properties seam.version3.1.0.Beta5/seam.version /properties dependencies dependency groupIdorg.jboss.seam/groupId artifactIdseam-bom/artifactId version${seam.version}/version scopeimport/scope typepom/type /dependency dependency groupIdjavax.enterprise/groupId artifactIdcdi-api/artifactId version1.0-SP4/version /dependency dependency groupIdorg.jboss.spec/groupId artifactIdjboss-javaee-6.0/artifactId version2.0.0.Final/version typepom/type scopeprovided/scope /dependency dependency groupIdorg.springframework/groupId artifactIdspring/artifactId version2.5.5/version /dependency dependency groupIdorg.metawidget.forge/groupId artifactIdmetawidget-forge-scaffold/artifactId version1.0.0-SNAPSHOT/version exclusions exclusion artifactIdseam-persistence/artifactId groupIdorg.jboss.seam.persistence/groupId /exclusion /exclusions /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-entitymanager/artifactId version3.6.6.Final/version scopeprovided/scope /dependency dependency groupIdjunit/groupId artifactIdjunit/artifactId version4.10/version scopetest/scope /dependency dependency groupIdorg.jboss.arquillian.junit/groupId artifactIdarquillian-junit-container/artifactId version1.0.0.Final-SNAPSHOT/version scopetest/scope /dependency dependency groupIdorg.jboss.seam.security/groupId artifactIdseam-security/artifactId version${seam.version}/version exclusions exclusion artifactIdseam-persistence/artifactId groupIdorg.jboss.seam.persistence/groupId /exclusion /exclusions /dependency dependency groupIdorg.jboss.seam.persistence/groupId artifactIdseam-persistence/artifactId version${seam.version}/version /dependency dependency groupIdorg.jboss.seam.remoting/groupId artifactIdseam-remoting/artifactId version${seam.version}/version /dependency dependency groupIdorg.jboss.seam.faces/groupId artifactIdseam-faces/artifactId version${seam.version}/version /dependency dependency groupIdorg.richfaces.core/groupId artifactIdrichfaces-core-impl/artifactId version4.1.0-SNAPSHOT/version /dependency dependency groupIdorg.richfaces.ui/groupId artifactIdrichfaces-components-ui/artifactId version4.1.0.20111101-M4/version /dependency dependency groupIdcom.drewnoakes/groupId artifactIdmetadata-extractor/artifactId version2.3.1/version /dependency dependency groupIdjoda-time/groupId artifactIdjoda-time/artifactId version1.6/version /dependency dependency groupIdcom.ocpsoft/groupId artifactIdprettyfaces-jsf2/artifactId version3.3.0/version /dependency /dependencies repositories repository idJBOSS_NEXUS/id urlhttp://repository.jboss.org/nexus/content/groups/public/url /repository repository idmaven2/id urlhttp://uk.maven.org/maven2//url /repository /repositories build finalNameowl2/finalName plugins plugin artifactIdmaven-compiler-plugin/artifactId version2.3.2/version configuration source1.6/source target1.6/target /configuration /plugin plugin artifactIdmaven-war-plugin/artifactId configuration failOnMissingWebXmltrue/failOnMissingWebXml /configuration /plugin !-- This plugin config is used to set the Dependencies entry in META-INF/MANIFEST.MF so that in AS7 both JBoss Logging and the JBoss Log manager will be available in the classpath -- plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-jar-plugin/artifactId configuration archive manifestEntries Dependenciesorg.jboss.logging,org.jboss.logmanager/Dependencies /manifestEntries /archive /configuration /plugin /plugins /build profiles profile idarq-jbossas-7-managed/id dependencies dependency groupIdorg.jboss.as/groupId artifactIdjboss-as-arquillian-container-managed/artifactId version7.0.2.Final/version scopetest/scope /dependency /dependencies /profile /profiles/project

    DB:3.06:Weld-001409 Ambiguous Dependencies For Type Elcontext sk

    Fixed now. I did not succeed with including JBOSS FORGE as a whole, but I had to cut down the dependencies from ocpsoft and take their latest subproject SNAPSHOTs.
    Thanks again!

  • RELEVANCY SCORE 2.98

    DB:2.98:Accessing Adf Ui Components Programmatically f8


    How can I locate an ADF UI component by its ID and get access to it programmatically, without using the Binding property?
    What's wrong with the following code?

    public void onButtonPressed(ActionEvent actionEvent) {
    FacesContext fc = FacesContext.getCurrentInstance();
    ELContext elctx = fc.getELContext();
    ExpressionFactory ef = fc.getApplication().getExpressionFactory();
    ValueExpression ve = ef.createValueExpression(elctx, "#{it1}", UIXComponent.class);
    RichInputText it = (RichInputText)ve.getValue(elctx);
    System.out.println(it.getAttributes().get("label"));
    it.setValue("hehe");
    }

    "it1" is the Id of my InputText.

    Edited by: Alex on Oct 30, 2011 11:54 PM

    DB:2.98:Accessing Adf Ui Components Programmatically f8

    Come to think of it, I have no reason not to use binding property.

  • RELEVANCY SCORE 2.96

    DB:2.96:How To Assign A Value To Attribute Column In Adf Table 88


    hi all,

    BindingContext ctx = BindingContext.getCurrent();
    DCBindingContainer bc = (DCBindingContainer)ctx.getCurrentBindingsEntry();
    DCIteratorBinding iterator = bc.findIteratorBinding("StudentVO1Iterator");
    Row r = iterator.getCurrentRow();

    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp =
    elFactory.createValueExpression(elContext,"#{data.StudentAMDataControl.dataProvider}",Object.class);
    StudentAMImpl amest= (StudentAMImpl)valueExp.getValue(elContext);
    String newno = amest.getEstNoGenerate();

    System.out.println("new no "+newno);
    r.setAttribute("StudentNo", newno);

    BindingContext ctxdet = BindingContext.getCurrent();
    DCBindingContainer bcdet = (DCBindingContainer)ctxdet.getCurrentBindingsEntry();
    DCIteratorBinding iterdet = bcdet.findIteratorBinding("StudentDetailVO1Iterator");
    Row rdet = iterdet.getCurrentRow();
    System.out.println("row "+rdet); //print null
    rdet.setAttribute("DtlStudentNo", newno);

    in above code my header part can assign returning value, but detail level it can not assign . which shows nullpointer exception. because Row rdet object become null. why this happen?? this come out when i press a button.
    i code tin in backing bean and running on jdeveloper 11g 2 release version..
    hopping help.. anyone who know..
    thanks.

    DB:2.96:How To Assign A Value To Attribute Column In Adf Table 88

    A good starting point are the docs (http://docs.oracle.com/cd/E28280_01/web.1111/b31974/bcentities.htm#sm0126).
    Sample http://dstas.blogspot.de/2011/10/master-detail-data-presentation-and.html

    Timo

  • RELEVANCY SCORE 2.91

    DB:2.91:Creating Valueexpression For Jstl Functions 3j


    When JSTL function -#{fn:length('Test Name')}
    is being used to create a ValueExpression (javax.el.ValueExpression), with the code snippet below,
    it fails with
    javax.faces.validator.ValidatorException: Error in Expression -Function not found exception.

    FacesContext fc = FacesContext.getCurrentInstance();
    ELContext etx = fc.getELContext();
    ExpressionFactory expFac = fc.getApplication().getExpressionFactory();
    ValueExpression valExpr = expFac.createValueExpression(etx, "#{fn:length('Test Name')}" ,Object.class);

    Can you please suggest how this can be resolved?
    Should I look at different context objects/ extra information need to be sent across while creating ValueExpression?

    thanks,
    Vidhya

    DB:2.91:Creating Valueexpression For Jstl Functions 3j

    When JSTL function -#{fn:length('Test Name')}
    is being used to create a ValueExpression (javax.el.ValueExpression), with the code snippet below,
    it fails with
    javax.faces.validator.ValidatorException: Error in Expression -Function not found exception.

    FacesContext fc = FacesContext.getCurrentInstance();
    ELContext etx = fc.getELContext();
    ExpressionFactory expFac = fc.getApplication().getExpressionFactory();
    ValueExpression valExpr = expFac.createValueExpression(etx, "#{fn:length('Test Name')}" ,Object.class);

    Can you please suggest how this can be resolved?
    Should I look at different context objects/ extra information need to be sent across while creating ValueExpression?

    thanks,
    Vidhya

  • RELEVANCY SCORE 2.91

    DB:2.91:Creating Valueexpression For Jstl Functions 3c


    When JSTL function -#{fn:length('Test Name')}
    is being used to create a ValueExpression (javax.el.ValueExpression), with the code snippet below,
    it fails with
    javax.faces.validator.ValidatorException: Error in Expression -Function not found exception.

    FacesContext fc = FacesContext.getCurrentInstance();
    ELContext etx = fc.getELContext();
    ExpressionFactory expFac = fc.getApplication().getExpressionFactory();
    ValueExpression valExpr = expFac.createValueExpression(etx, "#{fn:length('Test Name')}" ,Object.class);

    Can you please suggest how this can be resolved?
    Should I look at different context objects/ extra information need to be sent across while creating ValueExpression?

    TIA,
    Vidhya

    Edited by: vidhya.sundaram on Sep 13, 2010 11:25 PM

    DB:2.91:Creating Valueexpression For Jstl Functions 3c

    You could start by specifying the correct return type.

  • RELEVANCY SCORE 2.91

    DB:2.91:Can't Get Custom Component Attribute In Phaselistener 8c


    Hi,

    I have custom component that contains PhaseListener. I wand to get component attributes inside this PhaseListener but I get null pointer exeption. This is my code:

    public class CustomPhaseListener implements PhaseListener{

    public void afterPhase(PhaseEvent phaseEvent) {

    String fileName = (String)getComponentAttribute("FileName"); *{color:#ff0000}// I have null pointer exception here{color}*
    BlobDomain image = (BlobDomain)getComponentAttribute("BlobImage");

    }

    protected Object getComponentAttribute(String attributeName){
    UIXDeclarativeComponent comp = (UIXDeclarativeComponent )getValueObject("#{component}", UIXDeclarativeComponent .class);
    return comp.getAttributes().get(attributeName);
    }

    protected Object getValueObject(String expr, Class returnType){
    FacesContext fc = FacesContext.getCurrentInstance();
    ELContext elctx = fc.getELContext();
    ExpressionFactory elFactory = fc.getApplication().getExpressionFactory();
    ValueExpression valueExpr = elFactory.createValueExpression(elctx,expr,returnType);
    return valueExpr.getValue(elctx);
    }

    public void beforePhase(PhaseEvent phaseEvent) {
    }

    public PhaseId getPhaseId() {
    return PhaseId.RESTORE_VIEW;
    }

    DB:2.91:Can't Get Custom Component Attribute In Phaselistener 8c

    Hi Frank

    Could you give this code fragment, please. It's important for me, beacause I think I fonund solution how to display blob image without writing servlet in all applications.

    Kuba

  • RELEVANCY SCORE 2.90

    DB:2.90:Creating Actionevent To The Button On The Javabean Page a3


    Hi,

    public String cb1_action() {
    // Add event code here...
    System.out.println("in cb1_action3 - 1");
    UIComponent button;
    button = findComponentInRoot("cb1");
    RichPanelGroupLayout pgl;
    pgl = (RichPanelGroupLayout)button.getParent();
    ListUIComponent children;
    children = pgl.getChildren();
    RichPanelGroupLayout pgll;
    pgll = new RichPanelGroupLayout();
    RichInputText it;
    it = new RichInputText();
    it.setLabel("New textbox " + (children.size()));
    RichCommandButton but = new RichCommandButton();
    but.setPartialSubmit(true);
    but.setText("Delete");
    /*calling actionevent*/
    FacesContext facesCtx = FacesContext.getCurrentInstance();
    Application application = facesCtx.getApplication();
    ExpressionFactory elFactory = application.getExpressionFactory();
    ELContext elContext = facesCtx.getELContext();
    MethodExpression methodExpression = null;
    methodExpression =
    elFactory.createMethodExpression(elContext, "#{mybean.handleButtonPress}",
    Object.class,
    new Class[] { ActionEvent.class });
    MethodExpressionActionListener al = null;

    al = new MethodExpressionActionListener(methodExpression);
    but.addActionListener(al);

    /*end of action eventl*/

    children.add(pgll)
    children.add(it);
    children.add(but);
    AdfFacesContext.getCurrentInstance().addPartialTarget(pgl);
    System.out.println("in cb1_action3 - 1 done");
    return null;
    }
    public void handleButtonPress() {
    System.out.println("Event handled");
    }

    I have added the actionlistener code which you had given here. but its not working.can you please help me debugging the error?
    I want to delete INPUTTEXT component which i m creating along with the button to be deleted on the delete button click. i mean both INPUTTEXT component and delete button both should get deleted on the click of that button????????? i m able to create delete button and input text field successfully using some other common button.....

    Edited by: chaya on Dec 21, 2011 10:36 AM

    Edited by: chaya on Dec 21, 2011 10:38 AM

  • RELEVANCY SCORE 2.90

    DB:2.90:Could Not Find The Component With Scopedid sx


    Hi.,

    i am using jdeveloper 11.1.1.5
    I had drgged and dropped a adf quick query component
    I had dragged and dropped a command button in my jsff page Which performs the operation of a query component
    I had used this method in my AMImpl Method

    public Boolean setAdvancedMode(){
    String expression = "#{bindings.GlJrnlHdVOCriteriaQuery.queryDescriptor}";
    FacesContext facesContext = getFacesContext();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp =
    elFactory.createValueExpression(elContext, expression,
    Object.class);
    QueryDescriptor descriptor =
    (QueryDescriptor)valueExp.getValue(elContext)
    ;
    descriptor.changeMode(QueryDescriptor.QueryMode.ADVANCED);
    return true;
    }

    private FacesContext getFacesContext() {
    return FacesContext.getCurrentInstance();
    }I am calling this using my action event of tthis command button
    public void setAdvancedMode(ActionEvent actionEvent) {
    // Add event code here...
    FacesContext fc = FacesContext.getCurrentInstance();
    OperationBinding op = bc.getOperationBinding("setAdvancedMode");
    Object r = op.execute();
    }I am getting the error as

    Could not find the component with scopedId ::qq1 from RichPanelFormLayout[UIXFacesBeanImpl, id=pfl1] with the supported syntax. The component was found with the deprecated syntax. Please use the supported syntax.could any one help me to solve this issue

    My Scenario is

    When i click my command button it must turn the quickQuery component into a full query component

    I had verified this link for my scenario to be acheived
    http://vtkrishn.wordpress.com/tag/afquery/In this i had used the method from this topic
    How to set the query mode for the af:query component programatically

    DB:2.90:Could Not Find The Component With Scopedid sx

    Hi,

    not quite clear of the problem you face, but the doc (http://docs.oracle.com/cd/E16162_01/apirefs.1112/e17491/tagdoc/af_quickQuery.html) says that

    end

    This facet usually specifies a commandLink component that is used to toggle between quickQuery and query component.

    The following example explains the usage of quickQuery Component.

    af:quickQuery label="Search" id="search"
    value="bean.queryDescriptor"
    queryListener="bean.processQuery"
    f:facet name="end"
    af:commandLink text="Advanced"/
    /f:facet
    /af:quickQuery

    So I added a link to the end facet and added an af:query component as an immediate sibling of the af:quickQuery component. I set the af:query component rendered property to "false" and the quickQuery one to true. Then, in a managed bean referenced from the command link action listener (end facet) I performed

    public void toggleQuickQueryToAdvancedQuery(ActionEvent actionEvent){
    RichCommandLink advancedLink = (RichCommandLink) actionEvent.getSource();
    RichQuickQuery richQuickQuery = (RichQuickQuery) advancedLink.getParent();

    RichQuery richQuery = (RichQuery) richQuickQuery.getParent().findComponent("qryId2");
    richQuery.setRendered(true);

    richQuickQuery.setRendered(false);

    AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
    //refresh container
    adfFacesContext.addPartialTarget(advancedLink.getParent().getParent());
    }Frank

  • RELEVANCY SCORE 2.85

    DB:2.85:Get Selected Value Of Dynamic Combobox. pc



    Hi all,

    In my application I am generating UI components dynamically based on the value that user selects from a combo box.The dynamically generated components are mainly InputNumberSpinner and HtmlComboBox.My requirement is ,based on the values selected in the dynamically generated combobox I want to rerender my UI with some more components.For this I have one method which will be called onlistclose of the dynamic comboboxes.

    This I have done as shown:

    FacesContext facesContext = FacesContext.getCurrentInstance();ELContext elContext = facesContext.getELContext();Application application = facesContext.getApplication();ExpressionFactory expFactory = application.getExpressionFactory();

    MethodExpression methodExp = expFactory.createMethodExpression(elContext,"#{myBean.someFn()}", null,new Class[] { ActionEvent.class });

    ActionListener aListener =new MethodExpressionActionListener(methodExp);

    HtmlAjaxSupport ajaxSupport =new HtmlAjaxSupport();

    ajaxSupport.addAjaxListener(aListener);ajaxSupport.setEvent("onlistclose");comboBoxComponent.getChildren().add(ajaxSupport);myGrid.getChildren().add(comboBoxComponent);

    The function someFn() in the bean calss is getting called on list close of dynamic combo boxes.But how can I get the selected values of the dynamic comboboxes in the function so that I can decide on what should be done next?

    If anyone have any idea please help.

    Thanks in advance,

    Deeps.

  • RELEVANCY SCORE 2.82

    DB:2.82:Rich:Columns Dynamic Components Binding 73



    Hi,I changed code from examples: rich:dataTable value="#{dataTableScrollerBean.model}" var="model" width="750" f:facet name="header" h:outputText value="Cars Available"/ /f:facet rich:columns value="#{dataTableScrollerBean.columns}" var="columns" index="ind" sortBy="#{model[ind].price}" f:facet name="header" h:outputText value="#{columns.header}"/ /f:facet h:outputText binding="#{dataTableScrollerBean.text}"/ h:outputText value="#{model[ind].mileage} miles "/ h:outputText value="#{model[ind].price}$" style="font-style:italic;"/ /rich:columns /rich:dataTablein backing bean method was add private HtmlOutputText retVal; public HtmlOutputText getText() { if (retVal == null) { retVal = (HtmlOutputText) FacesContext .getCurrentInstance() .getApplication() .createComponent(HtmlOutputText.COMPONENT_TYPE); FacesContext ctx = FacesContext.getCurrentInstance(); ELContext elCtx = ctx.getELContext(); ExpressionFactory ef = ctx.getApplication().getExpressionFactory(); ValueExpression ve = ef.createValueExpression(elCtx, "#{model[ind].model}", String.class); retVal.setValueExpression("value", ve); } return retVal; }but binding doesn't work. OutputText with binding doesn't visible. What is wrong? This is a bag?

    DB:2.82:Rich:Columns Dynamic Components Binding 73


    Hi,The problem is that you use outputText bound on the same bean variable.I detected that outputText displays only for the last column in this case.So, don't use the same variable. Create the new htmlOutput instance for each column:
    public HtmlOutputText getText() {
    HtmlOutputText retVal = null;
    if (retVal == null) {
    retVal = (HtmlOutputText) FacesContext.getCurrentInstance()
    .getApplication().createComponent(
    HtmlOutputText.COMPONENT_TYPE);
    FacesContext ctx = FacesContext.getCurrentInstance();
    ELContext elCtx = ctx.getELContext();
    ExpressionFactory ef = ctx.getApplication().getExpressionFactory();
    ValueExpression ve = ef.createValueExpression(elCtx,
    "#{model[ind].model}", String.class);
    retVal.setValueExpression("value", ve);
    }
    return retVal;
    }

  • RELEVANCY SCORE 2.79

    DB:2.79:How To Resolve #{Row} Of Af:Table In Custom Tag Class? 3m


    Hi all,

    My customer creates custom converter tag with some attributes. When they use it outside af:table, it works as expected.
    However when they use it in af:table and set "#{row.value}" into the tag's attribute, it doesn't work because it can't resolve #{row} EL expression.
    The method they wrote is like below.

    ***********************************************************************
    private Object getExpressionValue(ValueExpression expression) {
    if (expression == null) {
    return null;
    }

    final ELContext elContext =
    FacesContext.getCurrentInstance().getELContext();
    return expression.getValue(elContext);
    }
    ***********************************************************************

    Does anyone know the way to do resolve #{row} expresison in custom tag class?
    If you share sample codes, it will be much appreciated.

    Regards,
    Atsushi

    DB:2.79:How To Resolve #{Row} Of Af:Table In Custom Tag Class? 3m

    Hi,

    Thanks for your reply.
    I understood that #{row} is a temporary variable.
    My customer is now developing custom client converter. And the converter's custom tag has some attributes.
    They're trying to change conversion conditions dynamically by setting EL expression into the attributes.
    It seems to work usually but doesn't inside table.
    So I asked you the reason here.

    Thanks again,
    Atsushi

  • RELEVANCY SCORE 2.79

    DB:2.79:Adf Uploadedfile Not Working xz


    I can get UploadedFile value in ValueChangeEvent but I lost this value in another method. I colud not find any solution ?

    Example code is ,

    //working method
    public void fileUploaded(ValueChangeEvent valueChangeEvent) throws IOException {
    if (fileList == null || fileList.size() == 0) {
    fileList = new ArrayList();
    }

    UploadedFile file = (UploadedFile)valueChangeEvent.getNewValue();
    GidecekDokuman record = (GidecekDokuman)dataTable.getRowData();
    record.setFile1(file);
    record.setUpdate(true);
    if (gidecekDokumanList.contains(record)) {
    int index = gidecekDokumanList.indexOf(record);
    gidecekDokumanList.set(index, record);
    fileList.add(file);
    //I can get the file value of the file variable
    }
    if (file != null) {
    long sizeOfFile = file.getLength();
    }
    }

    // not working methd
    public String commandButton_action() throws IdcClientException,
    IOException, Exception {

    FacesContext facesCtx = FacesContext.getCurrentInstance();
    Application app = facesCtx.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesCtx.getELContext();

    int tmpSize = fileList.size();
    GidecekDokuman doc = null;
    for (int i = 0; i gidecekDokumanList.size(); i++) {
    doc = (GidecekDokuman)gidecekDokumanList.get(i);
    if (doc.getFile1() != null) {
    System.out.println(doc.getFile1().getFilename());
    doc.getFile1 -value is null and length is 0

    }

    return null;

    }

    Please help ,

    DB:2.79:Adf Uploadedfile Not Working xz

    Hi,

    JDeveloper version is 11G and I use the pageScope for the bean,

    thx,

  • RELEVANCY SCORE 2.79

    DB:2.79:How To Get List Of All Jsf Beans cs


    How can one get a list of all JSF beans?

    To get a particular JSF bean one does

    static public Object findJSFBean(String beanName)
    {
    FacesContext fc = FacesContext.getCurrentInstance();
    if (fc== null) return null;
    ELContext elContext = fc.getELContext();
    Application app = fc.getApplication();
    ELResolver elResolver = app.getELResolver();
    Object result = elResolver.getValue(elContext, null, beanName);
    return result;
    }Edited by: sn72 on Sep 2, 2008 5:49 PM

    DB:2.79:How To Get List Of All Jsf Beans cs

    That's the old JSF 1.0/1.1 way and is only useful if you don't know the scope of the bean.

  • RELEVANCY SCORE 2.78

    DB:2.78:Seam-Mail 3.1. And Pom Dependency Problem 8s



    Hello,

    I tried to install seam mail in my J2ee project with Eclipse Indigo and JBoss 7.1.1. I use embedded maven 3.0.2.

    Using http://docs.jboss.org/seam/3/mail/snapshot/reference/en-US/html_single/

    I think that also others will stumble over the following problem:

    My maven does not like the version variable in the pom.xml here:
    dependency groupIdorg.jboss.seam.mail/groupId artifactIdseam-mail-impl/artifactId version${seam.mail.version}/version /dependency
    The version is not resolved. I had to replace it with 3.1.0.Beta3. Then it works (well, seems to...)

    The following does better and uses the 3.1.1.Final Version

    dependency

    groupIdorg.jboss.seam.mail/groupId

    artifactIdseam-mail/artifactId

    version3.1.1.Final/version

    /dependency

    But this throws an exception on startup:

    org.jboss.msc.service.StartException in service jboss.deployment.unit."XX.war".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [ELContext] with qualifiers [@Default] at injection point [[parameter 1] of [constructor] @Inject public org.ocpsoft.rewrite.cdi.expressions.Expressions(ELContext, ExpressionFactory)]. Possible dependencies [[Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.jboss.solder.el.ELContextProducer.createELContext()], Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.ocpsoft.rewrite.cdi.expressions.ELContextProducer.createELContext()]]]

    So ist Solder incompatible with ocpsoft.rewrite? I cannot believe this, since ocpsoft.rewrite is used by richfaces: It seems to be needed by the push mechanism (atmosphere).

    Regards

    Frank Ruenagel

    Text added after "The following does better...." from Frank Ruenagel

    DB:2.78:Seam-Mail 3.1. And Pom Dependency Problem 8s


    not to throw seam-mail 3 under the bus or anything because version 2 was great, but the truth is they didnt make it much easier than straigh java mail api. i had so many problems with context and the templating not being bundled i eventially just cut seam-mail out of my javaee6 probjects. it would be nice to see a working example with 3.1.1.Final but truth is they arent working on this stuff anymore.

  • RELEVANCY SCORE 2.78

    DB:2.78:Re: Anyone Get Tomcat 6.0 To Work With Jsf 1.2? 8k


    this pops up on my tomcat

    WARNING: JSF1033: Resource injection is DISABLED.
    Dec 27, 2006 9:01:58 AM com.sun.faces.config.ConfigureListener registerELResolve
    rAndListenerWithJsp
    SEVERE: Error Instantiating ExpressionFactory

    DB:2.78:Re: Anyone Get Tomcat 6.0 To Work With Jsf 1.2? 8k

    I think there is problem with .jar files. Tomcat 6.0.x includes builtin el.jar files. so dont include in your application. Just put jsf-ri and jsf-impl jar files and compile.....

    i tried on tomcat 6.0.14. It is working properly...( Just dont include el jar files....include jsf libaraies
    and other lib files like bean utils uploading,logging... and appliaction specific jar files...)
    thanks,
    Sameer

    Edited by: sampro.bang on Sep 12, 2008 11:33 AM

  • RELEVANCY SCORE 2.78

    DB:2.78:Testing Cdi Beans With Elcontext And Expressionfactory 19



    (this is a copy of my question on Stackoverflow)

    I want to test some CDI beans which use javax.el.ElContext andjavax.el.ExpressionFactory.

    Until now, here is how I test my CDI beans :
    @RunWith(Arquillian.class)public class MyCDIBeanTest { @Deployment public static JavaArchive createTestArchive() { return ShrinkWrap .create(JavaArchive.class, "test.jar") .addClasses(MyCDIBean.class) .addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")); } ...Here is my current pom.xml :
    dependency groupIdjunit/groupId artifactIdjunit/artifactId version4.10/version scopetest/scope/dependencydependency groupIdorg.jboss.arquillian.junit/groupId artifactIdarquillian-junit-container/artifactId version1.0.0.CR6/version scopetest/scope/dependencydependency groupIdorg.jboss.arquillian.container/groupId artifactIdarquillian-container-test-spi/artifactId version1.0.0.CR6/version scopetest/scope/dependencydependency groupIdorg.jboss.arquillian.container/groupId artifactIdarquillian-container-spi/artifactId version1.0.0.CR6/version scopetest/scope/dependencydependency groupIdorg.jboss.arquillian.container/groupId artifactIdarquillian-weld-ee-embedded-1.1/artifactId version1.0.0.CR3/version scopetest/scope/dependencydependency groupIdorg.jboss.weld/groupId artifactIdweld-core/artifactId version1.0.0.CR3/version scopetest/scope/dependencydependency groupIdorg.jboss.weld/groupId artifactIdweld-api/artifactId version1.1.2.Final/version scopetest/scope/dependencydependency groupIdorg.jboss.weld/groupId artifactIdweld-spi/artifactId version1.1.2.Final/version scopetest/scope/dependencydependency groupIdorg.slf4j/groupId artifactIdslf4j-simple/artifactId scopetest/scope/dependencyThe versions are in the parent pom and weld and sl4j versions are imported with
    dependency groupIdorg.jboss.weld/groupId artifactIdweld-core-bom/artifactId version1.1.2.Final/version scopeimport/scope typepom/type/dependencyMy beans I want to test now use javax.el.ElContext andjavax.el.ExpressionFactory.
    They use Seam Solder to @Inject them.
    So I added .addPackage(org.jboss.solder.el.Expressions.class.getPackage()) toShrinkWrap.
    But now here is what I got :
    javax.el.ELException: Provider org.apache.el.ExpressionFactoryImpl not found at javax.el.FactoryFinder.newInstance(FactoryFinder.java:97) at javax.el.FactoryFinder.find(FactoryFinder.java:193) at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:185) at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:156) at org.jboss.solder.el.ExpressionFactoryProducer.createExpressionFactory(ExpressionFactoryProducer.java:35)Does anybody knows how could I do that better ? (or just working)

    DB:2.78:Testing Cdi Beans With Elcontext And Expressionfactory 19

    OK here is what I did (inspired by that question).
    First I deleted the .addPackage(Expressions.class.getPackage()).
    Then I added a dependency to Juel :
    dependency !-- Used to simulate El expressions without Faces environment -- groupIdde.odysseus.juel/groupId artifactIdjuel-impl/artifactId version2.2.4/version scopetest/scope/dependencyThen in my test I added that code :

    /// Methods variables for the elContext ///static SimpleContext elContext = new SimpleContext();static ExpressionFactory expressionFactory = new ExpressionFactoryImpl();@Produces @RequestScopedpublic static ELContext getElContext() { return elContext;}@Produces @RequestScopedpublic static ExpressionFactory getExpressionFactory() { return expressionFactory;}@Beforepublic void reInitElContext() { elContext = new SimpleContext();}private void setElVariable(final String variableName, final Object variableValue) { setElVariable(variableName, variableValue, variableValue.getClass());}private void setElVariable(final String variableName, final Object variableValue, final Class? extends Object variableClass) { expressionFactory.createValueExpression(elContext, "#{"+variableName+"}", variableClass).setValue(elContext, variableValue);}private void setElNullVariable(final String variableName, final Class? variableClass) { setElVariable(variableName, null, variableClass);}/** * By default, set a null String variable * @param variableName */private void setElNullVariable(final String variableName) { setElNullVariable(variableName, String.class);}
    Now I can use setElVariable("variableName", "value") in my tests !

  • RELEVANCY SCORE 2.78

    DB:2.78:Facescontext Returns Null df


    Hello everyone,

    first of all I am a beginner with JSF and I still have some troubles understanding everything.

    I have a Windows deamon programmed that will transmit several sensor states from our house via JMS (from JBoss) for my web application. The communication and the deamon works good.

    Now I want to display those information on my web page with Rich- and Primefaces.

    What I have done:

    - IncomingEventListener.java implements MessageListener
    - in the faces-config.xml I put the incomingEventListener as an application bean
    - Inside the constructor of the incomingEventBean is tried to init the jms listener, but unfortunately the constructor isn't called when I deplyed the project and open the web browser on that page.
    I understood the application wide beans so, that it will be called once when the application starts and somebody opens the first time the application.

    My little work-around was to display a variable from this bean so it had to call the constructor first. What I am doing wrong?
    The other idea was to put the init process into a contextListener, but from that class I can not go to any other beans via FacesContext.

    The next problem is inside the onMessage-method inside the incomingEventListener. Based on the message I have to put some values in some other application beans.
    This bean called ActualStateBean and it is also inside the faces-config.xml as application bean. In this class I have a refresh() method I need to call from the
    incomingEventListener. So I tried :

    FacesContext fc = FacesContext.getCurrentInstance();

    ExpressionFactory expressionFactory = fc.getApplication().getExpressionFactory();
    ELContext elContext = fc.getELContext();

    return (ActualStateBean)expressionFactory.createValueExpression(elContext, "#{actualStateBean}", ActualStateBean.class).getValue(elContext);But I get a NullPointer because FacesContext is null. I understood that problem occures when I try to get the FacesContext instance inside a class that
    is not inside the faces-config.xml.

    My work-around in the moment is to change the variables I have to modify inside the actualStateBean to public static. That works but I don't like this
    solution.

    Hopefully I didn't forget anything and I hope I am on the right track.

    Many greetings and have a nice weekend,
    Hauke

    DB:2.78:Facescontext Returns Null df

    EJP wrote:
    FacesContext is null unless the current thread is executing a Faces request. It has nothing to do with faces-config.XML.Exactly that. For the FacesContext to be initialized, the faces controller servlet (usually called FacesServlet in the web.xml) needs to be invoked as part of the request.

  • RELEVANCY SCORE 2.78

    DB:2.78:Adf Table Selection Listener Not Working When Select A Row. 3c


    Hi All,

    jdev version -11.1.2.1.0

    i have created one adf table and pro grammatically handle SelectionListener Event.

    when table have multiple rows and i go to the row one to next row then following method is call but table have single row and when i select this
    row this is not working.

    is there any bug with selection Listener or Default behaviour.

    backing bean code-
    public void logForHeader(org.apache.myfaces.trinidad.event.SelectionEvent selectionEvent) {
    System.out.println("selection event!");
    resloveMethodExpression("#{bindings.AdAgcrlimitAppMView3.collectionModel.makeCurrent}", null, new Class[] {SelectionEvent.class}, new Object[] {selectionEvent});

    getDetaillog().setVisible(false);
    getHeaderlog().setVisible(true);

    }

    public static Object resloveMethodExpression(String expression, Class returnType, Class[] argTypes, Object[] argValues) {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    MethodExpression methodExpression = elFactory.createMethodExpression(elContext, expression, returnType, argTypes);
    return methodExpression.invoke(elContext, argValues);
    }jsf page code-

    af:table value="#{bindings.AdAgcrlimitAppMView3.collectionModel}" var="row"
    rows="#{bindings.AdAgcrlimitAppMView3.rangeSize}"
    emptyText="#{bindings.AdAgcrlimitAppMView3.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.AdAgcrlimitAppMView3.rangeSize}" rowBandingInterval="0"
    selectedRowKeys="#{bindings.AdAgcrlimitAppMView3.collectionModel.selectedRow}"
    selectionListener="#{backing_Agency_Cr_Limit_Approval.logForHeader}" rowSelection="single"
    id="t1" inlineStyle="height:160px; width:750px;"

    DB:2.78:Adf Table Selection Listener Not Working When Select A Row. 3c

    you can just remove the selectedRowKeys property of table so that by default no row will be selected

  • RELEVANCY SCORE 2.78

    DB:2.78:Valueexpression Binding For A Collectionmodel pp


    When I execute this code:

    ELContext elctx = FacesContext.getCurrentInstance().getELContext();
    ExpressionFactory elFactory = FacesContext.getCurrentInstance().getApplication().getExpressionFactory();

    RichTable rt = new RichTable();
    assignValueExpression(rt,"value","#{bindings.CompanyTable.collectionModel}",new SortableModel());

    where assignValueExpression is
    public void assignValueExpression(UIComponent comp, String where, String value, Object theClass) {
    comp.setValueExpression(where,elFactory.createValueExpression(elctx,(String)value, theClass.getClass()));
    }

    My RichTable component never renders. I wonder if this is because org.apache.myfaces.trinidad.model.SortableModel is not the correct class to use for the #{bindings.CompanyTable.collectionModel}.

    What is the correct class to use for binding a collectionModel?

    DB:2.78:Valueexpression Binding For A Collectionmodel pp

    I don't get why it's not working with a tree, but you might want to know that a tree is represented by FacesCtrlHierBinding which extends JUCtrlHierBinding which extends JUCtrlRangeBinding.

    A tree as implied by the name represents a hierarchy. So it allows to traverse view links and access the children of a given master row. You can consider a table has a tree of height 1: a root with leafs, i.e. the rows.

    Have you tried binding a tree completely defined in a page definition to your RichTable, i.e. not setting the attributes at runtime, simply to see if it works correctly?

  • RELEVANCY SCORE 2.78

    DB:2.78:Commit Operation Not Working xp


    Hello,

    I have the following code in a backingbean that gets called when "Save" button is pressed. What I wanted to do is to set Last Updated By output text with securityUserContext.userName before commiting. However, having the noted code, // Last Updated By, before "commit" seems to have problem committing. If I comment those lines out, I have no problem:

    public String onClickSave() {
    // Last Updated By Begin
    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getELContext();
    ExpressionFactory efactory =
    fctx.getApplication().getExpressionFactory();
    ValueExpression veLastUpdatedBy =
    efactory.createValueExpression(elctx, "#{bindings.LastUpdatedBy.inputValue}",
    Object.class);
    ValueExpression veUserName =
    efactory.createValueExpression(elctx, "#{securityContext.userName}",
    Object.class);
    String userName = (String)veUserName.getValue(elctx);
    veLastUpdatedBy.setValue(elctx, userName);
    // Last Updated By End

    OperationBinding method = bindings.getOperationBinding("Commit");
    method.execute();
    List errors = method.getErrors();
    if (!errors.isEmpty()) {
    System.out.println("There are errors in onClickSave.Commit");
    }
    return "Save";
    }Any suggestion will be greatly appreciated.

    Thank you

    Bones Jones

    DB:2.78:Commit Operation Not Working xp

    when button is called in ADF ,it has prototype like public void methodname(ActionEvent a) for action and pulic void methodname(ActionEventListener evt).
    But your function name is just public String methodname() and this call will not work from adf button.

    Click the button and go to properties and go to action , actionlistener and create method from there for any property and paste ur code.

    hope it helps.

  • RELEVANCY SCORE 2.78

    DB:2.78:#{Bindings} In The Backing Bean Gives Me The Template Bindings!! p1


    My situation is like this:

    A bounded taskflow, a page inside the bounded taskflow which is based on a template (both the taskflow and the page that is). A popup with a dialog on the page, also based on a template. In the popup a selectonechoice.
    When the user picks a value, and presses ok I want to know the value in a backing bean.
    I have been trying to get to the iterator of the list for the selectonechoice but whatever I use, it always tells me the iterator cannot be found. The iterator is in the pageDefinition of the page, not in any template.
    I am completely lost in all the pageDefinitions that are used in this composition and have no idea how to find my iterator. Can anyone help me?
    I know I can use this line if code to start with:

    DCBindingContainer dc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry(); but what does that give me?

    I also tried the code I always used in 10g but this is no longer working:

    FacesContext facesContext = FacesContext.getCurrentInstance();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory expressionFactory =
    facesContext.getApplication().getExpressionFactory();
    ValueExpression exp =
    expressionFactory.createValueExpression(elContext, "#{bindings}",
    Object.class);
    DCBindingContainer bindings = (DCBindingContainer)exp.getValue(elContext);
    DCIteratorBinding iterator = bindings.findIteratorBinding("WhereIsMyIterator");It seems I am getting the bindings of the template and not of my page. Can this be fixed?

    Edit: I have confirmed that I am actually getting the pagetemplate bindings, because I added something there and I was able to see them in the bindings variable in the code.

    Edited by: Wendy Tromp on Mar 29, 2012 1:16 PM

    Edit: changed subject

    Edited by: Wendy Tromp on Mar 29, 2012 1:39 PM

    DB:2.78:#{Bindings} In The Backing Bean Gives Me The Template Bindings!! p1

    OK I get that, but it seems to me that this is a workaround for something that was supposed to work differently. In the URL Timo gives me it is explained that +(DCBindingContainer) bctx.getCurrentBindingsEntry()+ should return the page's bindings (called the consumer page), and that I get the template bindings going one level deeper like this: +(DCBindingContainer) bindings.get("ptb1")+ . This is not how it works in my case. Is that a bug in 11.1.1.3?

  • RELEVANCY SCORE 2.78

    DB:2.78:11g Af:Table Remove Row From Backing.... 71


    I need modify(remove and insert row's) on one af:table from backing, the table is generated from Auto-Generate Task Form from BPEL Human Task..

    Table property's was:

    Id: t2
    Value: #{bindings.Itinerarios.collectionModel}
    Var: row

    Some fields in the table:

    #{row.bindings.CiudadHasta.inputValue}
    #{row.bindings.FechaSalida.inputValue}

    Code I was trying:

    FacesContext fc = FacesContext.getCurrentInstance();
    ELContext elc = fc.getELContext();
    ExpressionFactory ef = fc.getApplication().getExpressionFactory();
    ValueExpression ve = ef.createValueExpression(elc, "#{bindings.Itinerarios.collectionModel}", Object.class);
    DCBindingContainer dc = (DCBindingContainer) ve.getValue(elc);
    OperationBinding operationBinding = dc.getOperationBinding("Create");
    operationBinding.execute();

    Thanks!!!!

    DB:2.78:11g Af:Table Remove Row From Backing.... 71

    Hi Torques,

    Are you refreshing the table once after executing the methods(either create or delete) from the backing bean(my previous reply has sample code to refresh the table using addPartialTarget method)?

    Sireesha

  • RELEVANCY SCORE 2.78

    DB:2.78:Stateful Converter kk


    Hi,

    I need to use client state saving method, but I also have some converters that require a persistent state. I can't seem to save my member data in a session variable. Here is an example:

    public class MyConverter implements Converter, StateHolder {
    private transient NotSerializableType myHelper;
    private boolean tranzient;
    public MyConverter() {}
    public Object getAsObject(FacesContext context, UIComponent component, String value) {
    return myHelper.getObject(context, component, value);
    }
    public String getAsString(FacesContext context, UIComponent component, Object value) {
    return value.toString();
    }
    public boolean isTransient() {
    return tranzient;
    }
    public void setTransient(boolean tranzient) {
    this.tranzient = tranzient;
    }
    public Object saveState(FacesContext context) {
    ExpressionFactory factory = context.getApplication().getExpressionFactory();
    ELContext elContext = context.getElContext();
    final String state = "#{sessionScope.someVar}";
    ValueExpression ex = factory.createValueExpression(elContext, state, NotSerializableType.class);
    ex.setValue(elContext, getMyHelper());
    return state;
    }
    public void restoreState(FacesContext context, Object state) {
    ExpressionFactory factory = context.getApplication().getExpressionFactory();
    ELContext elContext = context.getElContext();
    ValueExpression ex = factory.createValueExpression(elContext, (String) state, NotSerializableType.class);
    NotSerializableType myHelper = (NotSerializableType) ex.getValue(elContext);
    setMyHelper(myHelper);
    }
    public NotSerializableType getMyHelper() {
    return myHelper;
    }
    public void setMyHelper(NotSerializableType myHelper) {
    this.myHelper = myHelper;
    }
    }The JSF is as follows:
    f:converter converterId="myConverter"
    f:param id="myHelper" value="#{myHelperBean}" /
    /f:converterIn restoreState(...), a NullPointerException is thrown when calling ex.getValue(elContext). The debugger says that the state variable is retrieved as the same string that is returned by the saveState(...) method. The ELContext, however, has nothing in its variables map during the restoreState(...) method.

    Am I way off base with what I am trying to do? All I want is to store a reference to my non-serializable type in the session so that I can access it across requests. In fact, myHelperBean is a session bean, but I don't want to limit the namespace for this bean.

    Thank you,
    David

    DB:2.78:Stateful Converter kk

    I think it had something to do with Tomahawk (1.1.6). I moved around the extension filters, and somehow everything has been working. Thanks for the reply though.

  • RELEVANCY SCORE 2.77

    DB:2.77:Java.Io.Notserializableexception c8


    Hi All,

    Consider the following scenario:

    Assume one of my task flow, I am using two beans:
    1. DVTBarViewBean: A serializable bean used at pageFlowScope.
    2. DVTBarViewBackingBean: Used as a backing bean for DVTBarView.jsff which is showing a DVT graph and holding a reference to the graph.

    On the DVTBarView page I am having a choice list and a DVT Graph.
    Whenever the value of choice list changes, I need to refresh the DVT Bar Graph.
    Since the value of the choice list I might need for the duration of the transaction, so I have mapped it to a field in DVTBarViewBean.
    And the valueChangeListener is available in DVTBarViewBean which is invoked whenever the choice list value changes.
    Here is the algo of the valueChangeListener:

    public void handleTPIDValueChange(ValueChangeEvent valueChangeEvent) {
    String newValue = valueChangeEvent.getNewValue().toString();

    //Execute the query required by the DVT Graph.

    //Refresh the DVT Graph using addPartialTarget, as shown below

    AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();

    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getELContext();
    ExpressionFactory exprFactory = fctx.getApplication().getExpressionFactory();
    ValueExpression ve =
    exprFactory.createValueExpression(elctx, "#{requestScope.DVTBarViewBackingBean}", Object.class);
    DVTBarViewBackingBean dvtBarViewBackingBean = (DVTBarViewBackingBean)ve.getValue(elctx);

    adfFacesContext.addPartialTarget(dvtBarViewBackingBean.getBarDVTBinding());
    }

    This approach works fine on standalone server. However, when the application is deployed on RAC, the I am getting the following error in the log:

    [2011-08-08T09:08:30.697+00:00] [ETH_ADF1] [ERROR] [ADFC-62004] [oracle.adfinternal.controller.state.SessionBasedScopeMap] [tid: [ACTIVE].ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: Support_Test_User] [ecid: 7f738fa0118c59bf:4e28597b:131a8578253:-8000-000000000000091e,0] [APP: ETHWebApp] ADFc: Scope object serialization failed (object not serializable), scope='pageFlowScope[WEB-INF/DVTBarTaskFlow.xml#DVTBarTaskFlow]', objectKey='DVTBarViewBean', objectType='com.emerson.eth.adf.view.bean.DVTBarViewBean'.
    [2011-08-08T09:08:30.710+00:00] [ETH_ADF1] [ERROR] [] [oracle.adfinternal.controller.state.SessionBasedScopeMap] [tid: [ACTIVE].ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: Support_Test_User] [ecid: 7f738fa0118c59bf:4e28597b:131a8578253:-8000-000000000000091e,0] [APP: ETHWebApp] [[
    java.io.NotSerializableException: oracle.adf.view.faces.bi.component.graph.UIGraph
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
    at oracle.adfinternal.controller.util.Utils.verifySerializable(Utils.java:344)
    at oracle.adfinternal.controller.state.SessionBasedScopeMap.writeScopeMap(SessionBasedScopeMap.java:133)
    at oracle.adfinternal.controller.state.PageFlowScope.writeObject(PageFlowScope.java:157)
    at sun.reflect.GeneratedMethodAccessor386.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
    at java.util.concurrent.ConcurrentHashMap.writeObject(ConcurrentHashMap.java:1247)
    at sun.reflect.GeneratedMethodAccessor381.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
    at weblogic.servlet.internal.session.ReplicatedSessionChange.writeExternal(ReplicatedSessionChange.java:153)
    at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1429)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1398)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
    at weblogic.rjvm.MsgAbbrevOutputStream.writeObject(MsgAbbrevOutputStream.java:618)
    at weblogic.rjvm.MsgAbbrevOutputStream.writeObjectWL(MsgAbbrevOutputStream.java:609)
    at weblogic.rmi.internal.ObjectIO.writeObject(ObjectIO.java:38)
    at weblogic.rjvm.BasicOutboundRequest.marshalArgs(BasicOutboundRequest.java:88)
    at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:221)
    at weblogic.cluster.replication.ReplicationManager_1035_WLStub.update(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor384.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at weblogic.cluster.replication.SecureReplicationInvocationHandler$ReplicationServicesInvocationAction.run(SecureReplicationInvocationHandler.java:194)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.cluster.replication.SecureReplicationInvocationHandler.invoke(SecureReplicationInvocationHandler.java:164)
    at $Proxy131.update(Unknown Source)
    at weblogic.cluster.replication.ReplicationManager.sendUpdateRequestToSecondary(ReplicationManager.java:740)
    at weblogic.cluster.replication.ReplicationManager.updateSecondary(ReplicationManager.java:662)
    at weblogic.servlet.internal.session.ReplicatedSessionData.syncSession(ReplicatedSessionData.java:639)
    at weblogic.servlet.internal.session.ReplicatedSessionContext.sync(ReplicatedSessionContext.java:85)
    at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.syncSession(ServletRequestImpl.java:2860)
    at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.syncSession(ServletRequestImpl.java:2835)
    at weblogic.servlet.internal.ServletResponseImpl$1.run(ServletResponseImpl.java:1485)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.ServletResponseImpl.send(ServletResponseImpl.java:1479)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1462)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

    My question is that though the pageFlowScope bean does not have a reference to DVT Graph so I am not violating the rule that pageFlowScope beans should not store references to ADF Faces Rich classes, still I am getting the NotSerializableException.
    The only thing I am doing from pageFlowScope bean with that DVT Graph is to refresh it.
    Could you please tell my why its happening so that I can fix it appropriately?
    Currently, I am thinking to move the valueChangeListener from pageFlowScope bean to requestScope bean.

    Thanks,
    Lalit.

    DB:2.77:Java.Io.Notserializableexception c8

    Everything was fine...it was just old logs which confused me.

  • RELEVANCY SCORE 2.77

    DB:2.77:Updating Humantask Binding pk


    Version: SOA 11g

    I'm have a human task with one parameter editable and another, a list of values.
    In my task form I have a combobox showing the list of values.

    I want to set the combo's index of selected value in the editable parameter.

    I have a backing bean value change listener with the code below:

    public void ComboListener(ValueChangeEvent valueChangeEvent) {
    //test 1
    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp = elFactory.createValueExpression(elContext, "#{bindings.indexReturned.inputValue}", Object.class);
    valueExp.setValue(elContext, valueChangeEvent.getNewValue().toString());

    //test 2
    ADFUtils.setBoundAttributeValue("indexReturned", valueChangeEvent.getNewValue());

    }

    I tried set the value of the index in the binding "indexReturned" by two different ways as showed in the code.
    The value change ok: I set the ppr on the screen and also put some System.out.println to make sure.

    The problem is: when the user finish the human task, when I look the task payload returned, the "indexReturned" binding value returned was not updated.

    Sorry, I don't have much experience with adf yet.
    Might I'm doing something stupid... :/

    Thank you so much for any help.

    DB:2.77:Updating Humantask Binding pk

    Version: SOA 11g

    I'm have a human task with one parameter editable and another, a list of values.
    In my task form I have a combobox showing the list of values.

    I want to set the combo's index of selected value in the editable parameter.

    I have a backing bean value change listener with the code below:

    public void ComboListener(ValueChangeEvent valueChangeEvent) {
    //test 1
    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp = elFactory.createValueExpression(elContext, "#{bindings.indexReturned.inputValue}", Object.class);
    valueExp.setValue(elContext, valueChangeEvent.getNewValue().toString());

    //test 2
    ADFUtils.setBoundAttributeValue("indexReturned", valueChangeEvent.getNewValue());

    }

    I tried set the value of the index in the binding "indexReturned" by two different ways as showed in the code.
    The value change ok: I set the ppr on the screen and also put some System.out.println to make sure.

    The problem is: when the user finish the human task, when I look the task payload returned, the "indexReturned" binding value returned was not updated.

    Sorry, I don't have much experience with adf yet.
    Might I'm doing something stupid... :/

    Thank you so much for any help.

  • RELEVANCY SCORE 2.74

    DB:2.74:Xml Menu Tree In Session Scope ca


    Hi I do have a tree code as below ;
    af:tree id="ccId"
    value="#{PlsUserSession.ccMenu}" var="n"
    initiallyExpanded="true" immediate="true"
    fetchSize="25"
    f:facet name="nodeStamp"
    af:commandLink text="#{n.label}" id="pt_cl2"
    action="#{n.doAction}"
    partialSubmit="true"
    immediate="true"/
    /f:facet
    /af:tree

    Where cc_menu is the xml menu bean created from an unbounded task flow. This code fails at {n.doAction} because of null pointer exception. Can anybody tell whats the issue here ? I tried to set the cc_menu in the session scope and accessed the tree but hitting the same issue.
    af:tree id="ccId"
    value="#{cc_menu}" var="n"
    initiallyExpanded="true" immediate="true"
    fetchSize="25"

    My idea is to put the xml menu into the user session.PlsUserSession is the managed bean defined in the session scope.

    public class PlsUserSession {
    private String currentUser;
    private HashMap menuTree;
    private oracle.adf.view.rich.model.MDSMenuModel ccMenu;

    public PlsUserSession() {
    if (this.currentUser == null) {
    System.out.println("Creating User Session");
    }
    }

    private HashMap getMenuTree() {
    if (this.menuTree == null) {
    System.out.println("Loading tree map");
    this.menuTree = new HashMap();
    this.menuTree.put("cc_menu", resolveExpression("#{cc_menu}"));

    }

    return this.menuTree;
    }

    public void setCurrentUser(String currentUser) {
    System.out.println("setCurrentUser");
    this.currentUser = currentUser;
    }

    public static Object resolveExpression(String expression) {
    try {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();

    ValueExpression valueExp = elFactory.createValueExpression(elContext, expression, oracle.adf.view.rich.model.MDSMenuModel.class);
    return (Object)valueExp.getValue(elContext);
    } catch (Exception e) {
    // Do something here...
    ;
    }
    return null;
    }

    public void setCcMenu(oracle.adf.view.rich.model.MDSMenuModel ccMenu) {
    this.ccMenu = ccMenu;
    }

    public oracle.adf.view.rich.model.MDSMenuModel getCcMenu() {
    if (this.menuTree == null) {
    this.getMenuTree();
    }
    return (oracle.adf.view.rich.model.MDSMenuModel)this.menuTree.get("cc_menu");
    }

    }

    Thanks
    Suneesh

    DB:2.74:Xml Menu Tree In Session Scope ca

    Yes. The error is easy to reproduce.

    1) Create and unbounded task flow and add view objects to it
    2) Create a menu xml by right clicking the task flow.This will create an entry in the unbounded task flow 's managed bean
    3) Use the following code to access the menu

    af:tree id="otherId" value="#{root_menu}" var="n"
    initiallyExpanded="true" immediate="true" fetchSize="25"
    f:facet name="nodeStamp"

    af:commandLink text="#{n.label}" id="pt_cl3"
    action="#{n.doAction}"
    /
    /f:facet
    /af:tree

    This will be accessible and the links are functional here
    4) Go to the unbounded taskflow xml and change the scope of the bean to session
    5) Access the menu again. The tree will be displayed but clicking on the link throws null pointer exception as mentioned above.

    Is there anything wrong in the steps I did ?

    Thanks
    Suneesh

  • RELEVANCY SCORE 2.72

    DB:2.72:Not Getting View Scoped Bean In Adf 1d


    I am trying to retrieve managed bean programatically which is in view scope: FacesContext context = FacesContext.getCurrentInstance(); ELContext elContext = context.getELContext(); Application application = context.getApplication(); ExpressionFactory factory = application.getExpressionFactory(); ValueExpression valueExpr = factory.createValueExpression(elContext, "#{viewScope.ViewScopedBean}", Object.class); ViewScopedBean viewBean= (ViewScopedBean)valueExpr.getValue(elContext);But I am getting null for viewBeanWould you please recommend?

    DB:2.72:Not Getting View Scoped Bean In Adf 1d

    Can you answer Frank's question
    is the code from which you try to resolve the view scope bean in the same bounded or unbounded task flow?
    A view scoped bean is only visible in the bean if the bean where you try to get the other bean is in the same flow (and on the same view).Timo

  • RELEVANCY SCORE 2.72

    DB:2.72:Panelmenu/Panelbar Datatable zs



    Hi @ all,rich:panelMenu binding="#{testingBean.panelMenu}" /rich:panelBar binding="#{testingBean.panelBar}" /I'am testing a panelMenu or panelBar to insert an datatable which is filled by an collection. I successfully inserted a datatable in an panelBarItem oder PanelMenuItem; datatable shows the correct rows and columns, but not the values of each column. My second problem is that i can't select the datatable to edit a row.The Idea of this small project is to get an expandable table with richfaces, which habe dynamic values from a database.A small cut of the code:FacesContext facesContext = FacesContext.getCurrentInstance();ELContext elContext = facesContext.getELContext();Application application = facesContext.getApplication();ExpressionFactory elFactory = facesContext.getApplication() .getExpressionFactory();setPanelMenu(panelMenu);getPanelMenu().setId("panelMenu");getPanelMenu().setMode("ajax"); getPanelMenu().setIconExpandedTopGroup("/images/process/minus16.png");getPanelMenu().setIconCollapsedTopGroup("/images/process/plus16.png");getPanelMenu().setIconGroupTopPosition("left");int count = 0;List panelList = getPanelMenu().getChildren();for (TemplateGroupVO groupItem : serviceTemplate .getProcessTemplatesGrouped()) {HtmlPanelMenuGroup panelMenuGroup = new HtmlPanelMenuGroup();panelMenuGroup.setId("panelMenuGroupItem" + count );panelMenuGroup.setLabel(groupItem.getVertragsart() + " (" + groupItem.getTemplateGroupSize() + ")");panelMenuGroup.setData(groupItem);panelMenuGroup.setRendered(true);List panelMenuGroupList = panelMenuGroup.getChildren();HtmlPanelMenuItem panelMenuItem = new HtmlPanelMenuItem();panelMenuItem.setId("panelMenuItem" + zaehler);panelMenuItem.setRendered(true);panelMenuItem.setIcon("/images/process/x.gif");List templateVOList = new ArrayList();for (TemplateVO menuItem : groupItem.getTemplateGroup()) { TemplateVO templateVO = new TemplateVO(); templateVO.setId(menuItem.getId()); ... templateVOList.add(templateVO);}String[] columns = new String[] { "id", ...};String[] valueExp = new String[] { "#{templateVO.id}",..};HtmlDataTable datatable = new HtmlDataTable();datatable.setValue(templateVOList);datatable.setCellpadding("4");datatable.setCellpadding("4");datatable.setWidth("100%");datatable.setSortMode("Single");for (int i = 0; i columns.length; i++) { HtmlOutputText header = new HtmlOutputText(); header.setValue(columns); HtmlOutputText content = new HtmlOutputText(); ValueExpression valueExpression = elFactory createValueExpression(elContext, valueExp, String.class); content.setValueExpression("value", valueExpression); HtmlColumn column = new HtmlColumn(); column.setId("col" + i); column.setHeader(header); column.getChildren().add(content); column.setSortBy(valueExp); column.setSortable(true); column.setSelfSorted(true); datatable.getChildren().add(column); } panelMenuItem.setId("datatable" + count); panelMenuItem.getChildren().add(datatable); panelMenuGroupList.add(panelMenuItem); panelList.add(panelMenuGroup); count++; } Can somebody help me? thanks.

    DB:2.72:Panelmenu/Panelbar Datatable zs


    Hi @ all,rich:panelMenu binding="#{testingBean.panelMenu}" /rich:panelBar binding="#{testingBean.panelBar}" /I'am testing a panelMenu or panelBar to insert an datatable which is filled by an collection. I successfully inserted a datatable in an panelBarItem oder PanelMenuItem; datatable shows the correct rows and columns, but not the values of each column. My second problem is that i can't select the datatable to edit a row.The Idea of this small project is to get an expandable table with richfaces, which habe dynamic values from a database.A small cut of the code:FacesContext facesContext = FacesContext.getCurrentInstance();ELContext elContext = facesContext.getELContext();Application application = facesContext.getApplication();ExpressionFactory elFactory = facesContext.getApplication() .getExpressionFactory();setPanelMenu(panelMenu);getPanelMenu().setId("panelMenu");getPanelMenu().setMode("ajax"); getPanelMenu().setIconExpandedTopGroup("/images/process/minus16.png");getPanelMenu().setIconCollapsedTopGroup("/images/process/plus16.png");getPanelMenu().setIconGroupTopPosition("left");int count = 0;List panelList = getPanelMenu().getChildren();for (TemplateGroupVO groupItem : serviceTemplate .getProcessTemplatesGrouped()) {HtmlPanelMenuGroup panelMenuGroup = new HtmlPanelMenuGroup();panelMenuGroup.setId("panelMenuGroupItem" + count );panelMenuGroup.setLabel(groupItem.getVertragsart() + " (" + groupItem.getTemplateGroupSize() + ")");panelMenuGroup.setData(groupItem);panelMenuGroup.setRendered(true);List panelMenuGroupList = panelMenuGroup.getChildren();HtmlPanelMenuItem panelMenuItem = new HtmlPanelMenuItem();panelMenuItem.setId("panelMenuItem" + zaehler);panelMenuItem.setRendered(true);panelMenuItem.setIcon("/images/process/x.gif");List templateVOList = new ArrayList();for (TemplateVO menuItem : groupItem.getTemplateGroup()) { TemplateVO templateVO = new TemplateVO(); templateVO.setId(menuItem.getId()); ... templateVOList.add(templateVO);}String[] columns = new String[] { "id", ...};String[] valueExp = new String[] { "#{templateVO.id}",..};HtmlDataTable datatable = new HtmlDataTable();datatable.setValue(templateVOList);datatable.setCellpadding("4");datatable.setCellpadding("4");datatable.setWidth("100%");datatable.setSortMode("Single");for (int i = 0; i columns.length; i++) { HtmlOutputText header = new HtmlOutputText(); header.setValue(columns); HtmlOutputText content = new HtmlOutputText(); ValueExpression valueExpression = elFactory createValueExpression(elContext, valueExp, String.class); content.setValueExpression("value", valueExpression); HtmlColumn column = new HtmlColumn(); column.setId("col" + i); column.setHeader(header); column.getChildren().add(content); column.setSortBy(valueExp); column.setSortable(true); column.setSelfSorted(true); datatable.getChildren().add(column); } panelMenuItem.setId("datatable" + count); panelMenuItem.getChildren().add(datatable); panelMenuGroupList.add(panelMenuItem); panelList.add(panelMenuGroup); count++; } Can somebody help me? thanks.

  • RELEVANCY SCORE 2.70

    DB:2.70:Foreachtag Does Not Have Setvalueexpression() And Getchildren() Methods kj


    Hi,

    I built a prototype of rendering a table dynamically like this on my page:

    af:table varStatus="rowStat"
    disableColumnReordering="true"
    rowBandingInterval="0"
    contentDelivery="immediate"
    contextMenuSelect="false"
    columnSelection="none"
    autoHeightRows="10"
    width="100%" var="row"
    id="t3"
    value="#{backing_eventCreate.collectionModels[2]}"
    rows="#{backing_eventCreate.collectionModels[2].rowCount}" rowSelection="none"
    af:forEach items="#{backing_eventCreate.listColumnNames[2]}"
    var="col"
    af:column headerText="#{col}"
    sortable="false"
    width="50px"
    af:outputText value="#{row[col]['resourceName']}"
    id="ot4"/
    /af:column
    /af:forEach
    /af:table

    Next, due to our requirements, I need to build this programmatically in the bean. Initially, I was using UIXIterator for af:forEach and later out it's not right and it's not allowed for table. So looks like org.apache.taglibs.standard.tag.rt.core.ForEachTag should be used, but there is no setValueExpression() and getChildren() methods for ForEachTag, how can I add the column to it?

    Here is my initial codes using UIXIterator in the bean:

    RichTable table = new RichTable();
    .....
    UIXIterator iter = new UIXIterator();
    // ForEachTag forEach = new ForEachTag();
    FacesContext fc = FacesContext.getCurrentInstance();
    ELContext elc = fc.getELContext();
    ExpressionFactory ef = fc.getApplication().getExpressionFactory();

    ValueExpression ve =
    ef.createValueExpression(elc, "#{backing_eventCreate.listColumnNames[0]}",
    Object.class);
    iter.setValueExpression("value", ve);
    iter.setVar("col");
    ValueExpression ve2 =
    ef.createValueExpression(elc, "#{col}", Object.class);

    out.setValueExpression("value", ve2);
    iter.getChildren().add(out);
    table.getChildren().add(iter);

    I want to replace UIXIterator with ForEachTag, but could not do it.

    Please advise.

    Thanks
    -Mina

    DB:2.70:Foreachtag Does Not Have Setvalueexpression() And Getchildren() Methods kj

    Hi,

    I built a prototype of rendering a table dynamically like this on my page:

    af:table varStatus="rowStat"
    disableColumnReordering="true"
    rowBandingInterval="0"
    contentDelivery="immediate"
    contextMenuSelect="false"
    columnSelection="none"
    autoHeightRows="10"
    width="100%" var="row"
    id="t3"
    value="#{backing_eventCreate.collectionModels[2]}"
    rows="#{backing_eventCreate.collectionModels[2].rowCount}" rowSelection="none"
    af:forEach items="#{backing_eventCreate.listColumnNames[2]}"
    var="col"
    af:column headerText="#{col}"
    sortable="false"
    width="50px"
    af:outputText value="#{row[col]['resourceName']}"
    id="ot4"/
    /af:column
    /af:forEach
    /af:table

    Next, due to our requirements, I need to build this programmatically in the bean. Initially, I was using UIXIterator for af:forEach and later out it's not right and it's not allowed for table. So looks like org.apache.taglibs.standard.tag.rt.core.ForEachTag should be used, but there is no setValueExpression() and getChildren() methods for ForEachTag, how can I add the column to it?

    Here is my initial codes using UIXIterator in the bean:

    RichTable table = new RichTable();
    .....
    UIXIterator iter = new UIXIterator();
    // ForEachTag forEach = new ForEachTag();
    FacesContext fc = FacesContext.getCurrentInstance();
    ELContext elc = fc.getELContext();
    ExpressionFactory ef = fc.getApplication().getExpressionFactory();

    ValueExpression ve =
    ef.createValueExpression(elc, "#{backing_eventCreate.listColumnNames[0]}",
    Object.class);
    iter.setValueExpression("value", ve);
    iter.setVar("col");
    ValueExpression ve2 =
    ef.createValueExpression(elc, "#{col}", Object.class);

    out.setValueExpression("value", ve2);
    iter.getChildren().add(out);
    table.getChildren().add(iter);

    I want to replace UIXIterator with ForEachTag, but could not do it.

    Please advise.

    Thanks
    -Mina

  • RELEVANCY SCORE 2.70

    DB:2.70:#{Bindings.Eventbinding.Listener.Processaction} - Jdev 11.1.2.3 8p


    Hello:

    I successfully set up contextual events and everything was working ok.
    In the ActionListener of a button is the following EL: #{bindings.eventBinding.listener.processAction}

    I am wondering why the above EL does not work in the invoke of a MethodExpression in java. Invoke throws Null Pointer Exception.
    Other EL seems to work ok in the following method in a java bean:

    The code below failes with NPE on Invoke:
    public void doEvent(ActionEvent actionEvent){
    FacesContext fc = FacesContext.getCurrentInstance();
    ELContext el = fc.getELContext();
    ExpressionFactory ef = fc.getApplication().getExpressionFactory();
    MethodExpression me = ef.createMethodExpression(el,
    "#{bindings.eventBinding.listener.processAction}", Object.class, new Class[]{});
    Object invoke = me.invoke(el, new Class[]{});
    }

    If I replace #{bindings.eventBinding.listener.processAction} with other valid EL Method call, like #{bindings.Next.execute} it works ok but the above code throws NPE. What am I missing?

    Any ideas?

    Thanks for the help.

    DB:2.70:#{Bindings.Eventbinding.Listener.Processaction} - Jdev 11.1.2.3 8p

    Hi Frank:

    I found the solution... :)

    "#{bindings.eventBinding.listener.processAction}", Object.class, new Class[]{ActionEvent.class});
    Object invoke = me.invoke(el, new Object[] {actionEvent});

    Thanks much for the help.

  • RELEVANCY SCORE 2.70

    DB:2.70:Java.El.Methodnotfoundexception When Calling From Bindings With Parameters cz


    Hi

    JDeveloper 11.1.1.3.0

    I have written 2 methods in AMImpl and added to the client interface, so that they are visible in the data controls.
    executeRepairableOrdersQuery() and executeRepairableOrdersQuery1(Stirng, String)
    They are also present in the page bindings.

    I am calling these methods from my ManagedBean programmatically as follows.

    The call for method without parameters works but the call for method with parameters do not work.
    Just for testing purpose I was just hardcoding the values for itemNumber and orderNumber in the ManagedBean.

    ------ ManagedBean Code ---------
    Class[] paramTypes = { String.class, String.class };
    Object[] params = { itemNumber, orderNumber } ;
    Object[] params1 = {};
    Class[] class1 = {};
    String s = (String)invokeEL("#{bindings.executeRepairableOrdersQuery.execute}", paramTypes, params);
    String s = (String)invokeEL("#{bindings.executeRepairableOrdersQuery1.execute}", class1, params1);
    .....
    public Object invokeEL(String el, Class[] paramTypes, Object[] params) {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
    MethodExpression exp = expressionFactory.createMethodExpression(elContext, el, Object.class, paramTypes);
    return exp.invoke(elContext, params);
    }

    ------

    I am getting the following Exception

    Thanks for any help.
    Sameer

    -----
    javax.servlet.ServletException: javax.el.MethodNotFoundException: Method not found: executeRepairableOrdersQuery.execute(java.lang.String, java.lang.String)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:414)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:159)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: javax.faces.el.EvaluationException: javax.el.MethodNotFoundException: Method not found: executeRepairableOrdersQuery.execute(java.lang.String, java.lang.String)
    at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
    at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:698)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:285)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
    ... 37 more
    Caused by: javax.el.MethodNotFoundException: Method not found: executeRepairableOrdersQuery.execute(java.lang.String, java.lang.String)
    at com.sun.el.util.ReflectionUtil.getMethod(ReflectionUtil.java:143)
    at com.sun.el.parser.AstValue.invoke(AstValue.java:154)
    at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
    at xxdbd.XXDBDCPDPHandlerManagedBean.invokeEL(XXDBDCPDPHandlerManagedBean.java:79)
    at xxdbd.XXDBDCPDPHandlerManagedBean.assignUserSessionId(XXDBDCPDPHandlerManagedBean.java:101)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
    at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
    at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
    ... 45 more

    DB:2.70:Java.El.Methodnotfoundexception When Calling From Bindings With Parameters cz

    Thank you Navneeth

    It is working when I am passing parameters like following.

    Class[] paramTypes = { };
    Object[] params = { } ;
    String s = (String)invokeEL("#{bindings.executeRepairableOrdersQuery.execute}", paramTypes, params);

    Actually I have set the parameters through EL in the bindings in the page while calling the method.
    Even though we pass empty parameters to the invokeEL(), the values are being read in the AMImpl method.

    Regards
    Sameer

  • RELEVANCY SCORE 2.70

    DB:2.70:Delete Of Master In Master-Detail-Detail Doesn't Work jp


    Hi,

    JDEV 11g, TP4, ADF BC.

    I have implemented a master-detail-detail page where master is a form layout and the both details are af:tables.

    On each level there is a delete button (cascading delete).
    ActionListener of master =onDeleteHead(). Before deleting the record the user has to confirm this within a dialog

    public void onDeleteHead(ActionEvent actionEvent) {
    ExpressionFactory ef = JSFUtils.getFacesContext().getApplication().getExpressionFactory();
    ELContext elCtx = JSFUtils.getFacesContext().getELContext();

    outputTextDlg.setValue(getResourceBundle().getString("DELETE_HEAD_MSG"));
    dialogOkCancel.setDialogListener(ef.createMethodExpression(elCtx, "#{Bob0012.onDialogDeleteHeadOk}", null, new Class[] {DialogEvent.class}));

    AdfFacesContext.getCurrentInstance().addPartialTarget(popupDlg); // refresh dialog texts
    JSUtils.showPopup(popupDlg.getId());
    }

    public void onDialogDeleteHeadOk(DialogEvent dialogEvent) {
    if (dialogEvent.getOutcome() == DialogEvent.Outcome.ok) {
    OperationBinding operationBinding = ADFUtils.getManagedBeanOperation("DeleteHead");
    Object result = operationBinding.execute();

    AdfFacesContext.getCurrentInstance().addPartialTarget(panelHeaderHead);
    }
    }If I press delete button on master record operationBinding.execute(); is executed (confirmed with debugger) and everything seems to be OK.
    Even after commit (actionListener="#{bindings.Commit.execute}") the master record including the detail records seems to be deleted.

    Problem: No Delete-statement is executed on DB-Level (verified with v$sqlarea) !

    If I do the same e.g. on "middle" detail (which is itself a master) the delete works as expected and the corresponding delete statement is executed on DB-level.

    Has anyone faced similar problems with master-detail-detail ?
    Is this a known bug?

    regards
    Peter

    DB:2.70:Delete Of Master In Master-Detail-Detail Doesn't Work jp

    Hi,

    can you perform this operation from the ADF BC tester? This tells you the location of the problem. The Faces code looks okay except that you should use RequestContext instead of AdfFacesContext

    Also make sure that the row is deleted by querying for it in the DB.

    Frank

  • RELEVANCY SCORE 2.69

    DB:2.69:Problem In Selection Listner Of Adf:Table dk


    hi,

    i m using jdev version 11.1.1.5

    i have master detail relationship table. there is rquiremnt like when user click on first table row it will represent first log

    and when user click on another table it will represent second log. both log will not shown at a time. it shows according to selection of table.

    it will works fine when more than one rows are there but problem occurs when only one row.selection listner method not work.

    bean code:

    public void appHdrLog(SelectionEvent selectionEvent) {
    System.out.println("************inside bill table event*********");
    resloveMethodExpression("#{bindings.AdBaddebtApphdrforclaimView2.collectionModel.makeCurrent}", null, new Class[] {SelectionEvent.class}, new Object[] {selectionEvent});
    t5.setVisible(true);
    t4.setVisible(false);
    if(t3 != null)
    {
    t3.getSelectedRowKeys().clear();
    }
    AdfFacesContext.getCurrentInstance().addPartialTarget(this.t5);
    AdfFacesContext.getCurrentInstance().addPartialTarget(this.t4);
    AdfFacesContext.getCurrentInstance().addPartialTarget(this.t3);
    }

    public void appBillLog(SelectionEvent selectionEvent) {
    System.out.println("inside bill table event");
    resloveMethodExpression("#{bindings.AdBaddebtAppdetView3.collectionModel.makeCurrent}", null, new Class[] {SelectionEvent.class}, new Object[] {selectionEvent});
    t4.setVisible(true);
    t5.setVisible(false);
    if(t2!= null){
    t2.getSelectedRowKeys().clear();
    }
    AdfFacesContext.getCurrentInstance().addPartialTarget(this.t5);
    AdfFacesContext.getCurrentInstance().addPartialTarget(this.t4);

    AdfFacesContext.getCurrentInstance().addPartialTarget(this.t2);

    }

    public static Object resloveMethodExpression(String expression, Class returnType, Class[] argTypes, Object[] argValues) {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    MethodExpression methodExpression = elFactory.createMethodExpression(elContext, expression, returnType, argTypes);
    return methodExpression.invoke(elContext, argValues);
    }

    DB:2.69:Problem In Selection Listner Of Adf:Table dk

    i dont even understood what are you try to say?

    but from the last statement i understood that if you have more than one row you get some log details (i.e) you are able to acces to your table selection listener.

    if you had only one row means you can able to access you selection listeners?

    is so?

    with this hope . i cant able to give the answer from part of the understood.

    please give me a clearly legible question?

  • RELEVANCY SCORE 2.69

    DB:2.69:Adf Declarative Components With Business Components zp


    Hi, I have created one Generic Project in jdevCreated DeclrativeComponent and defined Application Module in the project. My idea is to deploy Declarative component along with App module into a ADF-Library-jar.Created one test page in this project and was able to fetch records from db using app module.But when i deploy as ADF Lib and when i try to access the db through my added jar this jar is internally failing to find the app module.same code is running independently but failing when added to another project as jar. public static DeclarativeComponentAMImpl getAm() { DeclarativeComponentAMImpl am; FacesContext fc = null; Application app = null; ExpressionFactory elFactory = null; ELContext elContext = null; ValueExpression valueExp = null; try{ fc = FacesContext.getCurrentInstance(); app = FacesContext.getCurrentInstance().getApplication(); elFactory = app.getExpressionFactory(); elContext = FacesContext.getCurrentInstance().getELContext(); valueExp = elFactory.createValueExpression(elContext, "#{data.DeclarativeComponentAMDataControl.dataProvider}", Object.class); }catch(Exception e){ e.printStackTrace(); } am = (DeclarativeComponentAMImpl)valueExp.getValue(elContext); // am is coming as null here while running this in another project by adding this as adf lib jar return am; }I need help in deploying adf lib with both declarative component feature along with its app module. Please help

    DB:2.69:Adf Declarative Components With Business Components zp

    Adding BC4J configuration tag inside Databindings.jpx's DataControlUsages solved the problem

  • RELEVANCY SCORE 2.67

    DB:2.67:Re: 2 Methods In An El? 78


    Hi,

    You can set #{MyBean.myMethod} as an expression, and then call the default selection listener from myMethod using something like this:
    FacesContext facesContext = getFacesContext();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp = elFactory.createValueExpression(elContext, "#{bindings.MyView.collectionModel.makeCurrent}", Object.class);
    JUCtrlActionBinding a =(JUCtrlActionBinding)valueExp.getValue(elContext);
    a.execute();Pedja

    DB:2.67:Re: 2 Methods In An El? 78

    It's very strange...
    Why this : selectionListener="#{bindings.MyView.collectionModel.makeCurrent}" is working properly, but this : selectionListener="#{backingBeanScope.MyBean.myMethod}" isn't ?
    I'll try to make an other exemple without af:query, as you made. But in my project, i need the af:query.

    Thanks Pedja for your help.

    If someone has an other idea...

  • RELEVANCY SCORE 2.67

    DB:2.67:Sharing A Session-Scoped Jsf Bean Between Two War Applications m8


    Hi Experts,

    I have a JSF session-scoped bean called UserBean which looks as follow:

    public class UserBean {
    private String user;

    public void setUser(String user) {
    this.user = user;
    }

    public String getUser() {
    return user;
    }
    }I also have two request-scoped page beans that are identical but contained in seperate WAR applications:

    public class PageBean {
    public void setUser(String user) {
    getUserBean().setUser(user);
    }

    public String getUser() {
    return getUserBean().getUser();
    }

    private UserBean getUserBean() {
    ELContext elContext = FacesContext.getCurrentInstance().getELContext();
    ELResolver elResolver = FacesContext.getCurrentInstance().getApplication().getELResolver();
    return (UserBean)elResolver.getValue(elContext, null, "userbean");
    }I package all of these beans together in an EAR file, with the UserBean contained in a JAR in the lib folder, and the two WARs placed under the root, as such:

    EAR
    |___ PageBean1.war
    |___ PageBean2.war
    |___ lib
    |___ UserBean.jarNow, if I load the PageBean1 application and call setUser followed by getUser in another browser window (on PageBean1) it works fine and vice versa for PageBean2. If I, however, call setUser on PageBean1 but getUser on PageBean2, or vice versa, the method returns null, indicating that they have two different instances of UserBean, even though it is session-scoped. I need them to refer to the same instance.

    Any ideas?
    Thank you,
    Ristretto

    DB:2.67:Sharing A Session-Scoped Jsf Bean Between Two War Applications m8

    BalusC, does this mean that each context is guaranteed to retain it's own session? I found that out after many hours of trial and error last night. We have a bunch of JSP pages in the ROOT context. From one of them, I launch our facelets application in a different context. I discovered that the JSP page and the facelets were running in different sessions. Furthermore, when I logged off the facelet application, invalidated its session and jumped back to the originating JSP page, that page had its original session back, and all session objects were intact. That surprised me.

    Is this part of the basic servlet specification? The reason this surprised me is I know a cookie is used to record the session on the client side. So I assumed when the facelet app recorded its session cookie, it would overwrite the one put there by the JSP page. I suppose you could include the context name to make the session cookie unique to that context.

    Thanks. I'm willing to raad if you could just provide a pointer on where to look.

  • RELEVANCY SCORE 2.67

    DB:2.67:Iterator Not Returning The Changed New Value. Returns Previous Value cc


    My very simple code in action listener for the SelectOneChoice FacesContext context = FacesContext.getCurrentInstance(); ELContext elContext = context.getELContext(); ExpressionFactory ef = context.getApplication().getExpressionFactory(); DCBindingContainer bc = (DCBindingContainer)ef.createValueExpression(context.getELContext(),"#{bindings}",DCBindingContainer.class).getValue(context.getELContext()); DCIteratorBinding it=bc.findIteratorBinding("Operation1Iterator"); String operation=it.getCurrentRow().getAttribute("Meaning").toString(); 1) I created one VO which returns only 4 operations from a lookup. lets say : ADD,SUB,DIV,MULT2) I drag drop this VO from data control on UI as select one choice ... set auto_submit=True3) when my UI loads the first operation is ADD. When I click dropdown and select MULT..... in UI it shows MULT as selectedbut my code in bean returns me ADD4) Next I change from MULT to DIV my code in bean returns me MULT5) Why it is returning me old values ????ThanksRahul

    DB:2.67:Iterator Not Returning The Changed New Value. Returns Previous Value cc

    Here is the link:https://blogs.oracle.com/adf/entry/getting_selected_value_from_selectonechoiceSireesha

  • RELEVANCY SCORE 2.67

    DB:2.67:Automatic Testing And Ejb Jpa pz


    Hello,

    I am creating an application using EJB3 JPA and Session Beans.
    If i understood correctly, a way of testing the Session Beans would be to use a Java Client calling Session Bean's remote interface.
    Is this the 'proper way' of doing it with JDeveloper?

    Thanks,

    Florin Marcus

    DB:2.67:Automatic Testing And Ejb Jpa pz

    That works well and there's a demo on otn doing just that.

    http://www.oracle.com/technology/obe/obe11jdev/11/ejb/ejb.html#t2

  • RELEVANCY SCORE 2.67

    DB:2.67:Re: Sending Lov Index Instead Of Display Value Or Code 19


    ok it must be
    af:selectOneChoice value="#{bindings.Countrycode.inputValue}"
    shortDesc="#{bindings.Countrycode.hints.tooltip}"
    id="soc3" simple="true"
    valueChangeListener="#{pageFlowScope.InternalUserBean.valueChanged}"
    f:selectItems value="#{bindings.Countrycode.items}" id="si3"/
    /af:selectOneChoice

    public void valueChanged(ValueChangeEvent valueChangeEvent) {
    this.setValueToEL("#{bindings.Countrycode.inputValue}", valueChangeEvent.getNewValue());
    String val=(String) resolveExpression("#{bindings.Countrycode.attributeValue}");


    }

    //also add these methods

    public Object resolveExpression(String el) {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
    ValueExpression valueExp = expressionFactory.createValueExpression(elContext,el,Object.class);
    return valueExp.getValue(elContext);
    }

    public void setValueToEL(String el, Object val) {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
    ValueExpression exp = expressionFactory.createValueExpression(elContext, el, Object.class);
    exp.setValue(elContext, val);
    }

    must i set autosubmite=true

    DB:2.67:Re: Sending Lov Index Instead Of Display Value Or Code 19

    Hi,

    I don't know much about worklist and its flow. But I guess

    ...
    NamedData NDName="country_of_origin"
    NDValue="#{bindings.Countrycode.inputValue}" // inputValue = ZA
    NDType="java.lang.String"/

    ....should be

    ...
    NamedData NDName="country_of_origin"
    NDValue="#{bindings.Countrycode.attributeValue}" // attributeValue = Original Name
    NDType="java.lang.String"/
    ....I already shared it, but again... Can you go through the link a href ="https://blogs.oracle.com/adf/entry/getting_selected_value_from_selectonechoice" Getting Selected Value from SOC /a

    -Neha..

  • RELEVANCY SCORE 2.66

    DB:2.66:Jboss 7.1 Cdi And Seam 3 Security Issue 8k



    Hello,

    i have added to my project security seam as instruction on documentation but this generate this errore when start jboss 7.1:

    Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [ELContext] with qualifiers [@Default] at injection point [[parameter 1] of [constructor] @Inject public org.ocpsoft.rewrite.cdi.expressions.Expressions(ELContext, ExpressionFactory)]. Possible dependencies [[Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.ocpsoft.rewrite.cdi.expressions.ELContextProducer.createELContext()], Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.jboss.solder.el.ELContextProducer.createELContext()]]]

    at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:278)

    at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:244)

    at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:107)

    at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:127)

    at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:346)

    at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:331)

    at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:366)

    at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:83)

    at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)

    This is my pom.xml :

    ?xml version="1.0" encoding="UTF-8"?

    !-- JBoss, Home of Professional Open Source Copyright 2012, Red Hat, Inc.

    and/or its affiliates, and individual contributors by the @authors tag. See

    the copyright.txt in the distribution for a full listing of individual contributors.

    Licensed under the Apache License, Version 2.0 (the "License"); you may not

    use this file except in compliance with the License. You may obtain a copy

    of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required

    by applicable law or agreed to in writing, software distributed under the

    License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS

    OF ANY KIND, either express or implied. See the License for the specific

    language governing permissions and limitations under the License. --

    project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"

    modelVersion4.0.0/modelVersion

    groupIdorg.jboss.tools.examples/groupId

    artifactIdtest2-jboss-as-kitchensink-rf/artifactId

    version0.0.1-SNAPSHOT/version

    packagingwar/packaging

    nameJBoss AS Quickstarts: Kitchensink-rf/name

    descriptionA starter Java EE 6 webapp project for use on JBoss AS 7 / EAP 6, generated from the jboss-javaee6-webapp archetype/description

    urlhttp://jboss.org/richfaces/url

    properties

    !-- Explicitly declaring the source encoding eliminates the following message: --

    !-- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! --

    project.build.sourceEncodingUTF-8/project.build.sourceEncoding

    !-- JBoss dependency versions --

    jboss.as.plugin.version7.1.1.Final/jboss.as.plugin.version

    !-- Define the version of the JBoss BOMs we want to import. The JBoss BOMs specify tested stacks. --

    org.richfaces.bom.version4.2.3.Final/org.richfaces.bom.version

    jboss.bom.version1.0.2.Final/jboss.bom.version

    !-- other plugin versions --

    compiler.plugin.version2.3.1/compiler.plugin.version

    surefire.plugin.version2.4.3/surefire.plugin.version

    war.plugin.version2.1.1/war.plugin.version

    !-- Seam 3.1 --

    seam.version3.1.0.Final/seam.version

    !-- maven-compiler-plugin --

    maven.compiler.target1.6/maven.compiler.target

    maven.compiler.source1.6/maven.compiler.source

    /properties

    dependencyManagement

    dependencies

    !-- JBoss distributes a complete set of Java EE 6 APIs including

    a Bill of Materials (BOM). A BOM specifies the versions of a "stack" (or

    a collection) of artifacts. We use this here so that we always get the correct

    versions of artifacts. Here we use the jboss-javaee-6.0-with-tools stack

    (you can read this as the JBoss stack of the Java EE 6 APIs, with some extras

    tools for your project, such as Arquillian for testing) and the jboss-javaee-6.0-with-hibernate

    stack you can read this as the JBoss stack of the Java EE 6 APIs, with extras

    from the Hibernate family of projects) --

    dependency

    groupIdorg.jboss.bom/groupId

    artifactIdjboss-javaee-6.0-with-tools/artifactId

    version${jboss.bom.version}/version

    typepom/type

    scopeimport/scope

    /dependency

    dependency

    groupIdorg.jboss.bom/groupId

    artifactIdjboss-javaee-6.0-with-hibernate/artifactId

    version${jboss.bom.version}/version

    typepom/type

    scopeimport/scope

    /dependency

    !-- Similarly to the JBoss Java EE 6 BOM above, the RichFaces BOM specifies the

    versions of artifacts required for using RichFaces in your project. --

    dependency

    groupIdorg.richfaces/groupId

    artifactIdrichfaces-bom/artifactId

    version${org.richfaces.bom.version}/version

    typepom/type

    scopeimport/scope

    /dependency

    !-- Seam 3.1 per security --

    dependency

    groupIdorg.jboss.seam/groupId

    artifactIdseam-bom/artifactId

    version${seam.version}/version

    typepom/type

    scopeimport/scope

    /dependency

    /dependencies

    /dependencyManagement

    dependencies

    !-- First declare the APIs we depend on and need for compilation. All of them are provided by JBoss AS 7 --

    !-- Import the CDI API, we use provided scope as the API is included in JBoss AS 7 --

    dependency

    groupIdjavax.enterprise/groupId

    artifactIdcdi-api/artifactId

    scopeprovided/scope

    /dependency

    !-- Import the Common Annotations API (JSR-250), we use provided scope as the API is included in JBoss AS 7 --

    dependency

    groupIdorg.jboss.spec.javax.annotation/groupId

    artifactIdjboss-annotations-api_1.1_spec/artifactId

    scopeprovided/scope

    /dependency

    !-- Import the JAX-RS API, we use provided scope as the API is included in JBoss AS 7 --

    dependency

    groupIdorg.jboss.spec.javax.ws.rs/groupId

    artifactIdjboss-jaxrs-api_1.1_spec/artifactId

    scopeprovided/scope

    /dependency

    !-- Import the JPA API, we use provided scope as the API is included in JBoss AS 7 --

    dependency

    groupIdorg.hibernate.javax.persistence/groupId

    artifactIdhibernate-jpa-2.0-api/artifactId

    scopeprovided/scope

    /dependency

    !-- Import the EJB API, we use provided scope as the API is included in JBoss AS 7 --

    dependency

    groupIdorg.jboss.spec.javax.ejb/groupId

    artifactIdjboss-ejb-api_3.1_spec/artifactId

    scopeprovided/scope

    /dependency

    !-- JSR-303 (Bean Validation) Implementation --

    !-- Provides portable constraints such as @Email --

    !-- Hibernate Validator is shipped in JBoss AS 7 --

    dependency

    groupIdorg.hibernate/groupId

    artifactIdhibernate-validator/artifactId

    scopeprovided/scope

    exclusions

    exclusion

    groupIdorg.slf4j/groupId

    artifactIdslf4j-api/artifactId

    /exclusion

    /exclusions

    /dependency

    !-- Import the JSF API, we use provided scope as the API is included in JBoss AS 7 --

    dependency

    groupIdorg.jboss.spec.javax.faces/groupId

    artifactIdjboss-jsf-api_2.1_spec/artifactId

    scopeprovided/scope

    /dependency

    !-- Import the Servlet API, we use provided scope as the API is included in JBoss AS 7 --

    dependency

    groupIdorg.jboss.spec.javax.servlet/groupId

    artifactIdjboss-servlet-api_3.0_spec/artifactId

    scopeprovided/scope

    /dependency

    !-- Import the RichFaces core library --

    dependency

    groupIdorg.richfaces.core/groupId

    artifactIdrichfaces-core-impl/artifactId

    exclusions

    exclusion

    artifactIdcssparser/artifactId

    groupIdnet.sourceforge.cssparser/groupId

    /exclusion

    exclusion

    artifactIdguava/artifactId

    groupIdcom.google.guava/groupId

    /exclusion

    /exclusions

    /dependency

    !-- Import the RichFaces components --

    dependency

    groupIdorg.richfaces.ui/groupId

    artifactIdrichfaces-components-ui/artifactId

    /dependency

    !-- Import the Atmosphere framework for a4j:push --

    dependency

    groupIdorg.atmosphere/groupId

    artifactIdatmosphere-runtime/artifactId

    exclusions

    exclusion

    groupIdorg.slf4j/groupId

    artifactIdslf4j-api/artifactId

    /exclusion

    /exclusions

    /dependency

    !-- Now we declare any tools needed --

    !-- Annotation processor to generate the JPA 2.0 metamodel classes for typesafe criteria queries --

    dependency

    groupIdorg.hibernate/groupId

    artifactIdhibernate-jpamodelgen/artifactId

    scopeprovided/scope

    /dependency

    !-- The rewrite library allows us to do url rewriting - used here for rewriting mobile devices to mobile specific views --

    dependency

    groupIdorg.ocpsoft.rewrite/groupId

    artifactIdrewrite-servlet/artifactId

    /dependency

    !-- The cdi integration allows for CDI injection into the rewrite configuration class --

    dependency

    groupIdorg.ocpsoft.rewrite/groupId

    artifactIdrewrite-integration-cdi/artifactId

    /dependency

    !-- Annotation processor that raising compilation errors whenever

    constraint annotations are incorrectly used. --

    dependency

    groupIdorg.hibernate/groupId

    artifactIdhibernate-validator-annotation-processor/artifactId

    scopeprovided/scope

    /dependency

    !-- seam 3 per security --

    dependency

    groupIdorg.jboss.seam.security/groupId

    artifactIdseam-security/artifactId

    /dependency

    dependency

    groupIdjoda-time/groupId

    artifactIdjoda-time/artifactId

    /dependency

    !-- Needed for running tests (you may also use TestNG) --

    dependency

    groupIdjunit/groupId

    artifactIdjunit/artifactId

    scopetest/scope

    /dependency

    !-- Optional, but highly recommended --

    !-- Arquillian allows you to test enterprise code such as EJBs and Transactional(JTA) JPA from JUnit/TestNG --

    dependency

    groupIdorg.jboss.arquillian.junit/groupId

    artifactIdarquillian-junit-container/artifactId

    scopetest/scope

    /dependency

    dependency

    groupIdorg.jboss.arquillian.protocol/groupId

    artifactIdarquillian-protocol-servlet/artifactId

    scopetest/scope

    /dependency

    /dependencies

    build

    !-- Maven will append the version to the finalName (which is the name given to the generated war, and hence the context root) --

    finalName${project.artifactId}/finalName

    plugins

    !-- Compiler plugin enforces Java 1.6 compatibility and activates annotation processors --

    plugin

    artifactIdmaven-compiler-plugin/artifactId

    version${compiler.plugin.version}/version

    configuration

    source${maven.compiler.source}/source

    target${maven.compiler.target}/target

    /configuration

    /plugin

    plugin

    artifactIdmaven-war-plugin/artifactId

    version${war.plugin.version}/version

    configuration

    !-- Java EE 6 doesn't require web.xml, Maven needs to catch up! --

    failOnMissingWebXmlfalse/failOnMissingWebXml

    archive

    manifestEntries

    Dependenciescom.google.guava,org.slf4j/Dependencies

    /manifestEntries

    /archive

    /configuration

    /plugin

    !-- The JBoss AS plugin deploys your war to a local JBoss AS container --

    !-- To use, run: mvn package jboss-as:deploy --

    plugin

    groupIdorg.jboss.as.plugins/groupId

    artifactIdjboss-as-maven-plugin/artifactId

    version${jboss.as.plugin.version}/version

    /plugin

    /plugins

    /build

    profiles

    profile

    !-- The default profile skips all tests, though you can tune it to run just unit tests based on a custom pattern --

    !-- Seperate profiles are provided for running all tests, including Arquillian tests that execute in the specified container --

    iddefault/id

    activation

    activeByDefaulttrue/activeByDefault

    /activation

    build

    plugins

    plugin

    artifactIdmaven-surefire-plugin/artifactId

    version${surefire.plugin.version}/version

    configuration

    skiptrue/skip

    /configuration

    /plugin

    /plugins

    /build

    /profile

    profile

    !-- An optional Arquillian testing profile that executes tests in your JBoss AS instance --

    !-- This profile will start a new JBoss AS instance, and execute the test, shutting it down when done --

    !-- Run with: mvn clean test -Parq-jbossas-managed --

    idarq-jbossas-managed/id

    dependencies

    dependency

    groupIdorg.jboss.as/groupId

    artifactIdjboss-as-arquillian-container-managed/artifactId

    scopetest/scope

    /dependency

    /dependencies

    /profile

    profile

    !-- An optional Arquillian testing profile that executes tests in a remote JBoss AS instance --

    !-- Run with: mvn clean test -Parq-jbossas-remote --

    idarq-jbossas-remote/id

    dependencies

    dependency

    groupIdorg.jboss.as/groupId

    artifactIdjboss-as-arquillian-container-remote/artifactId

    scopetest/scope

    /dependency

    /dependencies

    /profile

    profile

    !-- When built in OpenShift the 'openshift' profile will be used when invoking mvn. --

    !-- Use this profile for any OpenShift specific customization your app will need. --

    !-- By default that is to put the resulting archive into the 'deployments' folder. --

    !-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html --

    idopenshift/id

    build

    plugins

    plugin

    artifactIdmaven-war-plugin/artifactId

    version${war.plugin.version}/version

    configuration

    outputDirectorydeployments/outputDirectory

    warNameROOT/warName

    /configuration

    /plugin

    /plugins

    /build

    /profile

    profile

    !-- Activate this profile to identify to the IDE which version of the JSF impl is being used by the application server.--

    !-- Be sure to include the JBoss maven repository, as the JBoss jsf-impl artifacts are not in maven central. --

    !-- See: https://community.jboss.org/wiki/MavenGettingStarted-Developers --

    iddebug/id

    dependencies

    !-- Import the JSF impl, to allow for application debugging --

    dependency

    groupIdcom.sun.faces/groupId

    artifactIdjsf-impl/artifactId

    scopeprovided/scope

    /dependency

    /dependencies

    /profile

    /profiles

    /project

    any idea?

    Regards

    Luca

    DB:2.66:Jboss 7.1 Cdi And Seam 3 Security Issue 8k


    Hello. I had similar issue.

    You have two ELContext producers: from org.jboss.solder:solder-impl (through seam-security) and from org.ocpsoft.rewrite:cdi-integration. If you don't use expression language, you can try to turn off ELContextProducer in artifact. Or shade it with maven shade plugin.

  • RELEVANCY SCORE 2.64

    DB:2.64:Query Is Not Retrieving Updated Value From Database. cx


    I've a view object that consists of joining a header and detail Entity object. In addition, the VO has a transient attribute that queries a 3rd table to get the count of rows that contain the row's id atribute, using this expression:

    StringUsagesCounterView.count("Id") The 3rd table is not updated by the ADF app, but instead is periodically populated by an external process.

    The UI for this is an ADF Faces page with an af:query and a search results table.

    What i am finding is that when the 3rd table is updated, the correct count is not returned in the following scenario:

    1. User selects a named search (from view criteria) and executes a search.
    2. After the search is executed, the 3rd table is updated by the external app to add a new row.
    3. User re-executes the search. The old count is displayed, not the updated count. This syndrome persists for some time - in the range of 30 seconds to 2 minutes perhaps - before the search pulls in the correct count.

    Is there a property value or something that i can specify to force the search to always retrieve the latest? (Which i thought would be the default behavior, but perhaps not?).

    if it matters, the af:query queryListener property value points to a backing bean function which includes the following - did i do something wrong here perhaps?

    public void messagesQueryListener(QueryEvent queryEvent) {
    final String searchExpr = "#{bindings.MessagesJoinedVCNumberMatchQuery.processQuery}";
    //execute the search
    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getELContext();
    ExpressionFactory efactory =
    fctx.getApplication().getExpressionFactory();
    MethodExpression methodExpr =
    efactory.createMethodExpression(elctx, searchExpr, Object.class,
    new Class[] { QueryEvent.class });
    methodExpr.invoke(elctx, new Object[] { queryEvent });
    ......
    }Am using JDeveloper 11.1.1.6, Linux.

    Thanks for your help.

    Edited by: user757151 on Apr 17, 2012 11:29 AM

    DB:2.64:Query Is Not Retrieving Updated Value From Database. cx

    Frank, the View Criteria is configured to query the database.

  • RELEVANCY SCORE 2.64

    DB:2.64:Values Set In Backing Bean Returning Null On Submit. cj


    Hi Everyone,

    Use Case:

    User selects "New Customer". In AppModule, a Customer record is created along with two Address records, one for billing and one for shipping. User is then sent to a customer wizard where he/she enters in the Customer name, presses next and fills in the Billing Address fields, presses next again to go to the Shipping Screen.

    On this Shipping Screen, there is a checkbox that says "Same as Billing Address" which, when checked, imports the information from the Billing Screen. This information is clearly seen as being imported into the form. The user then clicks the "Finish" button to exit the task flow and commit the data.

    The problem occurs at submit, with JDev saying NULL values cannot be committed. I made a quick system.out.println() in an onFinishButton() function which does indeed show that the shipping address values are null despite being shown on screen. How can values be displayed on screen yet be committed as null?

    public void onSameAsCheckBoxChange(ValueChangeEvent valueChangeEvent)
    {
    if (this.getSameAsCheckBox().getValue().equals(true))
    {
    // Retrieving form information from previous page
    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getELContext();
    Application application = fctx.getApplication();
    ExpressionFactory exprFactory = application.getExpressionFactory();
    ValueExpression valueExpr =
    exprFactory.createValueExpression(elctx, "#{data.com_prometheus_cinder_CustomerCenterModule_view_newBillingAddressPageDef.GlaCustomerBpAddressesIterator}",
    Object.class);
    DCIteratorBinding dciter = (DCIteratorBinding) valueExpr.getValue(elctx);
    Row baRow = dciter.getRowSetIterator().previous();

    // Importing form information from previous page to current page
    Row saRow = dciter.getRowSetIterator().getCurrentRow();
    saRow.setAttribute("Name", baRow.getAttribute("Name"));
    saRow.setAttribute("AddressAttn", baRow.getAttribute("AddressAttn"));
    saRow.setAttribute("AddressCity", baRow.getAttribute("AddressCity"));
    saRow.setAttribute("AddressCountry", baRow.getAttribute("AddressCountry"));
    saRow.setAttribute("AddressPostal", baRow.getAttribute("AddressPostal"));
    saRow.setAttribute("AddressState", baRow.getAttribute("AddressState"));
    saRow.setAttribute("AddressStreet", baRow.getAttribute("AddressStreet"));
    // I have tried both setting row attributes and setting bind variables. Both submit as null
    // Is there not a way to set the inputValue() ?
    /*
    this.getSname().setValue(baRow.getAttribute("Name"));
    this.getSattn().setValue(baRow.getAttribute("AddressAttn"));
    this.getScity().setValue(baRow.getAttribute("AddressCity"));
    this.getScountry().setValue(baRow.getAttribute("AddressCountry"));
    this.getSpostalCode().setValue(baRow.getAttribute("AddressPostal"));
    this.getSstate().setValue(baRow.getAttribute("AddressState"));
    this.getSstreet().setValue(baRow.getAttribute("AddressStreet"));
    */

    AdfFacesContext.getCurrentInstance().addPartialTarget(this.getShippingForm());
    }
    }

    public void onFinishButton(ActionEvent actionEvent)
    {
    // Quick printout of row values shows them to be null
    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getELContext();
    Application application = fctx.getApplication();
    ExpressionFactory exprFactory = application.getExpressionFactory();
    ValueExpression valueExpr =
    exprFactory.createValueExpression(elctx, "#{data.com_prometheus_cinder_CustomerCenterModule_view_newShippingAddressPageDef.GlaCustomerBpAddressesIterator}",
    Object.class);
    DCIteratorBinding dciter = (DCIteratorBinding) valueExpr.getValue(elctx);

    RowSetIterator rs = ((RowSet) dciter.getRowSetIterator()).createRowSetIterator("rs");
    while (rs.hasNext())
    {
    Row next = rs.next();
    System.out.println(next.getAttribute("BpKey") + " - " + next.getAttribute("BillShip") + " - " +
    next.getAttribute("Name") + " - " + next.getAttribute("AddressStreet"));
    }
    rs.closeRowSetIterator();
    ActionEvent aE = new ActionEvent(this.getToFinishButton());
    aE.queue();
    }Any ideas? Using JDev 11.1.2.1.0

    DB:2.64:Values Set In Backing Bean Returning Null On Submit. cj

    I changed my checkbox function to the following, forsaking the whole expression language data.pagedef route in favor of going through an iterator. Annnnnd..... it works. Why wouldn't it work the other way. Who knows? My gut is saying it was some kind of pass by reference logic error. Yet more ADF Magic I just don't understand, but hope it helps somebody else out.
    public void onSameAsCheckBoxChange(ValueChangeEvent valueChangeEvent)
    {
    if (this.getSameAsCheckBox().getValue().equals(true))
    {
    BindingContainer bindings = ADFUtils.getBindings();
    DCIteratorBinding addressIterator = (DCIteratorBinding) bindings.get("GlaCustomerBpAddressesIterator");
    RowSetIterator addresses = addressIterator.getRowSetIterator();
    RowSetIterator rs = ((RowSet) addresses).createRowSetIterator("rs");
    while (rs.hasNext())
    {
    Row next = rs.next();
    if (next.getAttribute("BillShip").equals("B"))
    {
    this.getSname().setValue(next.getAttribute("Name"));
    this.getSattn().setValue(next.getAttribute("AddressAttn"));
    this.getScity().setValue(next.getAttribute("AddressCity"));
    this.getScountry().setValue(next.getAttribute("AddressCountry"));
    this.getSpostalCode().setValue(next.getAttribute("AddressPostal"));
    this.getSstate().setValue(next.getAttribute("AddressState"));
    this.getSstreet().setValue(next.getAttribute("AddressStreet"));
    }
    }
    rs.closeRowSetIterator();
    AdfFacesContext.getCurrentInstance().addPartialTarget(this.getShippingForm());
    }
    }

  • RELEVANCY SCORE 2.64

    DB:2.64:Problem Of Binding With Richfaces 4 Final d9



    I build my form but the expression language not change it always returns null.

    Bean (JobForm) :

    final ExpressionFactory expressionFactory = FacesContext.getCurrentInstance().getApplication().getExpressionFactory();

    final ELContext elContext = FacesContext.getCurrentInstance().getELContext();

    FacesContext fc = FacesContext.getCurrentInstance();

    Application application = fc.getApplication();

    panel=new HtmlPanelGrid();

    .....

    .....

    .....

    final String expression = "#{jobForm.fieldDef['1']}";

    final HtmlInputText input= (HtmlInputText) application.createComponent(HtmlInputText.COMPONENT_TYPE);

    input.setValueExpression("value", expressionFactory.createValueExpression(elContext, expression, String.class));

    panel.getChildren().add(input);

    form.xhtml:

    h:panelGrid id="section_01" binding="#{jobForm.panel}" style="width:100%; border:0px;" columns="1"

    /h:panelGrid

    thank you for your help

    DB:2.64:Problem Of Binding With Richfaces 4 Final d9


    I build my form but the expression language not change it always returns null.

    Bean (JobForm) :

    final ExpressionFactory expressionFactory = FacesContext.getCurrentInstance().getApplication().getExpressionFactory();

    final ELContext elContext = FacesContext.getCurrentInstance().getELContext();

    FacesContext fc = FacesContext.getCurrentInstance();

    Application application = fc.getApplication();

    panel=new HtmlPanelGrid();

    .....

    .....

    .....

    final String expression = "#{jobForm.fieldDef['1']}";

    final HtmlInputText input= (HtmlInputText) application.createComponent(HtmlInputText.COMPONENT_TYPE);

    input.setValueExpression("value", expressionFactory.createValueExpression(elContext, expression, String.class));

    panel.getChildren().add(input);

    form.xhtml:

    h:panelGrid id="section_01" binding="#{jobForm.panel}" style="width:100%; border:0px;" columns="1"

    /h:panelGrid

    thank you for your help

  • RELEVANCY SCORE 2.63

    DB:2.63:To Execute Procedure In Applicationmoduleimpl.Java pm


    Hi,

    I am using JDev 11GR2.

    I am facing problem in returning values from custom method which is there in AppModuleImpl.java.

    here is the details about my problem.

    I have the following method in AppModuleLocalImpl which works properly if I wont return anything from this method. this method is used to call DB store procedure. suggest me if there is any alternative to acheive this functionality.

    public void callProcedure() {
    System.out.println("inside callProcedure");
    String ret=null;

    CallableStatement st = null;
    try {
    String stmt="begin enc_pkg1.select_features(?,?);end;";
    st =
    getDBTransaction().createCallableStatement(stmt,0);
    st.registerOutParameter(2,OracleTypes.VARCHAR);
    st.setObject(1, 1);

    st.executeUpdate();

    System.out.println("st.getObject(1);"+st.getObject(2));
    //return st.getObject(2);

    } catch (SQLException e) {
    throw new JboException(e);
    } finally {
    if (st != null) {
    try {

    st.close();
    } catch (SQLException e) {
    }
    }
    }

    }

    I am calling above method from Backing bean in the following manner.

    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp =
    elFactory.createValueExpression(elContext, "#{bindings}", Object.class);
    BindingContainer binding= (BindingContainer)valueExp.getValue(elContext);
    OperationBinding operationBinding=binding.getOperationBinding("callProcedure");

    // Invoke the Application module method
    operationBinding.execute();

    If i try to return any value from the Impl class method, it will throw run time or compile time errors.

    Method signature for returning values will be as follows.

    public Object callProcedure() {
    System.out.println("inside callProcedure");
    String ret=null;

    CallableStatement st = null;
    try {
    String stmt="begin enc_pkg1.select_features(?,?);end;";
    st =
    getDBTransaction().createCallableStatement(stmt,0);
    st.registerOutParameter(2,OracleTypes.VARCHAR);
    st.setObject(1, 1);

    st.executeUpdate();

    System.out.println("st.getObject(1);"+st.getObject(2));
    return st.getObject(2);

    } catch (SQLException e) {
    throw new JboException(e);
    } finally {
    if (st != null) {
    try {

    st.close();
    } catch (SQLException e) {
    }
    }
    }

    I will get compile time error as follows:

    Error(134,21): callProcedure() in model.AppModuleLocalImpl cannot implement callProcedure() in model.common.AppModuleLocal; attempting to use incompatible return type.

    If I cannot implement this method here, where else I can implement this method.

    I followed all steps to expose this method to UI and added this method to PageDef.xml.

    please suggest me how I can return values from this class.

    thanks,
    Veeresh

  • RELEVANCY SCORE 2.63

    DB:2.63:Adf11g: Issue With Fetching Associated Value From Select One Choice zs


    Hi,
    I am using ADF 11g.

    in my application using a view object (VO1) i had created a select one choice.

    My view object (VO1) is having two fields:
    Product
    Price

    In select one choice i am displaying only Product.

    My requirment is to fetch the price of selected Product. To do so I wrote below piece of code:
    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    +ValueExpression valueExp = elFactory.createValueExpression(elContext, "#{bindings.Price.inputValue}", Object.class);+
    +String pricingAttrValue = (String)valueExp.getValue(elContext);+

    In above code Price is an attributeName mapped in pageDef.xml

    *But the problem I am facing is:*
    When i am trying to retrive the Price Value of selected Product, i am getting the value of previously selected product.
    To understand this better:

    On Value Change Event for select One choice we get 2 values:
    getOldValue()
    and getNewValue()

    *with the above code i am getting price value associated with OldValue where as I need price value associated with NewValue.*

    Please help,
    Thanks n Regards
    Manav Ratra

  • RELEVANCY SCORE 2.63

    DB:2.63:Immediate Property Of Actionsource Component And Re-Evaluate Value Of Table. dd


    I have a simple .jspx page as image below:http://farm6.staticflickr.com/5498/9662848095_5c5e7cc380.jpgValue Binding of table is tree binding(value="#{bindings.EmployeesView1.collectionModel}" ), Employee in example is table in schema hr of oracle database. Property immediate of button is true, actionlistener is #{bean1.changeValue}. This is code of changeValue in bean1
    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application application = facesContext.getApplication();
    ExpressionFactory expressionFactory = application.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExpression =
    expressionFactory.createValueExpression(elContext, "#{data.AppModuleDataControl.dataProvider}", Object.class);
    ApplicationModule am= (ApplicationModule)valueExpression.getValue(elContext);
    ViewObject vo=am.findViewObject("EmployeesView1");
    Row r=vo.first();
    r.setAttribute("Email", "robin123");

    When i click button, function changeValue was called in phase applyrequest( due set "immediate=true"), skip validation, updatemodel phase. Following Video ADF Insider: Avoid JSF and ADF lifecycle frustration of Frank Nimphius(minute: 20), UI component do not re-evaluate their value binding. But fact, value email of first record of employee in table was changed into "robin123" on web browser. I don't understand why is that?.

    DB:2.63:Immediate Property Of Actionsource Component And Re-Evaluate Value Of Table. dd


    In your pageDef file, what do u have the iterator's "refresh" attribute set to ? Is it set to default (deferred) or something else ?
    The iterator 's refresh attribute set to default(deferred).
    immediate=true only ships some of the life cycle phases, but still issues a full request. Only if you set partial submit to true the button does not submit the whole page.
    Summit the wholde page but skip the validate, update model phase.Thanks

  • RELEVANCY SCORE 2.63

    DB:2.63:How To Evaluate A Groovy Expression Programmatically? 18


    Hello,

    is there a way to evaluate a groovy expression programmatically in the Model?

    Basically, I need to obtain the same result of the method below, which unfortunatly must be called from the view only:

    private static Object resolveExpression(String expression) {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp =
    elFactory.createValueExpression(elContext, expression,
    Object.class);
    return valueExp.getValue(elContext);
    }

    DB:2.63:How To Evaluate A Groovy Expression Programmatically? 18

    im not sure whnther you are expcting this

    ResourceBundle rbundle = ResourceBundle.getBundle("'my.resbundle.in.memory");
    ....String msg = rbundle.getString("LOCATION_NOT_NULL");

    or

    GroovyShell g = new GroovyShell();
    g.evaluate("my.resbundle.in.memory']['key']");

  • RELEVANCY SCORE 2.63

    DB:2.63:Accessing Viewscope Bean In The Method Call km


    Hi

    I am using Jdev 11.1.1.6.0

    I have a taskflow tf1 with a page fragment say test.jsff and test.jsff has 2 regions TF2 and TF3.

    TF2 has method call and then test1.jsff
    TF3 has method call and then test2.jsff

    My idea is to define a viewScope bean in tf1 and access it from method call of TF2 and TF3 to store some TF2 and TF3 specific data on viewScope bean..

    My problem is when i do the following code inside method call of TF2.. I am getting null for the viewScope bean. Am i doing something wrong here.. The regBean is coming as null

    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getELContext();
    ExpressionFactory expFactory = fctx.getApplication().getExpressionFactory();
    String tfName = (String) RequestContext.getCurrentInstance().getPageFlowScope().get("name");
    ValueExpression ve = expFactory.createValueExpression(elctx, "#{viewScope.registerbean}", Object.class);
    RegisterBean regBean = (RegisterBean) ve.getValue(elctx);

    Thanks
    Raghu

    DB:2.63:Accessing Viewscope Bean In The Method Call km

    Hi,

    pass the viewScope bean as an input parameter to the second task flow and you gain access.

    Frank

  • RELEVANCY SCORE 2.62

    DB:2.62:The Class 'Java.Lang.String' Does Not Have The Property 'Attributevalues' 1x


    hi am trying to get display value of lov but am geting this error when running application,am in jdeveloper 11.1.1.6.0
    error is The class 'java.lang.String' does not have the property 'attributeValues'

    this is what i have done
    af:selectOneChoice value="#{bindings.Officecode.inputValue}"
    label="#{bindings.Officecode.label}"
    shortDesc="#{bindings.Officecode.hints.tooltip}"
    id="soc9" simple="true" required="true"
    valueChangeListener="#{pageFlowScope.orgDetailsBean.valueChangedtest}"
    autoSubmit="true" immediate="true"
    f:selectItems value="#{bindings.Officecode.items}"
    id="si5"/
    /af:selectOneChoice

    af:outputText value="quot;Selected Index : #{bindings.Officecode.selectedIndex}quot;"
    id="ot7"
    partialTriggers="soc9"
    binding="#{backingBeanScope.Selectechoice.ot1}"/af:outputText value="quot;Selected Value : #{bindings.Officecode.attributeValue}quot;"
    id="ot8"
    binding="#{backingBeanScope.Selectechoice.ot2}"
    partialTriggers="soc9"/af:outputText value="quot;Display Value : #{bindings.Officecode.selectedValue.attributeValues[1]}quot; "
    id="ot9"
    partialTriggers="soc9"/

    public Object getElExpression(String el) {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
    ValueExpression valueExp = expressionFactory.createValueExpression(elContext,el,Object.class);
    return valueExp.getValue(elContext);
    }

    public void setElExpression(String el, Object val) {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
    ValueExpression valueExp = expressionFactory.createValueExpression(elContext, el, Object.class);
    valueExp.setValue(elContext, val);
    }

    // Add the below code in valueChangeListener of SelectOneChoice
    public void valueChangedofficecode(ValueChangeEvent valueChangeEvent) {
    this.setElExpression("#{bindings.Officecode.inputValue}", valueChangeEvent.getNewValue());
    this.ot1.setValue("Selected Index : " + getElExpression("#{bindings.Officecode.selectedIndex}").toString());
    this.ot2.setValue("Selected Value : " + getElExpression("#{bindings.Officecode.attributeValue}").toString());
    this.ot3.setValue("Display Value : " +
    getElExpression("#{bindings.Officecode.selectedValue.e.attributeValues[1]}").toString());
    }

    even if i change to getElExpression("#{bindings.Officecode.selectedValue.e.attributeValue[1]}").toString()); i stl get error

    the log error is
    29 May 2013 9:23:02 AM Error HTTP BEA-101020 [ServletContext@6151867[app:j2ee-app module:UAMApplication-ViewController-context-root path:/UAMApplication-ViewController-context-root spec-version:2.5]] Servlet failed with Exception
    javax.el.PropertyNotFoundException: The class 'java.lang.String' does not have the property 'attributeValues'.
    at javax.el.BeanELResolver.getBeanProperty(BeanELResolver.java:547)
    at javax.el.BeanELResolver.getValue(BeanELResolver.java:249)
    at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:173)
    at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:200)
    at com.sun.el.parser.AstValue.getValue(Unknown Source)
    Truncated. see log file for complete stacktrace

    29 May 2013 9:23:02 AM Notice Diagnostics BEA-320068 Watch 'UncheckedException' with severity 'Notice' on server 'DefaultServer' has triggered at 29 May 2013 9:23:02 AM. Notification details:
    WatchRuleType: Log
    WatchRule: (SEVERITY = 'Error') AND ((MSGID = 'WL-101020') OR (MSGID = 'WL-101017') OR (MSGID = 'WL-000802') OR (MSGID = 'BEA-101020') OR (MSGID = 'BEA-101017') OR (MSGID = 'BEA-000802'))
    WatchData: DATE = 29 May 2013 9:23:02 AM SERVER = DefaultServer MESSAGE = [ServletContext@6151867[app:j2ee-app module:UAMApplication-ViewController-context-root path:/UAMApplication-ViewController-context-root spec-version:2.5]] Servlet failed with Exception
    javax.el.PropertyNotFoundException: The class 'java.lang.String' does not have the property 'attributeValues'.
    at javax.el.BeanELResolver.getBeanProperty(BeanELResolver.java:547)
    at javax.el.BeanELResolver.getValue(BeanELResolver.java:249)
    at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:173)
    at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:200)
    at com.sun.el.parser.AstValue.getValue(Unknown Source)
    at com.sun.el.parser.AstDeferredExpression.getValue(Unknown Source)
    at com.sun.el.parser.AstCompositeExpression.getValue(Unknown Source)
    at com.sun.el.ValueExpressionImpl.getValue(Unknown Source)
    at org.apache.myfaces.trinidad.bean.FacesBeanImpl.getProperty(FacesBeanImpl.java:68)
    at oracle.adfinternal.view.faces.renderkit.rich.ValueRenderer.getValue(ValueRenderer.java:184)
    at oracle.adfinternal.view.faces.renderkit.rich.ValueRenderer.getConvertedString(ValueRenderer.java:145)
    at oracle.adfinternal.view.faces.renderkit.rich.OutputTextRenderer.encodeAll(OutputTextRenderer.java:148)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:421)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelHeaderRenderer.renderChildrenAfterHelpAndInfo(PanelHeaderRenderer.java:542)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelHeaderRenderer._renderContentCell(PanelHeaderRenderer.java:1066)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelHeaderRenderer.renderContentRow(PanelHeaderRenderer.java:490)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelHeaderRenderer.encodeAll(PanelHeaderRenderer.java:231)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:432)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$300(PanelGroupLayoutRenderer.java:30)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:682)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:601)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:170)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
    at oracle.adfinternal.view.faces.taglib.region.IncludeTag$FacetWrapper.processFlattenedChildren(IncludeTag.java:675)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:160)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
    at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:255)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:358)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
    at oracle.adf.view.rich.render.RichRenderer.encodeStretchedChild(RichRenderer.java:2004)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer._renderPane(PanelSplitterRenderer.java:1360)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer.encodeAll(PanelSplitterRenderer.java:279)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:421)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelHeaderRenderer.renderChildrenAfterHelpAndInfo(PanelHeaderRenderer.java:542)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelHeaderRenderer._renderContentCell(PanelHeaderRenderer.java:1066)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelHeaderRenderer.renderContentRow(PanelHeaderRenderer.java:490)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelHeaderRenderer.encodeAll(PanelHeaderRenderer.java:231)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:421)
    at oracle.adfinternal.view.faces.renderkit.rich.PageTemplateRenderer.encodeAll(PageTemplateRenderer.java:69)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.encodeEnd(ContextSwitchingComponent.java:155)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:421)
    at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer._encodeChildren(RegionRenderer.java:278)
    at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer.encodeAll(RegionRenderer.java:201)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at oracle.adf.view.rich.component.fragment.UIXRegion.encodeEnd(UIXRegion.java:300)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:421)
    at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:220)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:421)
    at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1324)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
    at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:266)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:197)
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:189)
    at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:911)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:367)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:222)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:179)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    at weblogic.servlet.internal.WebAppServletContext$ServletIam foolowing this sample
    http://mahmoudoracle.blogspot.com/2011/08/selectonechoice-value.html#.UaS-0qMZ4f4

    Edited by: adf009 on 2013/05/29 10:30 AM

    DB:2.62:The Class 'Java.Lang.String' Does Not Have The Property 'Attributevalues' 1x

    am still geting the error even if i follow your sample
    af:selectOneChoice value="#{bindings.Officecode.inputValue}"
    label="#{bindings.Officecode.label}"
    shortDesc="#{bindings.Officecode.hints.tooltip}"
    id="soc9" simple="true" required="true"
    autoSubmit="true" immediate="true"
    valueChangeListener="#{pageFlowScope.orgDetailsBean.valueChangedoffie}"
    f:selectItems value="#{bindings.Officecode.items}"
    id="si5"/
    /af:selectOneChoice

    af:outputText
    id="ot8"
    partialTriggers="soc9"
    value='"Selected Value: #{bindings.Officecode.attributeValue}"'/af:outputText
    id="ot9"
    partialTriggers="soc9"
    binding="#{backingBeanScope.Selectechoice.ot3}"
    value="quot;Display Value: #{bindings.Officecode.selectedValue ne ' ' ? bindings.Officecode.selectedValue.attributeValues[1] : ''}quot;"/

    public void valueChangedoffie(ValueChangeEvent valueChangeEvent) {
    this.setValueToEL("#{bindings.Officecode.inputValue}", valueChangeEvent.getNewValue());
    String val=(String) resolveExpression("#{bindings.Officecode.attributeValue}");
    System.out.println("officeselected " +val);


    }

    log error is
    javax.el.PropertyNotFoundException: The class 'java.lang.String' does not have the property 'attributeValues'.
    at javax.el.BeanELResolver.getBeanProperty(BeanELResolver.java:547)
    at javax.el.BeanELResolver.getValue(BeanELResolver.java:249)
    at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:173)
    at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:200)
    at com.sun.el.parser.AstValue.getValue(Unknown Source)
    at com.sun.el.parser.AstChoice.getValue(Unknown Source)
    at com.sun.el.parser.AstDeferredExpression.getValue(Unknown Source)
    at com.sun.el.parser.AstCompositeExpression.getValue(Unknown Source)
    at com.sun.el.ValueExpressionImpl.getValue(Unknown Source)
    at org.apache.myfaces.trinidad.bean.FacesBeanImpl.getProperty(FacesBeanImpl.java:68)
    at oracle.adfinternal.view.faces.renderkit.rich.ValueRenderer.getValue(ValueRenderer.java:184)
    at oracle.adfinternal.view.faces.renderkit.rich.ValueRenderer.getConvertedString(ValueRenderer.java:145)
    at oracle.adfinternal.view.faces.renderkit.rich.OutputTextRenderer.encodeAll(OutputTextRenderer.java:148)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:421)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelHeaderRenderer.renderChildrenAfterHelpAndInfo(PanelHeaderRenderer.java:542)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelHeaderRenderer._renderContentCell(PanelHeaderRenderer.java:1066)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelHeaderRenderer.renderContentRow(PanelHeaderRenderer.java:490)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelHeaderRenderer.encodeAll(PanelHeaderRenderer.java:231)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:432)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$300(PanelGroupLayoutRenderer.java:30)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:682)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:601)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:170)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
    at oracle.adfinternal.view.faces.taglib.region.IncludeTag$FacetWrapper.processFlattenedChildren(IncludeTag.java:675)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:160)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
    at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:255)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:358)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
    at oracle.adf.view.rich.render.RichRenderer.encodeStretchedChild(RichRenderer.java:2004)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer._renderPane(PanelSplitterRenderer.java:1360)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer.encodeAll(PanelSplitterRenderer.java:279)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:421)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelHeaderRenderer.renderChildrenAfterHelpAndInfo(PanelHeaderRenderer.java:542)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelHeaderRenderer._renderContentCell(PanelHeaderRenderer.java:1066)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelHeaderRenderer.renderContentRow(PanelHeaderRenderer.java:490)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelHeaderRenderer.encodeAll(PanelHeaderRenderer.java:231)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:421)
    at oracle.adfinternal.view.faces.renderkit.rich.PageTemplateRenderer.encodeAll(PageTemplateRenderer.java:69)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.encodeEnd(ContextSwitchingComponent.java:155)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:421)
    at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer._encodeChildren(RegionRenderer.java:278)
    at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer.encodeAll(RegionRenderer.java:201)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at oracle.adf.view.rich.component.fragment.UIXRegion.encodeEnd(UIXRegion.java:300)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:421)
    at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:220)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:421)
    at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1324)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
    at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:266)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:197)
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:189)
    at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:911)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:367)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:222)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:179)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

  • RELEVANCY SCORE 2.62

    DB:2.62:Help Debugging Facescontext, Elcontext And Elfactory.Createvalueexpression m7


    Using JDeveloper 11.1.1.4.0

    I am getting a final result of null in the code below:
    TreeTableStateBean stateBean = null;

    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getELContext();
    ExpressionFactory elFactory = fctx.getApplication().getExpressionFactory();

    ValueExpression ve = elFactory.createValueExpression(
    elctx,
    "#{viewScope.treeTableStateBean}",
    Object.class);

    stateBean = (TreeTableStateBean) ve.getValue(elctx);
    return stateBean;It appears that the FacesContext, ElContext and the Value Expression ve all have complex objects with values, but when trying the next line, it returns null to the stateBean. I got this code from ADF Code Corner 84. I can run the example and it returns values other than null. I don't seem to see the "needle in the haystack" of what I am missing. One major difference in my application is that it is on a bounded taskflow with a jsff, that is dropped onto a jspx page. The bounded taskflow has the map entries for the managed beanTreeTableStateBean:
    managed-bean id="__126"
    managed-bean-name id="__124"TreeTableStateBean/managed-bean-name
    managed-bean-classtax.viewamtsowedtreetbl.view.TreeTableStateBean/managed-bean-class
    managed-bean-scope id="__125"view/managed-bean-scope
    map-entries id="__130"
    map-entry id="__136"
    key id="__134"NodeLabel/key
    value id="__135"true/value
    /map-entry
    map-entry id="__133"
    key id="__132"Totalbaldue/key
    value id="__131"true/value
    /map-entry
    /map-entries
    /managed-beanAny help to solve this would be greatly appreciated.

    Thanks,
    Troy

  • RELEVANCY SCORE 2.61

    DB:2.61:Navigating To A Tab From Another Tab Using A Button Click dz


    Hi All,

    There are 3 tabs in my page in af:panelTabbed component.

    In Tab 1, there is drop down to select Tab 2, Tab 3 and then a button. Upon clicking the button I need to navigate to appropriate Tab selected in the drop down list.

    I have tried the following:
    1) Set the Disclosure property of tab 1, tab 2 and tab 3 to binded booleans variable: #{managedBean.showTab1}
    2) Set disclosure listener to the following method:

    public void pt_disclosureListener(DisclosureEvent disclosureEvent) {
    FacesContext ctx = FacesContext.getCurrentInstance();
    Application app = ctx.getApplication();
    ExpressionFactory ef = app.getExpressionFactory();
    ELContext ec = ctx.getELContext();

    ValueExpression tab1 =
    ef.createValueExpression(ec, "#{managedBean.showTab1}",
    Boolean.class);
    ValueExpression tab2 =
    ef.createValueExpression(ec, "#{managedBean.showTab2}",
    Boolean.class);
    ValueExpression tab3 =
    ef.createValueExpression(ec, "#{managedBean.showTab3}",
    Boolean.class);

    ValueExpression tabSelected =
    ef.createValueExpression(ec, "#{dropDownManagedBean.selectedTab}",
    String.class);

    if (tabSelected .getValue(ec).equals("TAB2")) {
    tab1.setValue(ec, false);
    tab2.setValue(ec, true);
    tab3.setValue(ec, false);
    }
    if (actionSelected.getValue(ec).equals("TAB3")) {
    tab1.setValue(ec, false);
    tab2.setValue(ec, false);
    tab3.setValue(ec, true);
    }
    }
    3) For the button, I have set the action to navigate to the page (using the navigation rule specified in faces-config).

    With this, the navigation is happening only for the second click. For the first click it just navigates to the start of page or to the previously selected Tab.
    Please let me know if the way I am trying to achieve the requirement is correct or not.

    Also please let me know if there is some easire way to achive this (if what i am doing is not correct).

    Thanks,
    Sitaram

    DB:2.61:Navigating To A Tab From Another Tab Using A Button Click dz

    The tabs are create at design time only.
    My only requirement is to navigate from tab 1 to tab 2 using a button click in tab 1.

    But with the code I have written its not happening correctly. The binded variable values are being set properly(tested using watch in debug mode), but i am able to navigate only on the second click.

    Hope I am not confusing you, or have I coded it completely wrong?

    Thanks,
    Sitaram

  • RELEVANCY SCORE 2.60

    DB:2.60:Get Real Cause From Elexception 3m


    In my bean, I have a method say MyActionListener throw MyRunTimeException.
    void MyActionListener(ActionEvent actionEvent) {
    ...
    //throw my exception here
    throw new MyRunTimeException();
    }
    Another bean I want invoke this listener
    invokeActionListenerExpression(ActionEvent actionEvent,
    String method) {
    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getELContext();
    ExpressionFactory elFactory =
    fctx.getApplication().getExpressionFactory();
    MethodExpression mExpr =
    elFactory.createMethodExpression(elctx, "#{component.handle" +
    method + "}", null,
    new Class[] { ActionEvent.class });
    mExpr.invoke(elctx, new Object[] { actionEvent });
    }

    try {
    invokeActionListenerExpression(actionEvent,
    "MyActionListener");
    } catch (MyRunTimeException e) {
    //I want to handle this with a separate logic, but I saw an ELException; so it doesn't go in this block.

    } catch (Exception e) {
    //handle here

    }

    I tried to catch MyRunTimeException, I want to handle this with a separate logic, but it doesn't go in this block.Seems to me any exception is wrapped in ELException.My question is how can I know MyRunTimeException is thrown?thanks

    DB:2.60:Get Real Cause From Elexception 3m

    Thanks for the reply.Maybe I didn't make it clear. What I really wanted to say and confirm here is:When I throw MyRunTimeException in my listener:void MyActionListener(ActionEvent actionEvent) { // just throw my exception, nothing else throw new MyRunTimeException();}And when I try to figure out after invoke the listener, no way, it's got swallowed! try { invokeActionListenerExpression(actionEvent, "MyActionListener"); } catch (Exception e) { //no way to get my MyRunTimeException back!!!!!!!!!! }Thnaks

  • RELEVANCY SCORE 2.58

    DB:2.58:Re: Load Lov 7j


    The code(backbean) below:

    public EditSwitchDevice() {
    if (!AdfFacesContext.getCurrentInstance().isPostback())
    {

    DCBindingContainer dcbBindings = (DCBindingContainer)getBindings();
    DCIteratorBinding iter =
    (DCIteratorBinding)dcbBindings.findIteratorBinding("SwitchDeviceView1Iterator");
    for (int i = 0; i iter.getViewObject().getEstimatedRowCount();
    i++) {
    Row row = iter.getRowAtRangeIndex(i);
    if (row != null){
    setSwitchTypeCode(row.getAttribute("SwitchTypeCode").toString());

    }
    System.out.println("from SwitchDeviceView1Iterator: "+switchTypeCode);
    addWhereToViewObj();
    break;
    }

    }

    }
    public AppModuleImpl getAm(){

    FacesContext fc = FacesContext.getCurrentInstance();

    Application app = fc.getApplication();

    ExpressionFactory elFactory = app.getExpressionFactory();

    ELContext elContext = fc.getELContext();

    ValueExpression valueExp = elFactory.createValueExpression(elContext, "#{data.AppModuleDataControl.dataProvider}", Object.class);

    return (AppModuleImpl)valueExp.getValue(elContext);

    }
    // this view object is to load data according to varSwitchTypeCode and this
    // represents LOV
    private void addWhereToViewObj() {

    ViewObject vo = getAm().findViewObject("ViewSwitchDeviceGroup1");

    // vo.setWhereClause("SWITCH_TYPE_CODE = :SWITCH_TYPE_CODE");

    // vo.defineNamedWhereClauseParam("SWITCH_TYPE_CODE", null, null);

    vo.setNamedWhereClauseParam("varSwitchTypeCode", getSwitchTypeCode());
    // System.out.println(vo.getQuery());

    }

    Edited by: user554338 on Aug 2, 2010 11:10 PM

    DB:2.58:Re: Load Lov 7j

    This beats me.
    I would open a new thread on this.
    And please mark this an answered...

    Timo

  • RELEVANCY SCORE 2.57

    DB:2.57:How To Create A Method Expression With A Parameter k3


    Hi All,

    I am trying to create a method expression with a parameter.
    for creating a method expression without parameter I used the following code
    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getCurrentInstance().getELContext();
    ExpressionFactory exprFactory = fctx.getApplication().getExpressionFactory();
    MethodExpression methodExpression =exprFactory.createMethodExpression(elctx,"#{myBean.methodWithoutParameter}",null, new Class?[0]);this is working fine.

    I want to create a method expression with parameter.the expression is #{myBean.methodWithParameter}and want to pass "success"How should I do it?

    Thanks,
    Puneet
    Jdev 11.1.2.2.0

    DB:2.57:How To Create A Method Expression With A Parameter k3

    Hi Timo,
    Thanks for the reply

    I am Dynamically rendering the links , for calling taskflow as dynamic regions.
    right now i have to create a separate function inside bean for each task flow.
    that I want to replace with a function inside bean accepting taskflow id as parameter.

    Are you sure I can't do it in current version?

    Thanks,
    Puneet

  • RELEVANCY SCORE 2.57

    DB:2.57:Dynamic Imagelink Component - Calling Impl Method With Input Parameter zc


    Hi All,

    I have requirement where Imagelinks are created dynamically on the pageload. Generated the components and the components are displayed on the jspx.

    Now when I click the image link, a method in AMImpl should invoke and this method takes some input parameters.

    I am able to call the method successfully in AMimpl with the help of below code. But I could not understand how to pass the input parameters to that method.

    RichCommandImageLink lockimageLink =
    new RichCommandImageLink();
    lockimageLink.setIcon("icon.png");
    lockimageLink.setId("icon" + index);
    MethodExpression me =
    JSFUtils.getMethodExpression("#{bindings." +
    "MyMethodName" +
    ".execute}");
    lockimageLink.addActionListener(new MethodExpressionActionListener(me)); public static MethodExpression getMethodExpression(String name) {
    Class [] argtypes = new Class[1];
    argtypes[0] = ActionEvent.class;
    FacesContext facesCtx = FacesContext.getCurrentInstance();
    Application app = facesCtx.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesCtx.getELContext();
    return elFactory.createMethodExpression(elContext,name,null,argtypes);
    } Can some one please suggest how to pass input parameters to the Impl method.

    Jdeveloper Version : 11.1.1.4.0

    Thanks,
    Morgan.

    Edited by: 900114 on May 12, 2012 11:23 PM

    DB:2.57:Dynamic Imagelink Component - Calling Impl Method With Input Parameter zc

    One way of achieving your requirement is to have some page flow scope variables defined to the corresponding AMImpl method params in the pageDef like

    NamedData NDName="name" NDType="Type" NDValue="#{pageFlowScope.someVariableName}"/

    and set these pageFlowScope variables in the page. Now if you click on the link the pageFlowScope variables will be passed to the method.

    Hope it helps...

    Thanks,
    TK

  • RELEVANCY SCORE 2.57

    DB:2.57:Declarative Component : Inputtext : Reverting The Value Back To Original. xf


    Hello Guyz,
    I have a declarative component which has just an inputText component, and i want people to only enter valid value on that inputText, if user types any other value than the valid value, i wanted to put back the original value it was before.

    p.s. declarative component has one inputText and i am trying to refresh that inputText which is inside declarative component.

    Example :

    ValidValue= "HR", "ACCOUNT", "FINANCE"

    inputText inside declarative component is showing "HR" for now ..... i changed it to "HR2" now i want it to go back to "HR" when valueChangeListener is called.

    this.setValueToEL(valueString,
    valueChangeEvent.getOldValue()); //Updates the model

    public void setValueToEL(String el, Object val)
    {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory expressionFactory =
    facesContext.getApplication().getExpressionFactory();
    ValueExpression exp =
    expressionFactory.createValueExpression(elContext, el, Object.class);
    exp.setValue(elContext, val);
    }But it's not reflected in the UI when i tab out from that component... I have autoSubmit to true and ValueChangeListener but refreshing the UI is the Issue... Your help is appreciated.

    Thanks

    DB:2.57:Declarative Component : Inputtext : Reverting The Value Back To Original. xf

    Thanks it worked with resetValue(). Even codigoadf way did worked after i tried yours and checked the codigoadf solution it was working... May be i have done something really silly... Thanks codigoadf as well , i really appreciate both of your help.

  • RELEVANCY SCORE 2.56

    DB:2.56:Change The Value Of A Variable Used In A View Query 7f


    I am using JDeveloper 11g to develop a simple portlet application which displays data loaded from database. I am displaying the data by dragging the ViewObject from the AppModuleDataControl to the View.jspx page and selecting the option ADF Read-only Table. My ViewObject has a single variable :empId. Now is it possible to change the value of this variable with a value that comes from the request object. On the internet I found the following code:
    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp =
    elFactory.createValueExpression(elContext, "#{data.AppModuleDataControl.dataProvider}",
    Object.class);
    ApplicationModule am = (ApplicationModule)valueExp.getValue(elContext);
    ViewObject emplVO;
    emplVO = am.findViewObject("EmployeeView1");
    emplVO.setNamedWhereClauseParam("empId", "1");I have put this code in the public void processAction(ActionRequest request, ActionResponse response) method. However this does not work when I deploy it.

    Does anyone know if the above code is correct in this case and if there is a better way how I can set this up?

    DB:2.56:Change The Value Of A Variable Used In A View Query 7f

    Hi there:
    Did you add a break point and debug the code to see what is the value for the :empid parameters passed in to your view object?
    If you are sure you have passed in the correct value for ":empid" parameter, then do the following:

    String amDef = "yourAmDef";
    String config = "yourConfig";
    ApplicationModule am =
    Configuration.createRootApplicationModule(amDef,config);
    ViewObject emplVO;
    emplVO = am.findViewObject("EmployeeView1");
    emplVO.setNamedWhereClauseParam("empId", "1");

    empVO.executeQuery();
    which will execute your view object with the new bind variable value and refresh the view.
    Please mark my answer as 'Correct' if it solves your problem, or 'Helpful' if it does.

    Thanks,
    Alex

    Edited by: Alexbie on 27-Aug-2010 8:52 AM

  • RELEVANCY SCORE 2.56

    DB:2.56:Cannot Assign Action Listener To Command Button Programmatically sf


    Jdeveloper version: 11.1.1.3.0

    Hey, my requirement is to create a button programmatically and assign an action listener to it. I'm using the following code.

    RichCommandButton edit = new RichCommandButton();
    edit.setText("Edit");

    FacesContext facesCtx = FacesContext.getCurrentInstance();
    Application app = facesCtx.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesCtx.getELContext();
    MethodExpression methodExpression =null;
    methodExpression = elFactory.createMethodExpression(elContext, "#{backingBeanScope.dataControlHandler.editActionListener}", null,
    new Class[] {ActionEvent.class});
    MethodExpressionActionListener meAL = null;
    meAL= new MethodExpressionActionListener(methodExpression);
    edit.addActionListener(meAL); The problem I'm facing is that on click of the generated button 'edit' , the action listener is not called. I would appreciate it greatly if someone could let me know why.

    DB:2.56:Cannot Assign Action Listener To Command Button Programmatically sf

    public String cb1_action() {
    // Add event code here...
    System.out.println("in cb1_action3 - 1");
    UIComponent button;
    button = findComponentInRoot("cb1");
    RichPanelGroupLayout pgl;
    pgl = (RichPanelGroupLayout)button.getParent();
    ListUIComponent children;
    children = pgl.getChildren();
    RichPanelGroupLayout pgll;
    pgll = new RichPanelGroupLayout();
    RichInputText it;
    it = new RichInputText();
    it.setLabel("New textbox " + (children.size()));
    RichCommandButton but = new RichCommandButton();
    but.setPartialSubmit(true);
    but.setText("Delete");
    /*calling actionevent*/
    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getELContext();
    Application application = fctx.getApplication();
    ExpressionFactory exprFactory = application.getExpressionFactory();

    MethodExpression methodExpr = null;
    methodExpr = exprFactory.createMethodExpression( elctx,"#{mybean.handleButtonPress}", null, new Class[] {ActionEvent.class});
    MethodExpressionActionListener actionListener = null;
    actionListener = new MethodExpressionActionListener(methodExpr);
    but.addActionListener(actionListener);
    /*end of call*/

    children.add(pgll);
    children.add(it);
    children.add(but);
    AdfFacesContext.getCurrentInstance().addPartialTarget(pgl);
    System.out.println("in cb1_action3 - 1 done");
    return null;
    }

    public String handleButtonPressed(){
    System.out.println("method execution");
    UIComponent button;
    button = findComponentInRoot("cb1");
    RichPanelGroupLayout pgl;
    pgl = (RichPanelGroupLayout)button.getParent();
    ListUIComponent children;
    children = pgl.getChildren();

    Iterator it = children.iterator();
    UIComponent uiComponent = null;
    while (it.hasNext()) {
    uiComponent = (UIComponent) it.next();
    }
    children.remove(uiComponent);
    AdfFacesContext.getCurrentInstance().addPartialTarget(pgl);
    return null;
    }

    I m trying to add INPUTTEXT and BUTTON component dynamically,which i m able to successfully. but I need to Delete the Same INPUTTEXT and BUTTON component By the Button Click.
    I have used the above code which is throwing an error saying method "mybean.handleButtonPress" not found....
    can someone help me out?

  • RELEVANCY SCORE 2.52

    DB:2.52:Exception On Rendering Breadcrums p7


    Hello folks,

    I am using the breadcrumbs component for a ADF Faces application.

    I have a managed bean in session scope holding a RichBreadCrumbs object. I populate this object with RichCommandNavigationItem.

    Here is an example of how the object is created and filled:

    //managed bean constructor
    public BreadCrumbBean() {

    breadCrumbs = new RichBreadCrumbs();

    //added a item just for testing
    //see below to understand this NaviagationItem class
    NavigationItem item = new NavigationItem("action", "text", "destination");

    breadCrumbs.getChildren().add(item.getItem());

    }

    Navigation Item is a wrapper I created. See the constructor below:

    public class NavigationItem {

    private ExpressionFactory expressionFactory = FacesContext.getCurrentInstance().getApplication().getExpressionFactory();
    private ELContext elContext = FacesContext.getCurrentInstance().getELContext();

    private RichCommandNavigationItem item = new RichCommandNavigationItem();

    public NavigationItem(String action, String text, String destination){
    super();
    item.setText(text);
    item.setDestination(destination);
    item.setId(generateRandomId());
    item.setDisabled(true);

    if(action != null)
    item.setActionExpression(createELMethodExpression(action));
    }
    }

    //there are other methods, but not relevant to this case.

    This exception is thown, a very strange IllegalArgument. I am pretty sure the managedBean and it's attribute containing the breadcrumbs are not null (I checked running debug mode), and obviosly they extend UIComponent.

    ]] Root cause of ServletException.
    java.lang.IllegalArgumentException: Cannot convert breadCrumb.breadCrumbs of type class java.lang.String to class javax.faces.component.UIComponent
    at com.sun.el.lang.ELSupport.coerceToType(ELSupport.java:397)
    at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:194)
    at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:251)
    at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:222)
    at javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:486)
    at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:670)
    at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1142)
    at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.doStartTag(UIXComponentELTag.java:70)
    at oracle.adfinternal.view.faces.unified.taglib.nav.UnifiedBreadCrumbsTag.doStartTag(UnifiedBreadCrumbsTag.java:50)
    at jsp_servlet._pages.__page_jspx._jspx___tag7(__page_jspx.java:425)
    at jsp_servlet._pages.__page_jspx._jspx___tag5(__page_jspx.java:351)
    at jsp_servlet._pages.__page_jspx._jspx___tag4(__page_jspx.java:304)
    at jsp_servlet._pages.__page_jspx._jspx___tag3(__page_jspx.java:256)
    at jsp_servlet._pages.__page_jspx._jspx___tag2(__page_jspx.java:205)
    at jsp_servlet._pages.__page_jspx._jspx___tag1(__page_jspx.java:155)
    at jsp_servlet._pages.__page_jspx._jspx___tag0(__page_jspx.java:104)
    at jsp_servlet._pages.__page_jspx._jspService(__page_jspx.java:65)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:408)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:318)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
    at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:499)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:248)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
    at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
    at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
    at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
    at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
    at org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$OverrideDispatch.dispatch(FacesContextFactoryImpl.java:267)
    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:473)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:141)
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:189)
    at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:710)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:273)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:205)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.share.http.ServletADFFilter.doFilter(ServletADFFilter.java:62)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

    Thanks

    DB:2.52:Exception On Rendering Breadcrums p7

    I feel really dumb now, the problem was on the page, the EL for the component was wrong.
    it was written just "breadCrumb.breadCrumbs", and it obviously should be "{#breadCrumb.breadCrumbs}".
    At least the exception makes sense now.

    thanks!

  • RELEVANCY SCORE 2.52

    DB:2.52:Naccess From A Pojo Datacontrol Method To A Bean Instance fd


    Hi I'm using this code to get my bean instance

    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getELContext();
    ExpressionFactory exprFactory =
    fctx.getApplication().getExpressionFactory();
    ValueExpression ve =
    exprFactory.createValueExpression(elctx, "#{backingBeanScope.ConsumeBean}",
    Object.class);
    ConsumeBean cb = (ConsumeBean)ve.getValue(elctx);
    cb.setName("Daniel");

    and then from ConsumeBean

    private String Name;

    public String cb1_action() {
    System.out.println("Name: " + getName());
    return null;
    }

    public void setName(String Name){
    this.Name = Name;
    }

    public String getName(){
    return Name;
    }

    and it prints null, it seem like i didn't capture the instance...

    I hope you can help me, thanks...

    Edited by: Daniel Almaguer on 23-abr-2012 16:38

  • RELEVANCY SCORE 2.52

    DB:2.52:How To Access Payload Object In Bean Method a3


    I'm trying to access payload object in bean method like following but it gives the null or "" value.

    ELContext elctx = fctx.getELContext();
    ExpressionFactory expFactory = fctx.getApplication().getExpressionFactory();
    ValueExpression ve = expFactory.createValueExpression(elctx, "${payLoad.group}", String.class);//here group is attribute of payLoad object

    this.myGroup=(String)ve.getValue(elctx);

    Thanks

    DB:2.52:How To Access Payload Object In Bean Method a3

    Hi Frank,
    Sorry bother you again but its important for me to know if the way we access payload( in last response i have shown code) in to the bean is acceptable or not. I mean is there any drawbacks doing this ? I would appriciate if you can reply me your view on it.....Thanks

  • RELEVANCY SCORE 2.50

    DB:2.50:Cannot Find Compare Routines Issue In Domain Data Type jx


    Hi,

    I'm using JDeveloper 11.1.1.3.0

    In ADF BC, I created a Custom Domain Data Type by using the wizard with oracle.jbo.domain.Number Data Type extended. If custom domain Data Type is attached against the attribute level in an Entity, then i created a default viewobject based on the entity.

    In UI, I Created ADF table and performed the sorting with default. It is working fine and it reterive each and every time from the DB.

    But my requirement is to sort within the cache. For that i attached sortListener and i performed the sorting within Viewobject by setting the QUERY_MODE_SCAN_VIEW_ROWS, QUERY_MODE_SCAN_ENTITY_ROWS and UERY_MODE_SCAN_UNPOSTED_ENTITY_ROWS. It is not woking.

    The sample code stack trace is following

    Domain Number Code for Compare:
    public class CalwinNumber extends Number implements Comparable
    {
    public int compareTo(Object o2)
    {
    Number srcNo = this;
    Number destNo = (Number) o2;
    return srcNo.compareTo(destNo);
    //return super.compareTo(o2);
    //return this.compareTo(o2);
    }
    }

    Managed Bean Code:

    public void tableSorting(SortEvent sortEvent)
    {
    String expression = "#{data.HRSysDataControl.dataProvider}";
    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp = elFactory.createValueExpression(elContext, expression, Object.class);
    ApplicationModule am = (ApplicationModule) valueExp.getValue(elContext);
    ViewObject vo = am.findViewObject("EmployeesView");
    String colName = "";
    boolean isAsc = sortEvent.getSortCriteria().get(0).isAscending();
    colName = sortEvent.getSortCriteria().get(0).getProperty();
    if (isAsc)
    {
    colName = colName + " asc";
    }
    else
    {
    colName = colName + " desc";
    }
    //vo.setDBSortCriteria(null);
    vo.setSortBy(colName);
    vo.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS | ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS | ViewObject.QUERY_MODE_SCAN_UNPOSTED_ENTITY_ROWS);
    vo.executeQuery();
    }

    Exception:
    RegistrationConfiguratorhandleError Server Exception during PPR, #1
    javax.el.ELException: oracle.jbo.JboException: Cannot find compare routines for org.calwin.model.dataTypes.common.CalwinNumber
    at com.sun.el.parser.AstValue.invoke(AstValue.java:161)
    at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1303)
    at org.apache.myfaces.trinidad.component.UIXTable.broadcast(UIXTable.java:261)
    at oracle.adf.view.rich.component.UIXTable.broadcast(UIXTable.java:140)
    at oracle.adf.view.rich.component.rich.data.RichTable.broadcast(RichTable.java:387)
    at org.apache.myfaces.trinidad.component.UIXCollection.broadcast(UIXCollection.java:148)
    at org.apache.myfaces.trinidad.component.UIXTable.broadcast(UIXTable.java:271)
    at oracle.adf.view.rich.component.UIXTable.broadcast(UIXTable.java:140)
    at oracle.adf.view.rich.component.rich.data.RichTable.broadcast(RichTable.java:387)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:812)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:292)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:414)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: oracle.jbo.JboException: Cannot find compare routines for org.calwin.model.dataTypes.common.CalwinNumber
    at oracle.jbo.RowComparator.compareValues(RowComparator.java:108)
    at oracle.jbo.RowComparator.compareRows(RowComparator.java:146)
    at oracle.jbo.RowComparator.compare(RowComparator.java:158)
    at java.util.Arrays.mergeSort(Arrays.java:1270)
    at java.util.Arrays.mergeSort(Arrays.java:1281)
    at java.util.Arrays.mergeSort(Arrays.java:1281)
    at java.util.Arrays.mergeSort(Arrays.java:1281)
    at java.util.Arrays.mergeSort(Arrays.java:1281)
    at java.util.Arrays.sort(Arrays.java:1210)
    at oracle.jbo.server.ViewObjectImpl.sortRows(ViewObjectImpl.java:6285)
    at oracle.jbo.server.QueryCollection.sortRows(QueryCollection.java:920)
    at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1174)
    at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:1338)
    at oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:1256)
    at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:1250)
    at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:6248)
    at org.calwin.view.bean.Table.tableSorting(Table.java:48)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
    ... 48 more

    How to achive the sorting? Can anyone help me regarding this???

    Thanks Regards,
    Perumal S

    DB:2.50:Cannot Find Compare Routines Issue In Domain Data Type jx

    Hi Perumal

    Can you tell me how you solved this issue. I am also facing the same issue.

  • RELEVANCY SCORE 2.50

    DB:2.50:Rf 3.2.0.Ga Panelmenu - Binding 7k



    I'm currently testing the new RF 3.2.0.GA - Release with my webapp, and i noticed, that my panelMenu is not displayed anymore!I'm creating my menu in a bean and bind it via the binding-attribute to the rich:panelMenu-Tag.Here is piece of code of the bean:

    public class NavigationMenu
    {
    GuiUtil myGuiUtil = null;
    HtmlPanelMenu panelMenu = null;

    public NavigationMenu()
    { // very important
    // with the GuiUtil-Object you get the messages in the national language
    myGuiUtil = new GuiUtil(FacesContext.getCurrentInstance().getViewRoot().getLocale());
    }

    public HtmlPanelMenu getPanelMenu()
    {
    if(panelMenu == null)
    {
    panelMenu = new HtmlPanelMenu();

    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application appl = facesContext.getApplication();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory exprFactory = appl.getExpressionFactory();

    HtmlPanelMenuGroup menuGroup_AccountInfo = new HtmlPanelMenuGroup();
    menuGroup_AccountInfo.setLabel(myGuiUtil.getMessageResource("menugroup_account"));
    menuGroup_AccountInfo.setName(myGuiUtil.getMessageResource("menugroup_account"));
    menuGroup_AccountInfo.setIconCollapsed("triangle");
    menuGroup_AccountInfo.setIconExpanded("triangleDown");

    HtmlPanelMenuItem menuItem_AccountInfo = new HtmlPanelMenuItem();
    menuItem_AccountInfo.setLabel(myGuiUtil.getMessageResource("menugroup_account_products"));
    menuItem_AccountInfo.setName(myGuiUtil.getMessageResource("menugroup_account_products"));
    menuItem_AccountInfo.setActionExpression(exprFactory.createMethodExpression(elContext, "navigate_accountinfo", null, new Class[0]));

    menuGroup_AccountInfo.getChildren().add(menuItem_AccountInfo);

    panelMenu.getChildren().add(menuGroup_AccountInfo);

    ..............
    }

    return panelMenu;
    }

    public void setPanelMenu(HtmlPanelMenu panelMenu)
    {
    this.panelMenu = panelMenu;
    }

    }

    DB:2.50:Rf 3.2.0.Ga Panelmenu - Binding 7k


    Hi,It is a bughttp://jira.jboss.com/jira/browse/RF-2918Thanks

  • RELEVANCY SCORE 2.49

    DB:2.49:Table Without Selectedrowkeys pk


    Scenario:I have a af:table which used to display search results:af:table value="#{bindings.myVO.collectionModel}" var="row" clientComponent="true" row="#{bindings.myVO.rangesize}" columnSelection="single" rowSelection="single" emptyText="#{bindings.myVO.viewable?'No data to display' : 'Access denied.'}"selectedRowKeys="#{bindings.myVO.collectionModel.selectedRow}" id="tab" selectionListener="#{myBean.listTable}" fetchSize="#{bindings.myVO.rangeSize}" af:column sortProperty="#{bindings.myVO.hints.Identifier.name}" sortable="true" rowHeader="unstyled" displayIndex="1" width="150" noWrap="false" id="c1" af:commandImageLink text="#{row.Identifier}" id="cil2" action="#{myBean.dispalyField}"/ /af:column/af:table myBean.java public void listTable(SelectionEvent se){ resolveMethodExpression("#{bindings.myVO.collectionModel.makeCurrent}", null, new Class[] { SelectionEvent.class }, new Object[] { selectionEvent });}private Object resolveMethodExpression(String expression, Class returnType, Class[] argTypes, Object[] argValues) { FacesContext facesContext = FacesContext.getCurrentInstance(); Application app = facesContext.getApplication(); ExpressionFactory elFactory = app.getExpressionFactory(); ELContext elContext = facesContext.getELContext(); MethodExpression methodExpression = elFactory.createMethodExpression(elContext, expression, returnType, argTypes); return methodExpression.invoke(elContext, argValues);}Onclicking of search button , search results will be displayed using myVO.In that if i click identifier (commandlink) in first row it takes me to another main page(navigation done using task flow).In my main page i have 4 buttons.Each button click will dynamically rendered a region with different data.Issues:I have 10 rows as search result.Im selecting 10th row and navigating to main page.Each row has a unique identifier with different data.If i kept my application idle for 10 mins minimum and 30 mins maximum in main page ,automatically 1st row record data is getting queried and shown in mainpage.I dont know how this is happening.This always fetching the first record value eventhough i set the selectionListener after 10 to mins idle of application.What will happen if i remove the selectedRowKeys?Kindly help.

    DB:2.49:Table Without Selectedrowkeys pk

    Hi,Always mention your JDev version.As far as I can understand your issue, it does not have anything to do with the selection listener, but with the session time out (your iterator gets re-set after the session time out). Also, I don't feel a requirement for you to have a separate selection listener as such. Have you tried keeping the default selection listener and see what happens?-Arun

  • RELEVANCY SCORE 2.49

    DB:2.49:Dca-40000: Internal Error When Calling A Web Service 7k


    Hello,
    I would like to call a web service in Oracle UCM with basic authentication (CheckInUniversal). In JDeveloper 11.1.1.2 I can specify username and password for the WS at design time and the JSPX runs fine.
    Now I have added some piece of code into a managed bean (CheckInBean) to use a specific username and password at runtime. When I run the page I get a DCA-40000 with the following error stack:

    UtilsbuildFacesMessage ADF: Adding the following JSF error message: The Web Service call failed due to an internal error.
    oracle.adf.model.adapter.AdapterException: DCA-40000: The Web Service call failed due to an internal error.
    at oracle.adfinternal.model.adapter.webservice.WSDataControl.invokeOperation(WSDataControl.java:270)
    at oracle.adf.model.bean.DCBeanDataControl.invokeMethod(DCBeanDataControl.java:430)
    at oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:257)
    at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1625)
    at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2141)
    at oracle.adf.model.bean.DCBeanDataControl.invokeOperation(DCBeanDataControl.java:467)
    at oracle.adf.model.adapter.AdapterDCService.invokeOperation(AdapterDCService.java:307)
    at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:730)
    at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:394)
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:252)
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:210)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
    at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
    at integration.view.CheckInBean.execute(CheckInBean.java:134)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
    at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
    at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1245)
    at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
    at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:90)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:309)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:94)
    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:90)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:309)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:94)
    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:812)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:292)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:159)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

    With debugger I found that it happens when the iterator CheckInUniversalResultIterator is called.
    HTTP Analyzer shows that there are only empty SOAP messages sent to UCM but the correct values are present in the the bean.

    Here is the code of the bean:
    package integration.view;

    import java.util.HashMap;
    import java.io.*;

    import java.util.Properties;

    import javax.el.ELContext;
    import javax.el.ExpressionFactory;

    import javax.el.MethodExpression;
    import javax.el.ValueExpression;

    import javax.faces.application.Application;
    import javax.faces.context.FacesContext;

    import javax.faces.event.ActionEvent;

    import oracle.adf.model.BindingContainer;
    import oracle.adf.model.BindingContext;

    import oracle.adf.model.binding.DCBindingContainer;
    import oracle.adf.model.binding.DCDataControl;

    import oracle.adfinternal.model.adapter.webservice.WSDataControl;
    import oracle.adfinternal.model.adapter.webservice.security.SecurityModel;

    // import oracle.binding.BindingContainer;

    import oracle.webservices.model.Port;

    public class CheckInBean extends SecurityModel {
    private String fileName;
    private String fileContent;
    private HashMap primaryFile;
    String mSavedCSFKey = null;

    public CheckInBean() {
    }

    public void setFileName(String fileName) {
    this.fileName = fileName; }

    public String getFileName() {
    return fileName;
    }

    public void setFileContent(String fileContent) {
    this.fileContent = fileContent;
    }

    public String getFileContent() {
    return fileContent;
    }

    public void setPrimaryFile(HashMap primaryFile) {
    this.primaryFile = primaryFile;
    }

    public HashMap getPrimaryFile() throws IOException {
    FacesContext facesCtx = FacesContext.getCurrentInstance();
    Application app = facesCtx.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesCtx.getELContext();

    // gets the value from the managed bean
    fileName = elFactory.createValueExpression(elContext, "#{pageFlowScope.ReportBean.reportName}", Object.class).getValue(elContext).toString();
    System.out.println(fileName);

    // puts the file name and the content into a hash map
    HashMap hashMap = new HashMap();
    hashMap.put("fileName",fileName);
    System.out.println(fileName);
    hashMap.put("fileContent",getFileInBytes(ReportBean.reportPath, fileName));
    return hashMap;
    }

    private static byte[] getFileInBytes(String reportOutputPath, String fileName) throws IOException {
    File file = new File(reportOutputPath,fileName);
    System.out.println(reportOutputPath + "+" + fileName);
    InputStream inputStream = new FileInputStream(file);

    // Get the size of the file
    long size = file.length();
    System.out.println("Size of the file: "+ size);

    // Check that size is not larger than Integer.MAX_VALUE
    if (size Integer.MAX_VALUE) {
    System.out.println("File too large !!");
    return null;
    }

    // Read the bytes into the byte array
    byte[] byteArray = new byte[(int)size];
    System.out.println("New Byte Array");

    int offset = 0;
    int byteRead = 0;

    while ((offset byteArray.length)

    ((byteRead=inputStream.read(byteArray, offset, byteArray.length-offset)) = 0)){
    byteRead = offset + byteRead;
    }
    System.out.println(byteRead);
    inputStream.close();
    return byteArray;
    }

    public void execute(ActionEvent aev) {
    FacesContext fctx = FacesContext.getCurrentInstance();
    Application app = fctx.getApplication();
    ExpressionFactory expF = app.getExpressionFactory();

    ValueExpression ve = expF.createValueExpression(fctx.getELContext(), "#{bindings}", DCBindingContainer.class);
    DCBindingContainer cont = (DCBindingContainer)ve.getValue(fctx.getELContext());
    DCDataControl dc = cont.findDataControl("CheckInECM");
    if(dc.getAdaptedDC() instanceof WSDataControl)
    {
    WSDataControl wsdc = (WSDataControl)dc.getAdaptedDC();
    wsdc.getProvider().setSecurityModel(this);
    }
    // execute the data control method, that was bound to this
    // button's action listener.
    MethodExpression me = expF.createMethodExpression(fctx.getELContext(),
    "${bindings.CheckInUniversal.execute}", Object.class,
    new Class[0]);
    me.invoke(fctx.getELContext(), null);
    }

    // public BindingContainer getBindings() {
    // return (BindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    // }

    // override security properties for any policy on the current port
    // before the method execution.
    public void initSecurity(Port thisPort) {
    super.initSecurity(thisPort);
    System.out.println(thisPort.hashCode());
    Properties callP = (Properties)this.getCallProperties(thisPort);
    callP.put("javax.xml.ws.security.auth.username", "sysadmin");
    callP.put("javax.xml.ws.security.auth.password", "welcome1");

    mSavedCSFKey = (String)callP.remove("csf-key");
    this.saveCallProperties(thisPort, callP);
    }

    // Restore the config at the end of the request.
    public void clearSecurityParameters(Port thisPort) {
    super.clearSecurityParameters(thisPort);
    Properties callP = (Properties)this.getCallProperties(thisPort);
    callP.remove("javax.xml.ws.security.auth.username");
    callP.remove("javax.xml.ws.security.auth.password");

    //put back the saved csf key as default...
    callP.put("csf-key", mSavedCSFKey);
    this.saveCallProperties(thisPort, callP);
    }
    }

    DB:2.49:Dca-40000: Internal Error When Calling A Web Service 7k

    Thanks for the hint conerning the tag.
    The bean has Page Flow Scope.

  • RELEVANCY SCORE 2.49

    DB:2.49:Problem With Af:Commandmenuitem Actionlistener cm


    Hi All,

    I am creating dynamic menus based on the role selected in the login page. I am generating a list of actions in my managed bean and displaying like below

    Code Snippet 1:
    af:menu id="menuTestActions"
    textAndAccessKey="testActions"
    detachable="true"
    af:forEach items="#{explorer.myBean.testActions}"
    var="nav"

    af:commandMenuItem textAndAccessKey="#{nav.label}"
    actionListener="#{nav.setAction}"
    selectedText="#{nav.id}"
    partialSubmit="false"/
    /af:forEach
    /af:menuI have a actionListener method in the mangedBean with setAction(ActionEvent aEvent) which renders some defined region and embeds the page accordingly into that region.

    Code Snippet 2:
    CoreInputText yyyy;

    public void setAction(ActionEvent aEvent) {
    outcome="xxxxx";
    UIComponent regionComponent = actionEvent.getComponent().findComponent(region);
    if (regionComponent instanceof RichRegion) {
    FacesContext fc = FacesContext.getCurrentInstance();
    ExpressionFactory ef = fc.getApplication().getExpressionFactory();
    ELContext elc = fc.getELContext();
    MethodExpression me = ef.createMethodExpression(elc,outcome, String.class, new Class[] { });
    System.out.println("me is --"+me.getMethodInfo(elc).getName());
    ((RichRegion)regionComponent).queueActionEventInRegion(me, null, null, false, -1, -1, PhaseId.ANY_PHASE);
    }

    yyyy=new CoreInputText();

    yyyy.setValue("2");

    }i have a coreInputText declared in the managed bean with name yyyy. and i want to set this value into the page embedded in the region.

    Everything works fine if i have a static commandMenuItem as below

    af:commandMenuItem textAndAccessKey="test"
    id="commandMenuId"
    actionListener="#{myBean.setAction}"
    /af:commandMenuItembut if i click on the menu which is generated dynamically as i shown in the code snippet the page is not embedded. The action gets called but with no result.

    Do i need to set any property for this.
    Am i missing something.

    Please any help would be much appreciated.

    Thanks,
    Morgan.

    Edited by: infoG on Jun 26, 2009 8:02 AM

    DB:2.49:Problem With Af:Commandmenuitem Actionlistener cm

    Hi All,

    I am creating dynamic menus based on the role selected in the login page. I am generating a list of actions in my managed bean and displaying like below

    Code Snippet 1:
    af:menu id="menuTestActions"
    textAndAccessKey="testActions"
    detachable="true"
    af:forEach items="#{explorer.myBean.testActions}"
    var="nav"

    af:commandMenuItem textAndAccessKey="#{nav.label}"
    actionListener="#{nav.setAction}"
    selectedText="#{nav.id}"
    partialSubmit="false"/
    /af:forEach
    /af:menuI have a actionListener method in the mangedBean with setAction(ActionEvent aEvent) which renders some defined region and embeds the page accordingly into that region.

    Code Snippet 2:
    CoreInputText yyyy;

    public void setAction(ActionEvent aEvent) {
    outcome="xxxxx";
    UIComponent regionComponent = actionEvent.getComponent().findComponent(region);
    if (regionComponent instanceof RichRegion) {
    FacesContext fc = FacesContext.getCurrentInstance();
    ExpressionFactory ef = fc.getApplication().getExpressionFactory();
    ELContext elc = fc.getELContext();
    MethodExpression me = ef.createMethodExpression(elc,outcome, String.class, new Class[] { });
    System.out.println("me is --"+me.getMethodInfo(elc).getName());
    ((RichRegion)regionComponent).queueActionEventInRegion(me, null, null, false, -1, -1, PhaseId.ANY_PHASE);
    }

    yyyy=new CoreInputText();

    yyyy.setValue("2");

    }i have a coreInputText declared in the managed bean with name yyyy. and i want to set this value into the page embedded in the region.

    Everything works fine if i have a static commandMenuItem as below

    af:commandMenuItem textAndAccessKey="test"
    id="commandMenuId"
    actionListener="#{myBean.setAction}"
    /af:commandMenuItembut if i click on the menu which is generated dynamically as i shown in the code snippet the page is not embedded. The action gets called but with no result.

    Do i need to set any property for this.
    Am i missing something.

    Please any help would be much appreciated.

    Thanks,
    Morgan.

    Edited by: infoG on Jun 26, 2009 8:02 AM

  • RELEVANCY SCORE 2.49

    DB:2.49:Cannot Dynamically Add Actionlistener To Tab Or Tabset 38


    Hello,

    I have a custom component that must create a Tabbed look. I'm using the Studio Creator TabSet with Tabs. I cannot for the life of me get it to register and use an actionListener. I've done this with other components, but this plain doesn't work (for me). Has anyone been able to use it this way? I've tried numerous approaches and here is the one that's worked for me in other components....

    FacesContext context = FacesContext.getCurrentInstance();
    Application application = context.getApplication();
    ELContext elContext = FacesContext.getCurrentInstance().getELContext();
    ExpressionFactory expressionFactory = application.getExpressionFactory();
    MethodExpression myActionListener = expressionFactory.createMethodExpression(elContext, "#{SCTabsBean.tabClicked}", null, new Class[] {ActionEvent.class});

    And oh yes, I have used the example code for the Woodstock version and also the old fashioned SC version and neither of them worked in my local environment.

    It is not an option for me to use WoodStock at this time. The woodstock components have a new way of registering the themes and it is too risky for an interim build to do this.

    ..\wb

    DB:2.49:Cannot Dynamically Add Actionlistener To Tab Or Tabset 38

    Hello,

    I have a custom component that must create a Tabbed look. I'm using the Studio Creator TabSet with Tabs. I cannot for the life of me get it to register and use an actionListener. I've done this with other components, but this plain doesn't work (for me). Has anyone been able to use it this way? I've tried numerous approaches and here is the one that's worked for me in other components....

    FacesContext context = FacesContext.getCurrentInstance();
    Application application = context.getApplication();
    ELContext elContext = FacesContext.getCurrentInstance().getELContext();
    ExpressionFactory expressionFactory = application.getExpressionFactory();
    MethodExpression myActionListener = expressionFactory.createMethodExpression(elContext, "#{SCTabsBean.tabClicked}", null, new Class[] {ActionEvent.class});

    And oh yes, I have used the example code for the Woodstock version and also the old fashioned SC version and neither of them worked in my local environment.

    It is not an option for me to use WoodStock at this time. The woodstock components have a new way of registering the themes and it is too risky for an interim build to do this.

    ..\wb

  • RELEVANCY SCORE 2.48

    DB:2.48:Determine Number Of Beans Living In Container sz



    In connection with performance testing the number of beans living within the container is quite interessing. Can someone imagine a way to determine the amount of beans?

    DB:2.48:Determine Number Of Beans Living In Container sz


    Lumin,Have you looked into JBoss Instance pooling, you might wanna look into it.AbstractInstancePool.java (Function: retrieveStatistic() ) gives details like:- InstantiationCountStatistics- DestroyCountStatistics- ReadyBeanCountStatisticsI hope this helps,Atul

  • RELEVANCY SCORE 2.48

    DB:2.48:To Call Stored Procedure Inside Servlet.Java Class ap


    Hi,

    I am using JDEV 11GR2.

    My requirement is i need to call store procedure in my servlet java class.

    I am able to call store procedure in my backing bean class: this is done mi the following manner.

    1. created method in AppModuleImpl class and expose same method in client interface.
    2. Added method in the test.jspx page pagedef.xml and execute the same in backing bean test.java in the following manner:

    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp =
    elFactory.createValueExpression(elContext, "#{bindings}", Object.class);
    BindingContainer binding= (BindingContainer)valueExp.getValue(elContext);
    OperationBinding operationBinding=binding.getOperationBinding("procedure_name");
    // Set the Input parameters to the operation bindings as below
    operationBinding.getParamsMap().put("OrgName", "org");
    //operationBinding.getParamsMap().put("SiteIdentifier", "M");
    // Invoke the Application module method
    operationBinding.execute();

    the above approach is working fine.

    Now my question is how can I call the method written inside AppModuleImpl, in servlet.java(Servlet will not be having any jspx page and this will be executed before the link is launched in the browser).

    please suggest me if there are any alternatives as well.

    Thanks,
    Veeresh

    DB:2.48:To Call Stored Procedure Inside Servlet.Java Class ap

    Hi Timo,

    thanks for your response.

    Here is the code which throws that exception.

    BindingContext bindingContext=null;
    bindingContext = BindingContext.getCurrent();
    at this line DCBindingContainer dcBindingContainer =
    bindingContext.findBindingContainer("com_mmi_enc_ServletPageDef");

    thanks,
    Veeresh

  • RELEVANCY SCORE 2.48

    DB:2.48:Urgent Regarding Export To Excel xf


    hey i am exporting a tree table using:-

    http://adfreusablecode.blogspot.in/2012/07/export-to-excel-with-styles.html
    but the problem i am facing is that .. when it is downloaded, it's getting downloaded in a white sheet not an excel sheet, and 2nd the download is from 2nd column of the table not from the 1st, the 1st is missing plz help:- attaching the backend code:--

    public void exportToExcel(FacesContext facesContext, OutputStream os)
    throws IOException, NoSuchMethodException, IllegalAccessException, InvocationTargetException
    {
    // get exporter attributes from viewScope (these values will define the behavior of exporter)
    MapString, Object vs = ADFContext.getCurrent().getViewScope();
    String exportedId = (String)vs.get("tt1.exportedId");
    String thStyle = (String)vs.get("tt1.thStyle");
    String tdStyle = (String)vs.get("tt1.tdStyle");

    String footerStyle = (String)vs.get("tt1.footerStyle");
    boolean showHiddenCols = "true".equals(vs.get("tt1.showHiddenColumns"));
    boolean forceColWidth = "true".equals(vs.get("tt1.forceColumnWidth"));
    boolean hideFooter = "true".equals(vs.get("tt1.hideFooter"));
    boolean hasFooter = false;
    int maxRowSpan = 1;

    // get the table from absoulte path
    UIViewRoot vr = facesContext.getViewRoot();
    RichTreeTable table = (RichTreeTable)vr.findComponent("tt1");
    // store visible columns in a sorted set (using the property displayIndex)

    TreeSetRichColumn cols = new TreeSetRichColumn(new RichColumnComparator());

    System.out.println("tree"+cols);
    for (UIComponent c : table.getChildren())
    {
    if (c instanceof RichColumn)
    {
    RichColumn col = (RichColumn)c;
    boolean forceRenderedCol = "true".equals(col.getAttributes().get("tt1.forceRendered"));
    boolean renderedCol = !"false".equals(col.getAttributes().get("tt1.rendered"));
    if (forceRenderedCol || (renderedCol (showHiddenCols || (col.isRendered() col.isVisible()))))

    {
    cols.add(col);
    if (col.getFooter() != null)
    hasFooter = true;
    maxRowSpan = Math.max(maxRowSpan, getRowSpan(col)); }
    }
    }
    OutputStreamWriter w = new OutputStreamWriter(os);

    w.append("table");
    //heADER
    for (int i = 1; i = maxRowSpan; i++)
    {
    w.append("tr bgcolor= \"#808080\"");

    for (RichColumn col : cols)
    renderHeader(facesContext, w, col, thStyle, forceColWidth, maxRowSpan, i, 1);

    w.append("/tr");
    }

    ELContext elContext = facesContext.getELContext();
    ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
    if (StringUtils.isNotBlank(table.getVarStatus())) {
    String el = String.format("#{%s}", table.getVarStatus());
    ValueExpression exp = expressionFactory.createValueExpression(elContext, el, Object.class);
    Method m = UIXIterator.class.getDeclaredMethod("createVarStatusMap", new Class[0]);
    m.setAccessible(true);
    Object varStatus = m.invoke(table, new Object[0]);
    exp.setValue(elContext, varStatus);
    }
    CollectionModel model = (CollectionModel)table.getValue();
    int rowcount = model.getRowCount();
    for (int i = 0; i rowcount; i++) {
    model.setRowIndex(i);
    JUCtrlHierNodeBinding r = (JUCtrlHierNodeBinding)model.getRowData();
    if (StringUtils.isNotBlank(table.getVar()))
    { String el = String.format("#{%s}", table.getVar());
    ValueExpression exp = expressionFactory.createValueExpression(elContext, el, Object.class);
    exp.setValue(elContext, r);
    }

    w.append("tr");
    for (RichColumn col : cols)
    renderRows(facesContext, w, col, tdStyle, forceColWidth);
    w.append("/tr");
    }
    if (!hideFooter hasFooter)
    {
    w.append("tr");
    for (RichColumn col : cols)
    renderFooter(facesContext, w, col, footerStyle, forceColWidth);
    w.append("/tr");
    }
    w.append("\tSearch Page");
    w.append("/table");
    w.close();
    }

    private void renderUIComponent(FacesContext facesContext, OutputStreamWriter w, UIComponent c)
    throws IOException
    {
    if ("true".equals(c.getAttributes().get("tt1.hidden")))
    return;
    for (UIComponent ch : c.getChildren())
    renderUIComponent(facesContext, w, ch);
    String translatorAttr = (String)c.getAttributes().get("tt1.translator");
    String[] translatorItems = StringUtils.isEmpty(translatorAttr) ? new String[0] : translatorAttr.split(";;");

    MapString, String translator = new HashMapString, String(translatorItems.length);
    for (String item : translatorItems)
    {
    String[] kv = item.split("::");
    if (kv.length == 0)
    continue;
    if (kv.length != 2)
    throw new FacesException("kv.length != 2");
    translator.put(kv[0], kv[1]);
    }
    StringBuilder style = new StringBuilder();
    ValueExpression contentStyleVE = c.getValueExpression("contentStyle");
    if (contentStyleVE != null)
    style.append(StringUtils.defaultString((String)contentStyleVE.getValue(facesContext.getELContext())));
    else
    if (SafeReflection.hasMethod(c, "getContentStyle", null))
    style.append(StringUtils.defaultString((String)SafeReflection.invoke(c, "getContentStyle", null, null)));
    ValueExpression inlineStyleVE = c.getValueExpression("inlineStyle");
    if (inlineStyleVE != null)
    style.append(StringUtils.defaultString((String)inlineStyleVE.getValue(facesContext.getELContext())));
    else
    if (SafeReflection.hasMethod(c, "getInlineStyle", null))
    style.append(StringUtils.defaultString((String)SafeReflection.invoke(c, "getInlineStyle", null, null)));
    if (style.length() 0)
    w.append(String.format("span style='%s'", style.toString()));
    if (c instanceof UIXSwitcher) {
    UIXSwitcher swt = (UIXSwitcher)c;
    renderUIComponent(facesContext, w, swt.getFacet(swt.getFacetName())); }
    else if (c instanceof RichSelectOneChoice)
    { RichSelectOneChoice soc = (RichSelectOneChoice)c;
    Integer index = (Integer)soc.getValue();
    ListSelectItem items = new ArrayListSelectItem();
    for (UIComponent ch : soc.getChildren())
    if (ch instanceof UISelectItems)
    items.addAll((ListSelectItem)((UISelectItems)ch).getValue());
    if (items.size() 0)
    { String val = items.get(index).getLabel();
    w.append(StringEscapeUtils.escapeHtml(translator.containsKey(index) ? translator.get(val) : val));
    }
    }
    else
    if (c instanceof UIXValue)
    { UIXValue uix = (UIXValue)c;
    Object value = uix.getValue();
    String val = value != null ? value.toString() : null;
    if (uix.getConverter() != null)
    val = uix.getConverter().getAsString(facesContext, c, value);
    if (val != null)
    w.append(StringEscapeUtils.escapeHtml(translator.containsKey(val) ? translator.get(val) : val));
    }
    else
    if (c instanceof RichCommandLink)
    { RichCommandLink commandLink = (RichCommandLink)c;
    if (commandLink.getText() != null)
    w.append(StringEscapeUtils.escapeHtml(translator.containsKey(commandLink.getText()) ? translator.get(commandLink.getText()) : commandLink.getText()));
    }
    else if (c instanceof RichGoLink)
    {
    RichGoLink goLink = (RichGoLink)c;
    if (goLink.getText() != null)
    w.append(String.format("%s", goLink.getDestination(), StringEscapeUtils.escapeHtml(translator.containsKey(goLink.getText()) ? translator.get(goLink.getText()) : goLink.getText())));
    }
    else
    if (c instanceof RichSpacer)
    w.append("");
    if (style.length() 0)
    w.append("/span");
    }

    private void renderHeader(FacesContext facesContext, OutputStreamWriter w, RichColumn col, String thStyle, boolean forceColWidth, int maxRowSpan, int level, int currentLevel)
    throws IOException
    {
    if (currentLevel level)
    {
    for (UIComponent c : col.getChildren())
    if (c instanceof RichColumn)
    renderHeader(facesContext, w, (RichColumn)c, thStyle, forceColWidth, maxRowSpan, level, currentLevel + 1);
    return;
    }
    ValueExpression alignVE = col.getValueExpression("align");
    String align = alignVE != null ? (String)alignVE.getValue(facesContext.getELContext()) : col.getAlign();
    ValueExpression widthVE = col.getValueExpression("width");
    String width = widthVE != null ? (String)widthVE.getValue(facesContext.getELContext()) : col.getWidth();
    w.append("th");
    int rowSpan = maxRowSpan - Math.abs(getRowSpan(col) - level);
    if (rowSpan 1)
    w.append(String.format(" rowspan='%s'", rowSpan));
    int colSpan = getColSpan(col);
    if (colSpan 1)
    w.append(String.format(" colspan='%s'", colSpan));
    if (StringUtils.isNotBlank(thStyle))
    w.append(String.format(" style='%s'", thStyle));
    w.append(String.format(" align='%s'", StringUtils.defaultString(align, "left")));
    if (forceColWidth StringUtils.isNotBlank(width))
    w.append(String.format(" width='%s'", width));
    if (col.isHeaderNoWrap())
    w.append(" nowrap");
    w.append("");
    // w.append(String.format("style='background-color:Bisque'", thStyle));
    w.append(StringUtils.defaultString(StringEscapeUtils.escapeHtml(col.getHeaderText())));
    w.append("/th");
    }

    private void renderRows(FacesContext facesContext, OutputStreamWriter w, RichColumn col, String tdStyle, boolean forceColWidth)
    throws IOException {
    boolean isColumnGroup = false;
    for (UIComponent c : col.getChildren()) {
    if (c instanceof RichColumn)
    { renderRows(facesContext, w, (RichColumn)c, tdStyle, forceColWidth);
    isColumnGroup = true;
    }
    }
    if (isColumnGroup)
    return;
    ValueExpression inlineStyleVE = col.getValueExpression("inlineStyle");
    String style = inlineStyleVE != null ? (String)inlineStyleVE.getValue(facesContext.getELContext()) : col.getInlineStyle();
    ValueExpression alignVE = col.getValueExpression("align");
    String align = alignVE != null ? (String)alignVE.getValue(facesContext.getELContext()) : col.getAlign();
    ValueExpression widthVE = col.getValueExpression("width");
    String width = widthVE != null ? (String)widthVE.getValue(facesContext.getELContext()) : col.getWidth();
    w.append("td");
    if (StringUtils.isNotBlank(tdStyle) || StringUtils.isNotBlank(style))
    w.append(String.format(" style='%s;%s'", StringUtils.defaultString(tdStyle), StringUtils.defaultString(style)));
    if (StringUtils.isNotBlank(align))

    w.append(String.format(" align='%s'", StringUtils.defaultString(align, "left")));
    if (forceColWidth StringUtils.isNotBlank(width))
    w.append(String.format(" width='%s'", width));
    if (col.isNoWrap())
    w.append(" nowrap");
    w.append("");
    for (UIComponent c : col.getChildren())
    renderUIComponent(facesContext, w, c);
    w.append("/td"); }

    private void renderFooter(FacesContext facesContext, OutputStreamWriter w, RichColumn col, String footerStyle, boolean forceColWidth)
    throws IOException {
    for (UIComponent c : col.getChildren())
    {
    if (c instanceof RichColumn)
    {
    renderFooter(facesContext, w, (RichColumn)c, footerStyle, forceColWidth);
    continue;
    }
    w.append("td");
    if (StringUtils.isNotBlank(footerStyle))
    w.append(String.format(" style='%s'", footerStyle));
    w.append(String.format(" align='%s'", StringUtils.defaultString(col.getAlign(), "left")));
    if (col.isHeaderNoWrap())
    w.append(" nowrap");
    w.append("");
    if (col.getFooter() != null)
    renderUIComponent(facesContext, w, col.getFooter());
    w.append("/td");
    }
    }
    private int getRowSpan(RichColumn col)
    { int rowSpan = 1;
    for (UIComponent c : col.getChildren())
    if (c instanceof RichColumn)
    rowSpan = Math.max(rowSpan, 1 + getRowSpan((RichColumn)c));
    return rowSpan;
    }
    private int getColSpan(RichColumn col)
    {
    int colSpan = 0;
    for (UIComponent c : col.getChildren())
    if (c instanceof RichColumn)
    colSpan += getColSpan((RichColumn)c);
    return Math.max(1, colSpan);
    }

    class RichColumnComparator implements Comparator
    {
    int direction;

    public RichColumnComparator()
    {
    direction = 1;
    }
    public RichColumnComparator(boolean asc)
    { direction = asc ? 1 : -1;
    }
    public int compare(Object o1, Object o2)
    {
    RichColumn c1 = (RichColumn)o1;
    RichColumn c2 = (RichColumn)o2;
    return direction * (c1.getDisplayIndex() c2.getDisplayIndex() ? -1 : 1);
    }
    @Override public boolean equals(Object obj)
    {
    return super.equals(obj);
    }
    }

    }

    DB:2.48:Urgent Regarding Export To Excel xf

    Please try to use Apache POI API, its very good in exporting data as excel sheets, i have some code and will come back to you.

    In the meantime, you can google it for the examples.

    Thanks,
    N.

  • RELEVANCY SCORE 2.48

    DB:2.48:Downloading File With Response 9x



    Hello to everybody,

    I tried to ported a Seam Web Project to JBP 2.7.2, then to GateIn 3.0.0. I solved lot of problems, but unfortunatelly some functionalities still broken, for example the file downloader part. The application works fine as native seam application, so I click on the download button, then a file choser window appears, after that I can save my file to the proper place, but in JBP or GateIn, when I try to download a file - a pdf or an xml - it just shows the file content in the web browser as output.

    I use a h:commandButton to firing the action and in this case the GateIn gives back an ActionResponseImpl - org.gatein.pc.portlet.impl.jsr168.api.ActionResponseImpl or org.jboss.portal.portlet.impl.jsr168.api.ActionResponseImpl, it depends from GateIn or JBP. I tried with a4j:commandButton also and in that case the GateIn gives back a BufferedResourceResponseWrapper, JBP gives a BufferedRenderResponseWrapper.

    I give up the a4j case, when I read somewhere there is no way to save file with response via ajax because of the portlet specification.

    Here is a sample function:

    public void downloadFile() throws IOException {

    String filePath = null; String fileName = null; int read = 0; byte[] bytes = new byte[DEFAULT_BUFFER_SIZE];

    Object responseObject = FacesContext.getCurrentInstance().getExternalContext().getResponse(); // native seam if (responseObject instanceof HttpServletResponse) { FacesContext facesContext = FacesContext.getCurrentInstance(); ExternalContext externalContext = facesContext.getExternalContext(); HttpServletResponse response = (HttpServletResponse) externalContext.getResponse(); ELContext el = facesContext.getELContext(); Application app = facesContext.getApplication(); ExpressionFactory ef = app.getExpressionFactory(); ValueExpression pathVe = ef.createValueExpression(el, "#{knowledgebasefile.knowledgeBaseFilePath}", String.class); filePath = (String) pathVe.getValue(el); int extDot = filePath.lastIndexOf(File.separator); fileName = filePath.substring(extDot + 1); ValueExpression mimeVe = ef.createValueExpression(el, "#{knowledgebasefile.mimeType}", String.class); response.setContentType(mimeVe.getValue(el).toString()); response.addHeader("Content-disposition", "attachment; filename=\"" + fileName + "\""); try { ServletOutputStream os = response.getOutputStream(); File file = new File(filePath); FileInputStream fis = new FileInputStream(file);

    while ((read = fis.read(bytes)) != -1) { os.write(bytes, 0, read); }

    os.flush(); os.close(); } catch (Exception e) { System.err.println(e); }

    facesContext.responseComplete(); // in GateIn } else if (responseObject instanceof ActionResponseImpl) { log.info("response is ActionResponseImpl"); FacesContext facesContext = FacesContext.getCurrentInstance(); ExternalContext externalContext = facesContext.getExternalContext(); ActionResponseImpl portalResponse = (ActionResponseImpl) externalContext.getResponse(); HttpServletResponseWrapper response = portalResponse.getRealResponse(); ELContext el = facesContext.getELContext(); Application app = facesContext.getApplication(); ExpressionFactory ef = app.getExpressionFactory(); ValueExpression pathVe = ef.createValueExpression(el, "#{knowledgebasefile.knowledgeBaseFilePath}", String.class); filePath = (String) pathVe.getValue(el); int extDot = filePath.lastIndexOf(File.separator); fileName = filePath.substring(extDot + 1); ValueExpression mimeVe = ef.createValueExpression(el, "#{knowledgebasefile.mimeType}", String.class); response.setContentType(mimeVe.getValue(el).toString()); response.addHeader("Content-disposition", "attachment; filename=\"" + fileName + "\""); try { ServletOutputStream os = response.getOutputStream(); File file = new File(filePath); FileInputStream fis = new FileInputStream(file);

    while ((read = fis.read(bytes)) != -1) { os.write(bytes, 0, read); }

    os.flush(); os.close(); } catch (Exception e) { System.err.println(e); } } else { log.info("fail to download - unexpected response type"); log.info("response instance of: " + responseObject.getClass().getName()); } }

    Here it is the a4j try:

    BufferedResourceResponseWrapper portalResponse = (BufferedResourceResponseWrapper) responseObject;RenderResponseImpl responseRRI = (RenderResponseImpl) portalResponse.getResponse();HttpServletResponseWrapper response = responseRRI.getRealResponse();

    I used the following versions:

    GateIn 3.0.0.GA

    Seam 2.2.0.GA

    Portlet Bridge 2.0.0.CR1

    RichFaces 3.3.3.CR1

    Thanks for your help and sorry for my English.

    Regards,

    Imre

    DB:2.48:Downloading File With Response 9x


    Is there any documentation about the DownloadHandler?

  • RELEVANCY SCORE 2.48

    DB:2.48:Htmlajaxsupport + Illegalargumentexception Wrong Number Of Arguments k7



    Hi.

    I have some problems with HtmlAjaxSupport.

    Here is my jsf page:

    h:panelGrid columns="2" columnClasses="pnlGrdClassMsg, pnlGrdClassLong" h:panelGrid id="msgPanelGridId" binding="#{profileBean.msgPanelGrid}" / a4j:commandLink reRender="msgPanelGridId" ajaxSingle="true" action="#{profileBean.newMessenger}" h:outputText value="Add new messenger" / /a4j:commandLink /h:panelGrid

    Part of my code for dynamic messenger creation:

    // create input HtmlInputText input = new HtmlInputText(); String imsUserInputId = imsUserInput_Id + imsNumber; input.setId(imsUserInputId); input.setSize(20); input.setMaxlength(40); input.setValue(new String(ims.getUsername())); MethodExpression inputActionExpression = expressionFactory .createMethodExpression(elContext, "#{profileBean.msgInputValueChange}", null, new Class[] { ValueChangeEvent.class }); MethodExpressionValueChangeListener inputListener = new MethodExpressionValueChangeListener( inputActionExpression); input.addValueChangeListener(inputListener); HtmlAjaxSupport as = new HtmlAjaxSupport(); as.setEvent("onchange"); as.setId(imsAjaxUserInput_Id + imsNumber); as.setActionExpression(inputActionExpression); as.setReRender(pnlGrid.getId()); input.getChildren().add(as); pnlGrid.getChildren().add(input);

    When I click on newMessenger command link I get this exception:

    exception

    javax.servlet.ServletException: wrong number of argumentsjavax.faces.webapp.FacesServlet.service(FacesServlet.java:323)org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)

    root cause

    java.lang.IllegalArgumentException: wrong number of argumentssun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)java.lang.reflect.Method.invoke(Method.java:597)com.sun.el.parser.AstValue.invoke(AstValue.java:234)com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)javax.faces.component.UICommand.broadcast(UICommand.java:315)org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:55)org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:329)org.ajax4jsf.component.AjaxViewRoot.broadcastEventsForPhase(AjaxViewRoot.java:304)org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:261)org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:474)com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)javax.faces.webapp.FacesServlet.service(FacesServlet.java:310)org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)

    DB:2.48:Htmlajaxsupport + Illegalargumentexception Wrong Number Of Arguments k7


    Hi.

    Actually the problem was in:

    MethodExpression inputActionExpression = expressionFactory
    .createMethodExpression(elContext,
    "#{profileBean.msgInputValueChange}", null,
    new Class[] { ValueChangeEvent.class });

    .....

    as.setActionExpression(inputActionExpression);

  • RELEVANCY SCORE 2.48

    DB:2.48:Custom Component j7


    Hi
    I am trying to learn how to build custom components and running into problem while accessing the attribute hellomsg as defined in this file HtmlHelloWorld1.java which extends the UIComponentBase. The attribute hellomsg is always null. Here are my files
    ---------------------------------Base class extension------------------------------------------------
    package com.custComponent;

    import java.io.IOException;
    import javax.el.ValueExpression;
    import javax.faces.component.UIComponentBase;
    import javax.faces.context.FacesContext;
    import javax.faces.context.ResponseWriter;

    public class HtmlHelloWorld1 extends UIComponentBase {

    /** general catogory of which this component is a member e.g. UIInput comp/javax.faces.Input family **/
    public String getFamily() {
    return null;
    }

    /** Embedded renderer in this case: renders itself to client **/
    public void encodeBegin(FacesContext context) throws IOException {
    ResponseWriter writer = context.getResponseWriter();
    String hellomsg = (String) getAttributes().get("hellomsg");
    writer = context.getResponseWriter();
    writer.startElement("div", null);
    writer.writeAttribute("style", "color : red", null );
    writer.writeText(hellomsg + " HelloWorld! today is: ",null);
    writer.endElement("div");
    }
    }
    -----------------------------------------
    Here is my tag file
    -----------------------------------------java tag file-----------------------------
    package com.tag;

    import javax.el.ELContext;
    import javax.el.ExpressionFactory;
    import javax.el.ValueExpression;
    import javax.faces.application.Application;
    import javax.faces.component.UIComponent;
    import javax.faces.context.FacesContext;
    import javax.faces.webapp.UIComponentELTag;

    public class HelloWorldTag1 extends UIComponentELTag {
    private String hellomsg=null;
    public String getComponentType() {
    // Associates tag with UI component registered in faces-config.xml
    return "HtmlHelloWorld1";
    }
    public String getRendererType() {
    // Since the renderer is embedded in the component, can return null.
    return null;
    }
    public int getIndexOfNextChildTag() {
    return 0;
    }

    protected void setProperties(UIComponent component) {
    // This call to super.setProperties() is VITALLY IMPORTANT!
    // omitting it will cause the component to break entirely!
    super.setProperties(component);

    FacesContext context = FacesContext.getCurrentInstance();
    ELContext elContext = context.getELContext();
    Application app = context.getApplication();
    try {
    ExpressionFactory ef = app.getExpressionFactory();
    ValueExpression vb = ef.createValueExpression(elContext, getHellomsg(), String.class);
    component.setValueExpression(getHellomsg(), vb);
    } catch (Exception ex) {
    }
    }
    public String getHellomsg(){
    return hellomsg;
    }
    public void setHellomsg(String hellomsg) {
    this.hellomsg = hellomsg;
    }
    }
    -------------------------------------------------

    -------------------------------------taglib descriptor file---------------------------
    ?xml version="1.0" encoding="UTF-8"?
    taglib version="2.0" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd"
    tlib-version1.0/tlib-version
    short-namehtmlhelloworld1/short-name
    uri/WEB-INF/tlds/HtmlHellWorld1/uri
    tag
    descriptionHello World1 Tag/description
    namehelloworld1/name
    tag-class
    com.tag.HelloWorldTag1
    /tag-class
    body-contentempty/body-content
    variable
    name-from-attributehellomsg/name-from-attribute
    /variable
    attribute
    descriptiona custom hello message/description
    namehellomsg/name
    requiredtrue/required
    deferred-value
    typejava.lang.String/type
    /deferred-value
    /attribute
    /tag
    /taglib
    ------------------------------------------------

    ------------------------------part of index.jsp file creates faces context----------
    html
    head
    meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
    titleJSP Page/title
    /head
    body

    h1JSP Page/h1

    JavaServer Faces Welcome Page
    jsp:forward page="/faces/HelloWorld1.jsp" /

    /body
    /html
    --------------------------------------------------

    -----------------------HelloWorld1.jsp file where I am using the component--------------

    %@ page contentType="text/html"%
    %@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%
    %@ taglib uri="/WEB-INF/tlds/HtmlHellWorld1.tld" prefix="jcr"%
    html
    head
    meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
    titleJSP Page/title
    /head
    body
    h1JSP Page/h1
    f:view
    html
    head
    titlehello/title
    /head
    body
    h2Custom Helloworld component/h2
    pjcr:helloworld1 hellomsg="Hello JSF!"//p
    /body
    /html
    /f:view
    /body
    /html
    -----------------------------------------------
    -----------------------------------------------faces-config file---------------------
    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"
    component
    component-typeHtmlHelloWorld1/component-type
    component-class
    com.custComponent.HtmlHelloWorld1
    /component-class
    /component
    /faces-config
    ---------------------------------------------
    ---------------------------------finally web.xml file ----------------------------------
    ?xml version="1.0" encoding="UTF-8"?
    web-app version="2.5" 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-app_2_5.xsd"
    context-param
    param-namecom.sun.faces.verifyObjects/param-name
    param-valuefalse/param-value
    /context-param
    context-param
    param-namecom.sun.faces.validateXml/param-name
    param-valuetrue/param-value
    /context-param
    context-param
    param-namejavax.faces.STATE_SAVING_METHOD/param-name
    param-valueclient/param-value
    /context-param
    servlet
    servlet-nameFaces Servlet/servlet-name
    servlet-classjavax.faces.webapp.FacesServlet/servlet-class
    load-on-startup1/load-on-startup
    /servlet
    servlet-mapping
    servlet-nameFaces Servlet/servlet-name
    url-pattern/faces/*/url-pattern
    /servlet-mapping
    session-config
    session-timeout
    30
    /session-timeout
    /session-config
    welcome-file-list
    welcome-file
    index.jsp
    /welcome-file
    /welcome-file-list
    /web-app
    ------------------------------------------------------

    DB:2.48:Custom Component j7

    Thanks for the reply.

    I can not use UIComponentTag or isValueReference because they are deprecated in netbean 5.5 which I am using. I need to use UIComponentELtag or UIComponentTagBase. Also setValueBinding is deprecated and is replaced by setValueExpression. Any other ideas. Thanks again.

  • RELEVANCY SCORE 2.48

    DB:2.48:Session Bean With Am Access Causing Jboexception zj


    Hi.

    I have session bean with some attributes and some session based logic in it. One part of that logic uses access to DB through AM/Bindings like:
    public class MySessionBean {
    ...
    public MySessionBean() {
    ...
    ApplicationModule am = ADFUtils.getApplicationModuleForDataControl("BaseAppModuleDataControl");
    ...
    }
    ...
    }And static method ADFUtils.getApplicationModuleForDataControl looks like:
    public static ApplicationModule getApplicationModuleForDataControl(String name) {
    return (ApplicationModule)JSFUtils.resolveExpression("#{data." + name + ".dataProvider}");
    }And JSFUtils.resolveExpression static method looks like:
    public static Object resolveExpression(String expression) {
    FacesContext facesContext = getFacesContext();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp = elFactory.createValueExpression(elContext, expression, Object.class);
    return valueExp.getValue(elContext);
    }Now if for example Database is down... and I run on page that uses that session bean's attributes I'm getting error like:
    Root cause of ServletException.
    oracle.adf.controller.ControllerException: ADFC-10001: cannot instantiate class 'my.package.MySessionBean'Next in trace is:
    Caused By: oracle.jbo.DMLException: JBO-29114 ADFContext is not setup to process messages for this exception. Use the exception stack trace and error code to investigate the root cause of this exception. Root cause error code is JBO-27200And next:
    Caused By: javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundException: While trying to lookup 'jdbc.myDS' didn't find subcontext 'jdbc'. Resolved ''; remaining name 'jdbc/myDS']; Link Remaining Name: 'jdbc/myDS'Obviously Root exception is ADFC-10001 (it is Controller like) and is just a consequence of JBO-29114/JBO-27200. I have seen in FOD (Fusion Order Demo) there is FODCustomErrorHandler which handles exceptions. I have tried to create similar class and tries to handle JBO-XXXXX and this class does not handle this error (I assume that this is because root exception is ADFC-XXXXX? Or maybe it is because is session instantation). So my question is how to proper handle that kind of exception/error? I have also tried like Frank [http://blogs.oracle.com/jdevotnharvest/entry/extending_the_adf_controller_exception_handler] said. Exception is caught inside handleException method but I can not do anything user friendly here (because it is in RENDER_RESPONSE phase).

    Any ideas?

    Regards
    Zmeda

    DB:2.48:Session Bean With Am Access Causing Jboexception zj

    DataSource is correct.

    I intentionally stop database to simulate problem. I want to handle exception if database is down.

  • RELEVANCY SCORE 2.48

    DB:2.48:Beans da


    Beans use to communicate with other Beans

    DB:2.48:Beans da

    Beans use to communicate with other BeansTo communicate with other beans, you should prefer mexican jumping beans. They are always full of beans. :)

  • RELEVANCY SCORE 2.48

    DB:2.48:Possible Bug In Createvalueexpression? d3


    Hi,

    I have a litte code expample, which worked perfect with JSF 1.1. In JSF 1.2 it seems to have some problems.

    When I prepare a managed bean in an action method before rendering the page itself, I use the following statement:
    code
    FacesContext context = FacesContext.getCurrentInstance();
    ELContext elContext = context.getELContext();
    ValueExpression ve = context.getApplication().
    getExpressionFactory().
    createValueExpression(elContext,"#{MyBean}", MyBean.class);
    ve.setValue( elContext, new MyBean() );
    /code

    With this code MyBean is created within the request scope, even if I have declared it in session scope within faces-config.

    The funny thing is, that when I load the value with ve.getValue() first, the new managed bean is stored in the session scope.

    Is this a bug?

    Greeting.

    DB:2.48:Possible Bug In Createvalueexpression? d3

    Hi,

    I have a litte code expample, which worked perfect with JSF 1.1. In JSF 1.2 it seems to have some problems.

    When I prepare a managed bean in an action method before rendering the page itself, I use the following statement:
    code
    FacesContext context = FacesContext.getCurrentInstance();
    ELContext elContext = context.getELContext();
    ValueExpression ve = context.getApplication().
    getExpressionFactory().
    createValueExpression(elContext,"#{MyBean}", MyBean.class);
    ve.setValue( elContext, new MyBean() );
    /code

    With this code MyBean is created within the request scope, even if I have declared it in session scope within faces-config.

    The funny thing is, that when I load the value with ve.getValue() first, the new managed bean is stored in the session scope.

    Is this a bug?

    Greeting.

  • RELEVANCY SCORE 2.46

    DB:2.46:Java.Lang.Noclassdeffounderror: Javax/El/Expressionfactory pd


    hello,

    I'm new to JSF and when i tried to run application with jboss server , i'm getting exception as
    java.lang.NoClassDefFoundError: javax/el/ExpressionFactory
    at serverside.

    So wht i need to do.
    suggest me how to run the Applpication in JSF

    Roshu

    DB:2.46:Java.Lang.Noclassdeffounderror: Javax/El/Expressionfactory pd

    I have the same problem.

    I'm using jsf1.2_03_rc on a tomcat 6.0.2.

    I have the 2 JSF jars in my WEB-INF/lib folder as well as the javaee.jar from Java EE 5. Since JSP 2.1 is part of Java EE 5 I thought that would be sufficient. Or is the jsp/el stuff in some other jar inside the EE?
    Does tomcat use the el stuff from java ee or does it use it's own implementations?

    I have the following jars in my WEB-INF/lib folder:
    commons-beanutils.jar
    commons-collections.jar
    commons-digester.jar
    commons-logging.jar
    jsf-api.jar
    jsf-impl.jar

    These are added (by tomcat?) during deploy:
    standard.jar
    jstl.jar

    I did not add any additional libs to the tomcat/lib folder.
    Am I missing any libraries?

    Thanks,
    Robert

  • RELEVANCY SCORE 2.45

    DB:2.45:Methodnotfoundexception Processquery mp


    Using JDev 11.1.1.6I have a basic query panel with 2 searchable fields.I want to set it up so that the query is run as soon as the user types something in either text box and presses "Enter".I know I need to set up an onKeyPress method.My problem is when I attempt to invoke the processQuery method.I have a helper method in a backing bean:codepublic Object invokeMethodExpression(String expr, Class returnType, Class[] argTypes, Object[] args) { FacesContext fc = FacesContext.getCurrentInstance(); ELContext elctx = fc.getELContext(); ExpressionFactory elFactory = fc.getApplication().getExpressionFactory(); MethodExpression methodExpr = elFactory.createMethodExpression(elctx, expr, returnType, argTypes); return methodExpr.invoke(elctx, args); }/codeI have the queryListener of the af:Query pointing to the backing beancodepublic void onProcessQuery(QueryEvent queryEvent) { String expr = "#{bindings.myViewObjectViewCriteriaQuery.processQuery}"; invokeMethodExpression(expr, null, new Class[]{}, null);}/codeI am getting an error that says "Method not found: myViewObjectViewCriteriaQuery.processQuery()"Why is my method not being found?Thanks,Ray

    DB:2.45:Methodnotfoundexception Processquery mp

    That was an exercise in futility.I figured out what was wrong with my code, just to find out that the default behavior of the query panel was as expected. Nothing needs to be done to allow the query to execute when the user presses the enter key.FYI The problem with the code was the passing of incorrect Classes.Instead of "invokeMethodExpression(expr, null, new Class[]{}, null);"I needed "invokeMethodExpression(expr, Object.class, new Class[]{QueryEvent.class}, new Object[]{queryEvent});"

  • RELEVANCY SCORE 2.44

    DB:2.44:Declarative Component Attributes jf


    Hi all,

    I'm using Jdev 11g(build 5188), ADF RF and ADF BC.

    I'm implementing a declarative component. The component is a popup which contains some inputTexts, depending on database configuration. I've defined a managed-bean with request scope. In my declarative component inside the popup I've this code:

    af:panelFormLayout binding="#{popupBean.popupUI}"

    My problem is that I'm not able to read declarative component attributes inside the method getPopupUI of the popupBean. I'm trying to do that as follows:

    FacesContext fc = FacesContext.getCurrentInstance();
    ELContext elctx = fc.getELContext();
    ExpressionFactory elFactory = fc.getApplication().getExpressionFactory();
    ValueExpression valueExpr = elFactory.createValueExpression(elctx,"#{component}",UIXDeclarativeComponent.class);
    UIXDeclarativeComponent decComp = (UIXDeclarativeComponent )valueExpr.getValue(elctx);
    String at = decComp.getAttributes().get("attrName");

    decComp is null.

    I've followd this example:

    http://www.oracle.com/technology/products/jdev/tips/fnimphius/attributeInDeclarativeComponent/accessAttributeInDeclarativeComponent.html

    Any help?

    Thank you so much

    Joseba

    DB:2.44:Declarative Component Attributes jf

    Hi Krithika,

    Thank you for your answer. I decComp is null only if I try this code in the binding method. If I define a popupFetchListener and bind to a method in a managed bean, decComp is not nut. I don't know how to get attribute values and create my UIComponent programatically.

    Does anyone know how to achive that?

    Regards

    Joseba

  • RELEVANCY SCORE 2.42

    DB:2.42:How To Assign An Action Listener Method To Richcommandimagelink sj


    Hi all,

    In the backing I have the code below:

    miImagen= new RichCommandImageLink();
    miImagen.setId(_sId);
    miImagen.setShortDesc(sTooltip);
    miImagen.setIcon(_sValor);
    miImagen.setPartialSubmit(true);

    FacesContext fc = FacesContext.getCurrentInstance();
    Application app = fc.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = fc.getELContext();
    MethodExpression actionMethod = elFactory.createMethodExpression(elContext,
    "*#{backing_dProveedor.onClickImage}*",
    String.class,
    new Class[] {});

    miImagen.setActionExpression(actionMethod);

    public void onClickImage(ActionEvent actionEvent)
    {
    do something....
    }

    When I click on the RichCommandImageLink I obtain this error: Method not found: com.st.serhsnet.iuyc.backing.DProveedor@1f86f75.onClickImage()
    if I take a look to a design time component and I see an action listener assigned I could check that this EL is correct (actionListener="#{backing_dProveedor.another_action_method}")

    Any ideas?

    Thanks

    DB:2.42:How To Assign An Action Listener Method To Richcommandimagelink sj

    SOLVED:

    I found a solution for me:
    I forgot all the previous code and with a class implementing ActionListener like this:
    class ClickImagen implements ActionListener
    {
    public void processAction(ActionEvent actionEvent)
    {
    do something
    }
    }

    And assigning a ClickImage's object to my component's ActionListener turns all ok:

    miImagen.addActionListener(new ClickImagen());

  • RELEVANCY SCORE 2.41

    DB:2.41:Auto Page Refresh Upon Row Selection On Adf Table s1


    Hi Guys,

    I'm currently using JDeveloper 11g R1(11.1.1.2.0)

    I've got an annoying problem with an ADF Table i've created.
    I've set the "RowSelection" property on the table to SINGLE, the "SelectionListener" to "#{applicationBean.rowSelected}"

    The code for the methods are below. When I click on a row in the table my code gets executed and prints to screen the value of the accountId as per normal, however, the page freshes every time i click on a row... Why does it do this and how do i make it stop? Can it not simply select the row and not refresh the page..? For a user who very well may click on multiple rows (for whatever reason) it is extremely annoying for the page to fresh..

    public void rowSelected(SelectionEvent selectionEvent) {
    resolveMethodExpression("#{bindings.InboxSummaryView.collectionModel.makeCurrent}", null,
    new Class[] { SelectionEvent.class }, new Object[] { selectionEvent });

    DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding it = bc.findIteratorBinding("InboxSummaryViewIterator");
    Row currentRow = it.getCurrentRow();

    accountId = currentRow.getAttribute("AccountId").toString();
    System.out.println("Account ID: " + accountId);

    }

    public static Object resolveMethodExpression(String expression, Class returnType, Class[] argTypes,
    Object[] argValues) {

    FacesContext facesContext = FacesContext.getCurrentInstance();
    javax.faces.application.Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    MethodExpression methodExpression = elFactory.createMethodExpression(elContext, expression, returnType, argTypes);

    return methodExpression.invoke(elContext, argValues);
    }

    Any help is appreciated. Thanks in advance,
    Eddie

    DB:2.41:Auto Page Refresh Upon Row Selection On Adf Table s1

    Hi mkonio,

    Thanks for you input, but i gotten a bit of help from one of Oracle's Aces and resolved what went wrong.

    It didn't have anything to do with the table as such, but more rather i had implemented some javascript to allow double click on the table, however, that javascript code was in the JSPX page and that javascript would be calling another method which was inside a page fragment embedded on the JSPX page. Seeing that the calling javascript code (on the JSPX Page) was calling a method outside its scope (outside of the JSPX page) it was resolving it in the page fragment and because of this it was refreshing the entire page. Once i moved the calling javascipt code inside the page fragment, it no longer tried to refresh the entire page.. yay!

    Thanks again

  • RELEVANCY SCORE 2.41

    DB:2.41:How To Get Adf Bindings In Jdeveloper 11g? 11


    Hi,

    I am trying to get the BindingContainer instance in my backing bean. I am getting always null. I tried below two approaches eventhough I am getting null.

    Approach 1:

    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp =
    elFactory.createValueExpression(elContext, "#{bindings}", BindingContainer.class);
    this.bindings = (BindingContainer) valueExp.getValue(elContext);

    Approach 2:

    FacesContext fc = FacesContext.getCurrentInstance();
    this.bindings =
    (BindingContainer) fc.getApplication().evaluateExpressionGet(fc,"#{bindings}",BindingContainer.class);

    First approach worked once and started always giving me null object. Can any one help me what is the wrong here?

    Cheers

    DB:2.41:How To Get Adf Bindings In Jdeveloper 11g? 11

    what does your web.xml look like. I was getting a null binding container before in 10g when my web.xml needed changes to accomodate the Apache Tomahawk library.

  • RELEVANCY SCORE 2.41

    DB:2.41:Accessing A Taskflow Managed Bean Via Code sp


    Hi,I'm using Jdev 11.1.1.7 and JSF 1.2 version.I'm trying to access a managed bean SampleBean.java(PageFlowScope) from another bean(backingbean scope).The SampleBean is the task flow managed bean. FacesContext fctx = FacesContext.getCurrentInstance(); ELContext elctx = fctx.getELContext(); ExpressionFactory exprFactory = fctx.getApplication().getExpressionFactory(); ValueExpression ve = exprFactory.createValueExpression(elctx, "#{pageFlowScope.SampleBean}", Object.class); Object valueObject = ve.getValue(elctx); System.out.println(valueObject); The valueObject is always returned as null. I tried to retrieve it from ADFContext also as below. But still it returns null. ADFContext adfc = ADFContext.getCurrent(); java.util.MapString, Object map = adfc.getPageFlowScope(); SampleBean bean = (SampleBean) map.get("SampleBean"); System.out.println(bean);Can't we access a taskflow managed bean like this ? Pleas help.

    DB:2.41:Accessing A Taskflow Managed Bean Via Code sp

    Take look at:ADF Practice: Get access to the BackingBeanScope of the inner TaskFlowOf course, you need to change above example:instead BackingBeanScopeProviderImpl, you will use PageFlowScopeProviderImpl, in other words, what you need, is as:PageFlowScopeProviderImpl bbProvider = ((PageFlowScopeProviderImpl)AdfFacesContext.getCurrentInstance().getPageFlowScopeProvider()); The rest code is the same...

  • RELEVANCY SCORE 2.41

    DB:2.41:Invoke Method With Parameters -≫ Javax.El.Methodnotfoundexception m8


    Hi, im gettin problems calling a parametrized model method

    The model class has two test methods:
    public class POJOParticipante{
    ...

    public java.lang.String test1(){
    return "this is test1";
    }

    public java.lang.String test2(java.lang.String param){
    return "this is test2";
    }
    ...
    }I bind the methods in the main.jspx page:
    pageDefinition id="mainPageDef" ....
    ...
    methodAction id="test1" InstanceName="POJOParticipante.dataProvider"
    DataControl="POJOParticipante" RequiresUpdateModel="true"
    Action="invokeMethod" MethodName="test1"
    IsViewObjectMethod="false"
    ReturnName="data.POJOParticipante.methodResults.test1_POJOParticipante_dataProvider_test1_result"/
    methodAction id="test2" InstanceName="POJOParticipante.dataProvider"
    DataControl="POJOParticipante" RequiresUpdateModel="true"
    Action="invokeMethod" MethodName="test2"
    IsViewObjectMethod="false"
    ReturnName="data.POJOParticipante.methodResults.test2_POJOParticipante_dataProvider_test2_result"
    NamedData NDName="param" NDType="java.lang.String"/
    ...
    /pageDefinitionThe main.jspx page has a button. That button launch an action listener event captured in a pageFlow Bean called PageBuscadorBean.
    That is de listener code:

    public void doSearchAction(ActionEvent actionEvent) {
    System.out.println(ADFUtils.invokeMethod("#{bindings.test1.execute}"));
    System.out.println(ADFUtils.invokeMethod("#{bindings.test2.execute}", String.class, "First Param"));
    }The helper class ADFUtils method look like this:
    public class ADFUtils {
    ...
    public static Object invokeMethod(String expr, Class[] paramTypes, Object[] params) {
    FacesContext fc = FacesContext.getCurrentInstance();
    ELContext elc = fc.getELContext();
    ExpressionFactory ef = fc.getApplication().getExpressionFactory();
    MethodExpression me = ef.createMethodExpression(elc, expr, Object.class, paramTypes);
    return me.invoke(elc, params);
    }

    public static Object invokeMethod(String expr, Class paramType, Object param) {
    return invokeMethod(expr, new Class[] { paramType }, new Object[] { param });
    }

    public static Object invokeMethod(String expr) {
    return invokeMethod(expr, new Class[0], new Object[0]);
    }
    ...
    }When i try de button, the output tell me that the test1 invocation works fine, but test2 invocation causes a MethodNotFoundException.
    Can anyone tell me what is wrong?. Thanks.

    this is the output:

    this is test1
    *LifecycleImpl _handleException ADF_FACES-60098:El ciclo de vida de Faces recibe excepciones no tratadas en la fase INVOKE_APPLICATION 5*
    javax.faces.el.EvaluationException: javax.el.MethodNotFoundException: Method not found: test2.execute(java.lang.String)

    More info:
    JDeveloper Studio Edition Version 11.1.1.5.0
    ADF Business Components 11.1.1.60.13

    Edited by: David on 30-dic-2011 9:33

    DB:2.41:Invoke Method With Parameters -≫ Javax.El.Methodnotfoundexception m8

    Hi.
    if you have the method published in your DataControl, you can use OpertaionBinding

    OperationBinding operation = bindings.getOperationBinding("test2");
    operation.getParamsMap().put("param", parameterValue);
    operation.execute();

  • RELEVANCY SCORE 2.41

    DB:2.41:Custom Elcontext For A Facelet Template ma


    Hi,

    I would like to let users customize facelets templates at runtime in kind of a theme/skin feature. I've already implemented such a thing with Facelets, but I'm not entirely happy with it. I don't want user templates to have access to the regular EL resolver used by JSF which gives access to all kinds of managed beans used as controllers for the UI. I want to create a custom ELContext and provide only objects that a user's custom templates might need, and nothing more. Basically I want to keep users in a "sandbox". Does anyone know where I would start to look to achieve this? I'm guessing facelets or JSF 2.0 source code but I imagine that is huge.

    Thanks,
    Ryan

    DB:2.41:Custom Elcontext For A Facelet Template ma

    Hi,

    I would like to let users customize facelets templates at runtime in kind of a theme/skin feature. I've already implemented such a thing with Facelets, but I'm not entirely happy with it. I don't want user templates to have access to the regular EL resolver used by JSF which gives access to all kinds of managed beans used as controllers for the UI. I want to create a custom ELContext and provide only objects that a user's custom templates might need, and nothing more. Basically I want to keep users in a "sandbox". Does anyone know where I would start to look to achieve this? I'm guessing facelets or JSF 2.0 source code but I imagine that is huge.

    Thanks,
    Ryan

  • RELEVANCY SCORE 2.40

    DB:2.40:How To Perform The Sorting With Domain Data Type Viewobject Cache? pj


    Hi,

    In ADF BC, I created a Domain Data Type by using the wizard with String or Number Data Type extended. It is creating a xml file and java class with the provision for adding the validations at Data Type level. If custom domain Data Type is attached against the attribute level in an Entity, then i created a default viewobject based on the entity.

    In UI, I Created ADF table and performed the sorting with default. It is working fine and it reterive each and every time from the DB. But my requirement is to sort within the cache. For that i mapped the managed bean method to the sortListener and i performed the sorting with Viewobject by setting the QUERY_MODE_SCAN_VIEW_ROWS, QUERY_MODE_SCAN_ENTITY_ROWS and UERY_MODE_SCAN_UNPOSTED_ENTITY_ROWS. It is not woking. How to achive the sorting?

    I'm using JDeveloper 11.1.1.3.0

    The sample code is following
    public void tableSorting(SortEvent sortEvent)
    {
    String expression = "#{data.HRSysDataControl.dataProvider}";
    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp = elFactory.createValueExpression(elContext, expression, Object.class);
    ApplicationModule am = (ApplicationModule) valueExp.getValue(elContext);
    ViewObject vo = am.findViewObject("EmployeesView");
    String colName = "";
    boolean isAsc = sortEvent.getSortCriteria().get(0).isAscending();
    colName = sortEvent.getSortCriteria().get(0).getProperty();
    if (isAsc)
    {
    colName = colName + " asc";
    }
    else
    {
    colName = colName + " desc";
    }
    //vo.setDBSortCriteria(null);
    vo.setSortBy(colName);
    vo.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS | ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS | ViewObject.QUERY_MODE_SCAN_UNPOSTED_ENTITY_ROWS);
    vo.executeQuery();
    }

    Can anyone help me regarding this???

    Thanks Regards,
    Perumal S

    DB:2.40:How To Perform The Sorting With Domain Data Type Viewobject Cache? pj

    Here are a couple of suggestions that hopefully could help:

    1. Could be a table update issue, so after the executeQuery() add a partialTarget() call for the table.
    2. Enable detailed logging to the console by adding the -Djbo.debugoutput=console Java option to both the Model and ViewController run configurations and take a look at the query that is executed.

  • RELEVANCY SCORE 2.40

    DB:2.40:Exception When Send Email With Template, Java.Lang.Classnotfoundexception: Org.Jboss.Seam.Render.Template.Compiledtemplateresource xm



    16:33:28,932 INFO [org.jboss.solder.Version] (MSC service thread 1-7) Solder 3.1.0.Final (build id: 3.1.0.Final)

    16:33:29,477 INFO [org.jboss.weld.ClassLoading] (MSC service thread 1-7) WELD-000119 Not generating any bean definitions from org.jboss.seam.mail.templating.render.RenderTemplate because of underlying class loading error

    16:33:29,482 INFO [org.jboss.weld.ClassLoading] (MSC service thread 1-7) catching: org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class org.jboss.seam.mail.templating.render.RenderTemplate

    at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:152) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

    at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:86) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

    at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:115) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

    at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:171) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

    at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:336) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

    at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:82) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]

    at org.jboss.as.weld.services.WeldService.start(WeldService.java:76) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]

    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_04]

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_04]

    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_04]

    Caused by: java.lang.NoClassDefFoundError: Lorg/jboss/seam/render/template/CompiledTemplateResource;

    at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.7.0_04]

    at java.lang.Class.privateGetDeclaredFields(Class.java:2308) [rt.jar:1.7.0_04]

    at java.lang.Class.getDeclaredFields(Class.java:1760) [rt.jar:1.7.0_04]

    at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:102) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

    at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:99) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

    at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

    at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

    at org.jboss.weld.util.reflection.SecureReflections.getDeclaredFields(SecureReflections.java:99) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

    at org.jboss.weld.introspector.jlr.WeldClassImpl.init(WeldClassImpl.java:153) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

    at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

    at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:49) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

    at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:40) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

    at com.google.common.collect.ComputingConcurrentHashMap$ComputingValueReference.compute(ComputingConcurrentHashMap.java:355)

    at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:184)

    at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.getOrCompute(ComputingConcurrentHashMap.java:153)

    at com.google.common.collect.ComputingConcurrentHashMap.getOrCompute(ComputingConcurrentHashMap.java:69) [guava-r07.jar:]

    at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:393)

    at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:149) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

    ... 11 more

    Caused by: java.lang.ClassNotFoundException: org.jboss.seam.render.template.CompiledTemplateResource from [Module "deployment.backoffice.war:main" from Service Module Loader]

    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

    ... 29 more

    16:33:29,634 INFO [org.jboss.solder.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-7) Preventing installation of default bean: org.jboss.seam.mail.core.MailConfig

    16:33:29,763 INFO [org.jboss.solder.core.CoreExtension] (MSC service thread 1-7) Preventing class org.jboss.seam.persistence.HibernatePersistenceProvider from being installed as bean due to @Veto annotation

    16:33:29,812 INFO [org.jboss.solder.core.CoreExtension] (MSC service thread 1-7) Preventing class org.jboss.seam.persistence.hibernate.HibernateManagedSessionExtensionImpl from being installed as bean due to @Veto annotation

    16:33:31,130 INFO [org.jboss.solder.core.CoreExtension] (MSC service thread 1-7) Preventing class org.jboss.seam.international.locale.LocaleConfiguration from being installed as bean due to @Veto annotation

    16:33:31,341 INFO [org.jboss.solder.core.CoreExtension] (MSC service thread 1-7) Preventing class org.jboss.seam.faces.validation.InputElement from being installed as bean due to @Veto annotation

    16:33:31,507 INFO [org.jboss.solder.core.CoreExtension] (MSC service thread 1-7) Preventing class org.jboss.seam.transaction.NoTransaction from being installed as bean due to @Veto annotation

    16:33:31,520 INFO [org.jboss.solder.core.CoreExtension] (MSC service thread 1-7) Preventing class org.jboss.seam.transaction.UTTransaction from being installed as bean due to @Veto annotation

    16:33:31,593 INFO [org.jboss.solder.core.CoreExtension] (MSC service thread 1-7) Preventing class org.jboss.seam.transaction.HibernateTransaction from being installed as bean due to @Veto annotation

    16:33:31,622 INFO [org.jboss.solder.core.CoreExtension] (MSC service thread 1-7) Preventing class org.jboss.seam.transaction.SeSynchronizations from being installed as bean due to @Veto annotation

    16:33:31,639 INFO [org.jboss.solder.core.CoreExtension] (MSC service thread 1-7) Preventing class org.jboss.seam.transaction.CMTTransaction from being installed as bean due to @Veto annotation

    16:33:31,655 INFO [org.jboss.solder.core.CoreExtension] (MSC service thread 1-7) Preventing class org.jboss.seam.transaction.EntityTransaction from being installed as bean due to @Veto annotation

    16:33:32,148 INFO [org.jboss.solder.core.CoreExtension] (MSC service thread 1-7) Preventing class org.jboss.seam.security.SecurityEventMessages from being installed as bean due to @Veto annotation

    16:33:33,568 INFO [org.jboss.solder.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-7) Preventing installation of default bean: org.jboss.seam.mail.core.MailConfig

    16:33:33,958 INFO [org.jboss.solder.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-7) Wrapping InjectionTarget to set field values: org.jboss.seam.mail.core.MailConfig

    16:33:34,027 INFO [org.jboss.seam.international.status.TypedStatusMessageBundleExtension] (MSC service thread 1-7) Add @MessageBundle to org.jboss.solder.reflection.annotated.AnnotationBuilder.messages injection point for the type: org.jboss.solder.support.SolderMessages

    16:33:34,122 INFO [org.jboss.seam.international.status.TypedStatusMessageBundleExtension] (MSC service thread 1-7) Add @MessageBundle to org.jboss.solder.reflection.annotated.AnnotatedTypeBuilder.messages injection point for the type: org.jboss.solder.support.SolderMessages

    16:33:34,398 INFO [org.jboss.solder.exception.control.extension] (MSC service thread 1-7) Adding handler Qualifiers: [@javax.enterprise.inject.Any()] TraversalMode: BREADTH_FIRST Handles Type: class java.lang.Throwable Precedence: -100 [method] public org.jboss.seam.transaction.SimpleTransactionExceptionHandler.markTransactionRollback(CaughtExceptionThrowable) to known handlers

    16:33:35,049 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.deployment.unit."backoffice.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."backoffice.war".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [ELContext] with qualifiers [@Default] at injection point [[parameter 1] of [constructor] @Inject public org.jboss.solder.el.Expressions(ELContext, ExpressionFactory)]. Possible dependencies [[Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.jboss.solder.el.ELContextProducer.createELContext()], Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.jboss.seam.solder.el.ELContextProducer.createELContext()]]]

    at org.jboss.as.weld.services.WeldService.start(WeldService.java:83)

    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_04]

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_04]

    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_04]

    Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [ELContext] with qualifiers [@Default] at injection point [[parameter 1] of [constructor] @Inject public org.jboss.solder.el.Expressions(ELContext, ExpressionFactory)]. Possible dependencies [[Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.jboss.solder.el.ELContextProducer.createELContext()], Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.jboss.seam.solder.el.ELContextProducer.createELContext()]]]

    at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:278)

    at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:244)

    at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:107)

    at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:127)

    at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:346)

    at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:331)

    at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:366)

    at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:83)

    at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)

    ... 5 more

    16:33:35,346 INFO [org.jboss.as.jpa] (MSC service thread 1-8) JBAS011403: Stopping Persistence Unit Service 'backoffice.war#backoffice_invy_PU'

    16:33:35,346 INFO [org.jboss.as.server] (management-handler-thread - 23) JBAS015870: Deploy of deployment "backoffice.war" was rolled back with failure message {"JBAS014671: Failed services" = {"jboss.deployment.unit.\"backoffice.war\".WeldService" = "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"backoffice.war\".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [ELContext] with qualifiers [@Default] at injection point [[parameter 1] of [constructor] @Inject public org.jboss.solder.el.Expressions(ELContext, ExpressionFactory)]. Possible dependencies [[Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.jboss.solder.el.ELContextProducer.createELContext()], Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.jboss.seam.solder.el.ELContextProducer.createELContext()]]]"}}

    16:33:36,075 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment backoffice.war in 738ms

    16:33:36,080 INFO [org.jboss.as.controller] (management-handler-thread - 23) JBAS014774: Service status report

    JBAS014777: Services which failed to start: service jboss.deployment.unit."backoffice.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."backoffice.war".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [ELContext] with qualifiers [@Default] at injection point [[parameter 1] of [constructor] @Inject public org.jboss.solder.el.Expressions(ELContext, ExpressionFactory)]. Possible dependencies [[Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.jboss.solder.el.ELContextProducer.createELContext()], Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.jboss.seam.solder.el.ELContextProducer.createELContext()]]]

    DB:2.40:Exception When Send Email With Template, Java.Lang.Classnotfoundexception: Org.Jboss.Seam.Render.Template.Compiledtemplateresource xm


    I'm not sure what version you are using but we dropped support for Seam Render in the final release. Should be using 3.1.0.Final. However that is just a info message that can be ignored.

    The real cause of your deployment error appears to be that you have multiple versions of Solder in your project and that is what is causing the WELD-001409 excecption.

  • RELEVANCY SCORE 2.40

    DB:2.40:Calling Action Listener For A Button Component In Java Bean Page 9k


    Hi,

    I have made it like this.

    public void handleButtonPressed(ActionEvent event){
    System.out.println("success!!!!!");
    }

    //code for calling actionlistener
    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getELContext();
    Application application = fctx.getApplication();
    ExpressionFactory exprFactory = application.getExpressionFactory();

    MethodExpression methodExpr = null;
    methodExpr = exprFactory.createMethodExpression(elctx, "#{exbean.handleButtonPressed}",null,new Class[] { ActionEvent.class });
    MethodExpressionActionListener actionListener = null;
    actionListener = new MethodExpressionActionListener(methodExpr);

    button.addActionListener(actionListener);
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Even after making the listener Function as Void wHen i click the button i m getting the error saying."ARGUMENTS MISMATCH,ADF_FACES60097"??
    can you help me out?
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    and in the msg log i m getting this

    "SkinFactoryImpl getSkin Cannot find a skin that matches family portal and version v1.1. We will use the skin portal.desktop.
    MethodExpressionActionListener processAction Received 'javax.el.PropertyNotFoundException' when invoking action listener '#{exbean.handleButtonPressed}' for component 'null'
    MethodExpressionActionListener processAction javax.el.PropertyNotFoundException: Target Unreachable, identifier 'custombean' resolved to null"
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    I Have tried with this giving Void TYPE as an argument
    methodExpr = exprFactory.createMethodExpression(elctx, "#{exbean.handleButtonPressed},Void.TYPE,new Class[] { ActionEvent.class });

    I M getting the same error.

    Edited by: chaya on Dec 22, 2011 2:47 PM

  • RELEVANCY SCORE 2.40

    DB:2.40:Adf : Issue On Custom Table Selection Listener 9p


    Hi guys, I work on Jdev 11.1.1.4.0 and Integrated Weblo. let me explain my issue. I have a table where you can classicly select a row. I've needed to customize the selection Listener like this : public void onSelectServer(SelectionEvent selectionEvent) { JsfUtils.invokeMethodExpression("#{bindings.AdmRefServer.collectionModel.makeCurrent}", Object.class, selectionEvent.getClass(), selectionEvent); refreshAllContacts = true; refreshSelectedContacts = true; // Display warning message if server has no contact displayWarningMessage(); } where the utility class JsfUtils distributed by Steve Muench and Duncan Mills on the net is: /** * General useful static utilies for working with JSF. * NOTE: Updated to use JSF 1.2 ExpressionFactory. * * @author Duncan Mills * @author Steve Muench * * $Id: JSFUtils.java 1885 2007-06-26 00:47:41Z ralsmith $ */public class JsfUtils { public static Object invokeMethodExpression(String expr, Class returnType, Class argType, Object argument) { return resolveMethodExpression(expr, returnType, new Class[] { argType }, new Object[] { argument }); } public static Object resolveMethodExpression(String expression, Class returnType, Class[] argTypes, Object[] argValues) { FacesContext facesContext = getFacesContext(); Application app = facesContext.getApplication(); ExpressionFactory elFactory = app.getExpressionFactory(); ELContext elContext = facesContext.getELContext(); MethodExpression methodExpression = elFactory.createMethodExpression(elContext, expression, returnType, argTypes); return methodExpression.invoke(elContext, argValues); }} All this works fine only in one use case i have detected. I create a new row, the default id for this row is 0 (fixed in the entity), and i check the flag refresh after Insert to populate the attribute with the right value after inserting in the database. I commit the creation. Creation is OK. The id is refreshed with the one of database sequence (i can see it on UI). I move to another row with success but when i return to the last created row, the selection method failed. I can see it because the editable form of the elements of the row below doesn't synchronize with the current row but with the previous one and i have in the weblogic log this : FacesCtrlHierBinding$FacesModel makeCurrent ADFv : no row found for rowKey : [oracle.jbo.Key[0 ]]. To be sure i log the SelectionEvent.RowKeyset and it displays : oracle.jbo.Key[0]. So my problem is that the SelectionEvent object im my use case is based on the default RowKey value (0) and not the new one. What did i do wrong? I don't understand why SelectionEvent doesn't use the new rowKey.Regards,David

    DB:2.40:Adf : Issue On Custom Table Selection Listener 9p

    Hi,fir trigger populated sequences I recommend you use DBSequence as a data type so the framework fills in the temporary key. The problem really don't is with the custom selection listener but with the way you create and handle the temporary IDFrank

  • RELEVANCY SCORE 2.40

    DB:2.40:Getting Selectonechoice From Wizard In Managed Bean 79


    JDeveloper 11.1.3.4
    JHeadstart 11.1.3.3.35

    Hi guys,

    I have a wizard (inserting a new record) that on a number of train stops contains some dropdownLists populated with static domains defined in the JAG.

    Before my last train stop I want to inspect some of the values and display an appropriate message on the screen. I have placed a method-call activity on the relevant adfc-config file that calls a managed bean. Within the managed bean I then want to check values in various dropdownLists on different pages within the train.

    What is the correct way to obtain the selected values ?

    Previously I've used helper classes like
    public static Object getInputValue(String expr) {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp =
    elFactory.createValueExpression(elContext, "#{bindings." + expr + ".inputValue}", Object.class);
    return valueExp.getValue(elContext);
    }

    public static Object getAttributeValue(String expr) {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp =
    elFactory.createValueExpression(elContext, "#{bindings." + expr + ".attributeValue}", Object.class);
    return valueExp.getValue(elContext);
    } but these are all returning null.

    My other option is to move my method into the application module where I can grab the current row of the view object and inspect the values like that but I thought it would be better/cleaner to not call the model project just to check values entered by the user on the screen.

    I've sure I've done this before and I'm sure the answer is simple but I'm stumped - can someone point me in the right direction please ?!

    Cheers :)
    Brent

  • RELEVANCY SCORE 2.39

    DB:2.39:Re: How To Get Managed Bean Of An Adf Taskflow In Code xf


    Try the following:

    FacesContext fc = FacesContext.getCurrentInstance();
    ELContext elctx = fc.getELContext();
    ExpressionFactory elFactory = fc.getApplication().getExpressionFactory();

    // this should return a reference to your backing bean
    Object yourBackingBean = elFactory.createValueExpression(elctx, "#{pageFlowScope.YourBackingBean",
    Object.class).getValue(elctx);Regards,

    Nick

    DB:2.39:Re: How To Get Managed Bean Of An Adf Taskflow In Code xf

    It seems that everytime I request servlet from code, (using url.openConnection() ) a new session is created. So it is not possible for me to save the info in HttpSession.setAttribute(..)
    Any suggestion?
    Is there any diffrences between the ADF task flow managed bean and JSF managed bean?

  • RELEVANCY SCORE 2.38

    DB:2.38:Skip Validations On Value Change Listener. d9


    I have two Jsff pages let us say Page1 and Page2. In Page1, Page2 task flow is included as the dynamic region.In Page1 I have PhoneCountryCode inputComboBoxListOfValues, and in Page2 there is Country inputComboBoxListOfValues. My requirement is to change the value in the PhoneCountryCode according to the Country selection. There are some other address fields in the Page2 with some validations.I have implemented as follows using parent actions.1. In Page2 taskflow there is a parent action for country value change.2. In the Country value change listener I raise the parent action using the following code. FacesContext fc = FacesContext.getCurrentInstance(); ExpressionFactory ef = fc.getApplication().getExpressionFactory(); ELContext elc = fc.getELContext(); MethodExpression me = ef.createMethodExpression(elc, "countryChanged", String.class, new Class[] { }); regionComponent.queueActionEventInRegion(me, null, null, false, -1,-1, valueChangeEvent.getPhaseId());3. Now I have a Method call in the Page1 taskflow for this parent action. It is method from managed bean where it has the code to get the selected country and fetch the corresponding phone code from the DB. Set the value to PhoneCountryCode inputComboBoxListOfValues and a raise a partial trigger to refresh the component. this.setEL("#{bindings.PhoneCountryCode.inputValue}", countryCode); AdfFacesContext.getCurrentInstance().addPartialTarget(this.phoneCountryCodeRef); private void setEL(String el,Object val){ FacesContext facesContext = FacesContext.getCurrentInstance(); ELContext elContext = facesContext.getELContext(); ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory(); ValueExpression exp = expressionFactory.createValueExpression(elContext, el, Object.class); exp.setValue(elContext, val); }It is causing some problem now. When I change the value from the Country list box, it is hitting the validations from the Page2 and raising an error saying error occured during PPR and the corresponding validation messages.I tried skipping the validations on my step2 above using PhaseId.RENDER_RESPONSE instead of using valueChangeEvent.getPhaseId(). This skipped the validations but it also skipping the method call. I even tried with PhaseId.UPDATE_MODEL_VALUES, did not work.Instead of parent actions I used contextual events, where everything works fine. But in my project it is not recommended to use the contextual events.I there a solution to solve my problem ???

    DB:2.38:Skip Validations On Value Change Listener. d9

    Hi Frank,Yes, autoSubmit="true" is there and I have tried renderResponse(), but it did not work in my case.

  • RELEVANCY SCORE 2.38

    DB:2.38:Getting The Parametes From Url String. c9


    Hi,

    My Requirement is get the input parameters from URL .
    Mu URL is:- http://127.0.0.1:7101/ADF_OAF-ViewController-context-root/faces/AdfPage.jspx?TEST_ID=250
    i need to get the TEST _ID value and i need to get the data from DB.
    I am trying to get from req obj i get null

    HttpServletRequest request = (HttpServletRequest)facesContext.getExternalContext().getRequest();
    System.out.println("TEST_ID value in Req obj:-"+ request.getParameter("TEST_ID"));

    Even i am trying as below also buit not getting the values.

    String el = "#{param.TEST_ID}";
    FacesContext facesContext = FacesContext.getCurrentInstance();
    //ELContext elContext = facesContext.getELContext();
    //ExpressionFactory expressionFactory =
    // facesContext.getApplication().getExpressionFactory();
    // ValueExpression exp =
    //expressionFactory.createValueExpression(elContext, el,
    // Object.class);

    //String value = (String)exp.getValue(elContext);
    //System.out.println("value is " + value);

    is any way to get the values form URL?

    Thanks,
    Madhava

    DB:2.38:Getting The Parametes From Url String. c9

    Hi,
    try this
    FacesContext facesContext = null;
    HttpServletRequest request = null;

    facesContext = FacesContext.getCurrentInstance();
    request = (HttpServletRequest)facesContext.getExternalContext().getRequest();
    String testID = request.getParameter("TEST_ID");
    System.out.println("TEST_ID value in Req obj:-"+ testID);If not put scope you have been used and get from it.
    See
    Storing and accessing pageFlowScope values in bean