SelectBooleanCheckbox and component instance backing bean problem

Hi
I have a selectBooleanCheckbox with the binding property pointing to a CoreSelectBooleanCheckbox but if the user changes the checkbox value CoreSelectBooleanCheckbox remains unchanged.
Any idea ?

try this:
private CoreCommandButton cmd;
private CoreSelectBooleanCheckbox chb;
private boolean boo = false;
public String cmd_action() {
// Add event code here...
if (getChb().isSelected() == true) {
setBoo(false);
} else {
setBoo(true);
return null;
in the page:
<af:selectBooleanCheckbox text="selectBooleanCheckbox 1"
label="Label 1" binding="#{prub.chb}"
partialTriggers="cmd" value="#{prub.boo}"/>
<af:commandButton text="commandButton 1" binding="#{prub.cmd}"
id="cmd" action="#{prub.cmd_action}"/>
is it???

Similar Messages

  • Setting focus on a component from backing bean

    Is there an easy way to set focus in a specific component on the jspx from a method in the backing bean? (other than javaScript coding...)

    Hi,
    did you take a look at
    About control the cursor position in a JSF web page
    It contains some links to other weblogs. The links are helpfull. Maybe you'll be able to find your solution there......
    Good luck
    Luc Bors

  • Oracle11g RAC with partitioning and cross instance parallel query problem

    I have set up a 300gb TPC-H database using a 4 node RAC environment (8 cpu per node, 16 GB memory, 2 GHz processors) the system is served by 2.5 terabytes of SSD for its IO subsystem managed by a combination of ASM and OCFS2.
    When I run a large parallel query (number 9 in the TPCH query set) I get:
    ORA-00600: internal error code, arguments [kxfrGraDistNum3],[65535],[4]
    with all other arguments blank. There were some reports of this in version 9, but it was supposedly fixed. Has any one seen this behavior or have a work around?
    Mike

    Good Idea! Why didn't I think of that? Oh yea...I did. Unfortunately TMS CSI is an update only partner type CSI so I cannot submit a SR. The 600 lookup was how I found the old stuff, but it didn't have any 11g references. I hoped maybe someone in the community had encountered this and had a workaround. By the way, the querey looks like so:
    select
    nation,
    o_year,
    sum(amount) as sum_profit
    from
    select
    n_name as nation,
    extract(year from o_orderdate) as o_year,
    l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount
    from
    h_part,
    h_supplier,
    h_lineitem,
    h_partsupp,
    h_order,
    h_nation
    where
    s_suppkey = l_suppkey
    and ps_suppkey = l_suppkey
    and ps_partkey = l_partkey
    and p_partkey = l_partkey
    and o_orderkey = l_orderkey
    and s_nationkey = n_nationkey
    and p_name like '%spring%'
    ) as profit
    group by
    nation,
    o_year
    order by
    nation,
    o_year desc;
    the other 21 queries, all using the same tables and degrees of paralell and cross instance settings, executed ok.
    Mike

  • New to Beans and Apache Tomcat - 1st Bean problem !

    Hello all. Just to give you some background, I know basic Java and I am more than happy to have a go at something I know nothing about.
    I am developing a system - for my own personal use (and friends) that will have an Oracle back end and a web browser and mobile phone front end, connectivity to DB via JDBC.
    I'm using JSPs and, I was debating whether to use Servlets too. I reads a few documents and, for what I want, Java Beans seem spot on. So I am running through a tutorial trying to get the basics of it.
    This is the error I am getting:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 5 in the jsp file: /showUserBean.jsp
    Generated servlet error:
    UserBean cannot be resolved to a type
    I should be passing the variables to the bean through the url in this example but the book does not show how to do it, so I left the url with just http://localhost/showUserBean.jsp
    The error is refering to a UserBean type, it seems that when the JSP is compiled the system does not know "what" class UserBean is or where to find it. Any pointers would be greatly appreciated. the UserBean.class file is in the apache install dir default webapps/root/web-inf/classes folder.
    The JSP is in the apache default install dir webapps/root folder.
    The code for the bean is:
    // first attempt at a Bean
    public class UserBean implements java.io.Serializable
    protected int userId;
    protected String userName;
    protected String location;
    public UserBean(){}
    public int getUserId() { return userId; }
    public void setUserId(int aUserId)
    { userId = aUserId; }
    public String getUserName() { return userName; }
    public void setUserName(String aUserName)
    { userName = aUserName; }
    public String getLocation() { return location; }
    public void setLocation(String aLocation)
    { location = aLocation; }
    The code for the JSP is:
    <html>
    <body>
    <%-- Create an instance of the bean --%>
    <jsp:useBean id="userBean" class="UserBean"/>
    <%--Copy the parameters into the bean --%>
    <jsp:setProperty name="userBean" property="*"/>
    The bean values are:,br>
    User ID: <jsp:getProperty name="userBean" property="userId"/><br>
    Username: <jsp:getProperty name="userBean" property="userName"/><br>
    Location: <jsp:getProperty name="userBean" property="location"/><br>
    </body>
    </html>

    JavaBeans seems they are more focused for visual interfacesRead the specification: http://java.sun.com/products/javabeans/docs/spec.html
    I want to simply create some objects from classes and manipulate the data held by themLike struct in C? JavaBean technology helps you

  • Session state and browser cache - Back button problem

    Hi all,
    I have a problem (and unless I'm missing something I think we all do) with session state and use of the browser's Back button. I really hope I'm just being dumb...
    Background scenario:
    Page P has a sidebar list allowing the user to select what content is displayed (e.g. 'stuff relating to X, Y or Z' where X, Y and Z are rows in, say, a table of projects). When a list entry is clicked, we branch to page P with the value of the list item placed in an application-level item (call it G_PROJECT). Reports on page P use G_PROJECT in their WHERE clauses.
    So, click list entry X and G_PROJECT is set to X and page P shows reports for project X.
    Page P also has a set of buttons which branch to various edit pages which allow attributes of page P's current project to be updated. These pages similarly use G_PROJECT in their WHERE clauses.
    Problem scenario:
    1. The user goes to page P and picks project X off the list. Project X's stuff is displayed (G_PROJECT = X).
    2. The user then picks project Y off the list. Project Y's stuff is displayed (G_PROJECT = Y).
    3. The user then clicks the browser's Back button. The page is served from browser cache, so project X's stuff is displayed, but G_PROJECT still = Y.
    4. The user clicks an 'Edit' button; we submit, and branch to an edit page which displays (and will edit) data for project Y because G_PROJECT still = Y.
    This is SERIOUSLY BAD NEWS - apart from being confusing, the user's edit permissions on projects X and Y may differ, and so the user may be able to perform 'illegal' updates.
    I've read what I can on this forum and the rest of the web looking for ways to a) inhibit browsers' 'Back' functions and/or b) prevent pages being cached by the browser, but none of them have worked for me.
    Short of waiting for browser manufacturers to recognise that the web is now full of applications as well as static pages, and enable robust programmatic control of cache behaviour, does anybody know how the problem can be avoided - or at least detected?
    Thanks,
    jd
    Failed attempts to date:
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="cache-control" content="no-store">
    <meta http-equiv="cache-control" content="private">
    <meta http-equiv="cache-control" content="max-age=0, must-revalidate">
    <meta http-equiv="expires" content="Wed, 09 Aug 2000 01:01:01 GMT">
    <meta http-equiv="pragma" content="no-cache">
    Disallowing duplicate submission (page attribute).
    window.history.go(1);

    Thanks Scott,
    I may be being dumb here but I don't see how that would help...
    P250_PROJECT and G_PROJECT are currently kept in sync by app logic. Whichever is used to drive, if the page is rendered from cache then the app logic is not executed, so the rendered page contents are not those keyed by P250_PROJECT, as illustrated in steps 1-4 of the problem above.
    The user sees X, the session items say Y. The engine doesn't know what the user is seeing.
    when page P is POSTed, its hidden item P250_PROJECT should always be used to derive the application item G_PROJECT. Then whether the page was pulled from cache or rendered anew via a click from the sidebar link, the project ID is determined by the contents of that page.
    As I said above I tried this, with the 'Edit' branch set to:
    Set these items: G_PROJECT
    With these values: &P250_PROJECT.
    but it makes no difference. The project ID is not determined by the rendered page contents - the engine gets the value of P250_PROJECT from session state.
    I can code the 'Edit' pages such that they check permissions and if necessary redirect back to p250 (conditional before-header branch), but that's a clunky cure rather than the prevention I was hoping for.
    Please tell me if my understanding is incorrect.
    jd

  • JSF - Click twice to get actual content and data from back Bean

    Hello,
    maybe an easy thing ... i got a Menu wih commandLink. the BackBean sends back the "from-outcome". After I cklick on a commandLine, the page is called, but some vars are still from page befor. cklicking second time, then it works. The bad thing about this, is, I have Realm, and the LoginPage appears after I click twice. The User sees the protected<page wthout beeing logged in ...
    someone has an idea?
    thx.
    PS.:Bean ist Session-Scope, marked as Stateful.

    Hello,
    thx for the answet. I debugged.
    When I call with the command the next page, I call a Bean which gives back the outcome ti display the next page. the vars i'm reading, i read with another bean, called when i make the content. apparently, when i use this
    context = FacesContext.getCurrentInstance();
    resp = (HttpServletRequest) context.getExternalContext().getRequest();
    System.out.println("Get " + resp.getRequestURI());
    the display says : "/company-db/index.faces"
    the page i'm go to is "registry.faces"
    when I click a second time, then the display is:
    the display says "/company-db/registry.faces"

  • Getting a value of an input text component in backing bean

    I have created an input text component on a page where I will be entering a number, setting Autosubmit feature as true. ValueChangeListener property is set as #{test.displayTable} where displayTable is a method defined in test managed bean.
    Now I know to fetch the value entered in input text component by creating a RichInputText variable in Advanced property.
    But in case the Advanced property is blank, then how will I be able to retrieve the value of it? This is the code. I am not able to get the value entered in the component. I can't even find any getvalue method for it.
    FacesContext facesContext = FacesContext.getCurrentInstance();
    UIViewRoot root = facesContext.getViewRoot();
    RichInputText inputText = (RichInputText) root.findComponent("it1");  // it1 is the id of the input text component
    System.out.println("inputText: "+inputText);On using sop statement, this is the output which is getting generated, while I had entered 90.
    inputText: RichInputText[UIXEditableFacesBeanImpl, id=it1]

    One more thing. Once the VO is getting refreshed, I am able to display an inline message saying that 'Table refreshed Successfully!' (refer the code)
    But in case if the user doesn't enter anything, and press TAB button, I want to display an error message exactly besides the input text component, saying that 'Please Enter an Integer.' According to my understanding, if the user enters a null value then while casting string to Integer, it will throw an exception, so I will be writing the code in the catch part. Any suggestions?
    public void displayTable(ValueChangeEvent valueChangeEvent) {
            BindingContext bctx = BindingContext.getCurrent();
            BindingContainer bindings = bctx.getCurrentBindingsEntry();
            OperationBinding method = (OperationBinding)bindings.get("displayEmployeeTable");
            try {
                Integer getValue = Integer.valueOf(valueChangeEvent.getNewValue().toString());
                System.out.println("getValue: " + getValue);
                method.getParamsMap().put("deptId", getValue);
            } catch (Exception e) {
            method.execute();
            FacesMessage message = new FacesMessage("Table refreshed Successfully!");
            message.setSeverity(FacesMessage.SEVERITY_INFO);
            FacesContext fc = FacesContext.getCurrentInstance();
            fc.addMessage(null, message);
        }Edited by: Sonull on Jan 12, 2013 3:56 PM

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

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

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

  • ADF Faces Declarative Component onLoad event call Backing Bean Method

    Hello.
    We are trying to implement a declarative component, that will be used as Flex Fields for our application, ie, the components will be created dynamically through a database configuration, and who is responsible for organizing and creating the components, is the declarative components, and its own backing bean.
    The declarative component, will receive a List of custom components, and with this list it is possible to create the components dynamically. We want the components to be created as soon as the page is loaded. The developer could place this declarative component in any region of his page, and even in another tab if he wishes. The problem is, that we cannot register a load event in the declarative component, since it doesn't have a document Object, to call the declarative components backing bean method that is responsible for creating components.
    How could we simulate the onLoad (of the declarative components) so that the backing bean method (responsible for creating component, and putting it in the view tree) could be called ?
    I've tried with a RENDER_RESPONSE phaseListener, but the beforePhase has no objects in the tree, and the afterPhase has already rendered to the client.
    Any ideas on how to achieve this ?
    Thanks a lot.
    Regards,
    John

    Hi Frank, thanks for the response.
    I'm curious about the dynamic declarative component. Any place I could check it out ?
    Back to my scenario. I'll try to be more clear to what we need!
    We have to have dynamic creation of components, based on a database configuration. This will allow our customers to have custom flex fields, without the need of us developing custom pages for each customer.
    One solution we are trying out, is the declarative component. Why ? Because the developer (when developing the page), knows that this specific page, is possible of customization by the client (custom flex fields). With this, the developer would choose where on his page the custom flex fields will be placed. Note that at this point (design time), no component (input, buttrons, etc) is created. The idea of the declarative component, is just so the Developer knows where he wants the custom fields placed in his page (a tab, below the form fields, in a another panel group, and so on). The declarative component, has only a container, PanelFormLayout, and no other component.
    What we want, is a way of calling our managed bean (the managed bean of the declarative component, that now I did configure it in the adfc-config.xml file , thanks for the tip) method, that's responsible for creating the custom components. The declarative component, receives a list of all the custom fields that needs to be created, at design time, through an attribute. The developer is responsible for setting this list when he drags the declarative component on his page.
    Now that I've put the declarative components managed bean in the adfc-config.xml file, the @PostConstruct is called correctly, but I still have a problem. At this moment (postContstruct call), my component PanelFormLayout (that is binded to the managed bean), is null. So I cannot add any component to the PanelFormLayout.
    Am I way out of line here Frank ?
    Really appreciate your comments.
    Thanks a lot.
    John

  • ADF-BC/JSF How to display acustom error message from a backing bean

    Hi all
    Can anybody provide an example of how to manipulate the list of error messages from a JSF backing bean.
    In my code I use a different navigation case and this directs the user to the page displaying the error message but I am sure that there must be a more elegant way.
    Thanks in advance
    Thanassis

    Thanks Kris
    I think you 've put me on the right track here, it's just that in my case what I really want to do is prevent my users from editing records not belonging to their own group. This is done via a selectOne table component and then the backing bean code tests if the value #{row.UserGroup} matches the #{bindings.LoggedOnUserGroup.inputValue}. If the values are equal then the beans returns the navigation case to the edit page. Otherwise it returns the navigation case for the "cannot edit" page.
    So what I am thinking is to return null and somehow raise the right kind of exception in order to display the error in the af:messages tag.
    Thanassis

  • Calling function from Backing Bean or JSP page

    We are on Jdeveloper 10.1.3.3.0, ADF Faces, JSF Faces .., Currently there is a function call from Javascript event (onmouseover) in the JSP page. I want to call this function from a backing bean or JSP page, as I have to pass some values to this function.
    For Ex., I have a function call like return submit('A','B','Test'); on the Javascript event (onmouseover) in jsp page. I want to remove this function from the javascript event and call from backing bean or jsp page to pass some values into the submit() function. I appreciate if anyone can give some example of how to call this function from backing bean or jsp page in the <SCRIPT> or <SCRIPTLET>
    Thanks,
    Ram

    A use case would be helpful so that we can get a better idea of what you want to do.
    As a general rule, there is no way to call a client side Javascript function from a backing bean, which is server side. However, there are ways to inject information from a backing bean into your Javascript call. For instance, I have an application that uses Google Maps API. It has an onload call to a Javascript function that builds the map and designates it's center point. The center point comes from a backing bean as latitude and longitude properties. So here is my body tag:
    <afh:body onload="initialize(#{backing_searchResults.latitude},#{backing_searchResults.longitude},#{searchCriteria.distance})"
              onunload="GUnload()">onload calls the Javascript function called initialize, and passes the latitude, longitude, and distance from the bean. Is the function really being called from my backing bean? No - the parameters are hard coded into the onload event code when the page is rendered. Does it do the job? Sure it does.

  • Backing bean not holding values!

    I have created a simple login page for an app I am creating. I have used JSPX, and created a backing bean which is registered as a managed bean. Just for interests sake (to check that things work), i initialise the userName and password attributes - and I see these defualt values in the gui (OK), however when I entered a user name and password, the values are not updated, so my login code (bound to the action of a commandButton) cannot get the values and log me in.
    my faces-config.xml has this snippet:
    <managed-bean>
    <managed-bean-name>LoginBean</managed-bean-name>
    <managed-bean-class>userinterface.backing.LoginBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    my JSPX has definitions like this:
    <h:inputText id="userName" value="#{LoginBean.userName}" required="true"/>
    my backing bean has the attributes defined:
    private String password = "testPass";
    private String userName = "testUser";
    i just dont understand what I am missing. From the documentation I have read, setting the value attribute by binding it the the backing beans attributes should be enough to update the values... but apparently not.
    Also, when I press "login" the username and password fields are cleared... is this normal behviour?
    I am sure my backing bean is correctly defined as the fields show with default values, and the command buttons worrk. Do I need to hook up the getters and setters in the JSPX page?
    Thanks for any insight - this is fun technology to play with, but trying to get some simple things up and running can be frustrating!
    /caj

    I found the problem eventually - the structure in my jspx document was incorrect, as I had mananged to split my from into two forms, and the submit commandButton was only submitting the form that the button resided on. The edited information was on the other form, and was thus not sumbitted. Once I merged the form into one, the whole thing worked perfectly!!
    I figured that I did something wrong - hope this mistake can help others.
    /caj

  • Initializing backing bean

    I've found here an answer to a question how to initialize backing bean with get request with parameter:
    http://localhost/details.faces?id=1231
    create an BackingBean for your details.jsp
    set its scope to "request"
    in Construktor you do something like this:
    public BackingBean(){  String param = (String) FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("id");// pass 'param' into SQL or something other.//result of that could be the value of backingbeans properties
    if you have SQL, i recommend to use <h:dataTable> in jsp-file,
    that could use a resultset directly for displaying.
    Now, I have a backing bean with components in it. I see in book that I shouldn't set components values, rather let to retrieve null value and then let a call setValue. Let's say that I want to initilaize component in backing bean consructor with a value that I retrieve form database basing on id. Can I create this component by my self ? I know that this in not a good practice, but that is what I want to do.
    M@t

    I wonder why your link isn't working... :p

  • General Rule on manipulating ViewObjects inside backing bean

    I've read in some articles and thread posts by that it is not advisable to manipulate ViewObjects inside a backin bean?
    Are there any exceptions to this rule?
    I have scenario where in my ViewObject is initially created and set to a MaxFetchSize(0) so that on the initial page load, I will just create a new blank row and BC4J will not query any data. However, there is also Search/Find buttons on the same page/viewobject that will query the database. So i will need to edit MaxFetchSize to a positive number so only then, data is queried from the DB. I put it in a backing bean method:
    public String find() {
    OperationBinding ob = (OperationBinding)bindings.get("Execute");
    ViewObject vo = iteratorBinding.getViewObject();
    vo.setMaxFetchSize(10);
    ob.execute();
    }So in effect, I manipulated the ViewObject inside the backing bean. Can this be considered an exception to the rule or best practice?
    regards,
    Anton

    Anton,
    you can call that method without writing a custom method in the VO. Just add an entry like this to your page def:
    <methodAction IterBinding="SomeView1Iterator" id="setMaxFetchSize" MethodName="setMaxFetchSize"
                      RequiresUpdateModel="true" Action="999" IsViewObjectMethod="true" DataControl="AppModuleDataControl"
                      InstanceName="AppModuleDataControl.SomeView1">
          <NamedData NDName="val" NDValue="10" NDType="int"/>
        </methodAction>and in your backing bean:
        public String setMaxFetchSize_action() {
             FacesContext fc = FacesContext.getCurrentInstance();
             ValueBinding vb = fc.getApplication().createValueBinding("#{bindings}");
             DCBindingContainer dc = (DCBindingContainer) vb.getValue(fc);
             OperationBinding operationBinding = dc.getOperationBinding("setMaxFetchSize");
             operationBinding.execute();
             if (operationBinding.getErrors().isEmpty()){
                 System.out.println("operation successful");
             else
                 System.out.println("operation failed");
            return null;
        }no need to write and expose a VO client method.
    Brenden

  • Role of backing beans in MVC design

    Hello,
    yet another JSF/MVC question. In short, I would like to know what the role of the backing beans are in an MVC design with JSF. The most simple answer would be that they are just the Controllers. But that doesn't seem enough.
    Suppose I have an application model, call it Ma, which is just an interface that represents a use case in Java. Ma doesn't know anything about a view or controller, it is just domain logic with application-specific state and behavior added. Now,
    - my backing bean uses Ma as its Model, acting as a true Controller by delegating requests to it
    - my backing bean also adds view-specific state (show/hide stuff and it also returns a List<SelectItem> for example) that I can't put on Ma, so it also acts as a view model Mv
    So, I could argue that I have an Mv-V-C design, where the backing bean is both C and Mv. My user interface V only queries Mv for its state.
    Usually I read that V and C are considered to be very tightly coupled, so then I would have an Ma-V-C design with the backing bean being C and part of V.
    Is it just a question of terminology or point of view, expressing the same idea twice?

    The way I think about it is that there are multiple layers of MVC.This kind of refers to my point-of-view question. So let's try two of them.
    The view itself can be thought of as containing MVC elements.When only looking at JSF (presentation layer) we have:
    - Model: backing beans (view model Mv)
    - View: view root and JSPs (query backing beans for state)
    - Controller: Faces servlet (dispatches requests to backing beans)
    In my "enterprise" quality applications, I will have three distinct layers.Taking a step back, let's look at the application layer (your "control layer", application logic behind interface) and the presentation layer.
    Then:
    - Model: application model Ma in application layer
    - View: backing bean (associated with UI components)
    - Controller: backing bean (dispatches requests to Ma)
    Agree?
    It's interesting that you call my application layer "control layer" since it seems more like a model to me, especiallly when you say:
    The control layer consists of business logic interfaces and their implementations.This said, the objects in this application layer do have some controller functionality as they orchestrate the interactions with the underlying domain model, just llike the backing beans do with the application model. So maybe you can take another step back and consider these application logic interfaces as the View and Controller for the underlying domain model. That is: in a layered MVC design every M can become the VC for an underlying (more general) layer?
    And I have seen this taken to extremes.Perhaps that's what I'm doing here :)

Maybe you are looking for