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

Similar Messages

  • How can I set the value to a session bean from backing bean

    Hi Experts,
    How can I set the value to a session bean from backing bean where I have created getter and setter
    methods for that variable.
    Basically I am using ADFUtils class where I am able to get the value from session bean
    using following expression
    String claimType =
    (String)ADFUtil.invokeEL("#{ClaimValueObj.getClaimType}");
    Thanks
    Gayaz

    Gayaz,
    Wrong Post !!
    Post in JDeveloper and ADF
    Thanks
    --Anil                                                                                                                                                                                                                               

  • How to get and set a session variable from backing bean?

    Hi im using Jdev 11.1.1.2.0 and i need to set and get a session variable from backing Bean.
    Any idea?

    the class :
    package arq.resources;
    import javax.faces.context.FacesContext;
    import javax.servlet.http.HttpSession;
    public class SesionSigef {
    public FacesContext context;
    public HttpSession session;
    public SesionSigef() {
    super();
    context = FacesContext.getCurrentInstance();
    session = (HttpSession)(context.getExternalContext().getSession(true));
    public Object getVariableSesion(String atributo){
    return session.getAttribute(atributo);
    public void setVariableSesion(String atributo,Object valor){
    session.setAttribute(atributo, valor);
    the example of use :
    SesionSigef se = new SesionSigef();
    DatosRec da = new DatosRec();
    da.setDocumentoCip("Aprobar");
    se.setVariableSesion("DatosRec", da);
    thanks
    Joaquin

  • Set label of adf command button from backing bean

    How can we set the label of a command button from a backing bean using EL?
    Is it : <af: commandButton text="#{bindings.email.label}" action.....

    hi,
    create one string and generate accessor for it.
    then in jspx, like this
    text="#{PrintData.label}"
    you can have the label in this way from backing bean.
    private String label;
    public void setLabel(String label)
    this.label = label;
    public String getLabel()
    label = "test";
    return label;
    or else, through binding property of the command button, you can set it in the backing bean.
    hope this is useful for you.

  • Problem while invoking popup from backing bean

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

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

  • Few basic doubts about accessing AM from backing bean class

    Hi ADF experts,
    I have just started working in ADF Faces.I made a sample search page.My page is attached to a managed backing bean. I have attached command button on my page to a custom method in backing bean class.
    So on, click of button this method is called in backing bean.Now, i have few doubts:
    1)How to get values of various UI beans in this event code?
    2)I am accesing AM , in my method with this code:
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext extContext = facesContext.getExternalContext();
    Application app = facesContext.getApplication();
    DCBindingContainer binding = (DCBindingContainer)app.getVariableResolver().resolveVariable(facesContext, "bindings");
    //Accessing AM
    ApplicationModule am = binding.getDataControl().getApplicationModule();
    iS this correct ?
    3) After getting handle of am how to call my custom method in AM Class?there was "invokeMethod" API in application module class in OAF, is there any such method here?
    Please help me.
    --ADF learner.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Thanks for ur response Frank, actually I am from OA Framework back ground.It would be great if help us a little with ur valuble thoughts.
    OA Framework also uses bc4j in model layer of framework. We have a requirement where our existing developers from OA Framework have to move to ADF to make a new application where time lines are quite strict.If this would not be possible we will switch to plain jsp and jdbc,but our tech experts say ADF Faces is the best tech.
    In OA Framework, Application Module is key class for all busiess logic and Controller is used for page navigation. So, I m just trying to find the same similarity , where we write we add all event codes in custom action methods in the backing bean class of page, which we consider equivalent to process form request method in Controller class of OAF.
    But there are two things, I still want to know:
    1)While page render, how to call specific AM methods(like setting where clause of certain VOs)
    2)In action methods, the way i described(I found that in one thread only)to access AM, what is wrong in that?Also, I went through
    http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html
    where coule of examples use similar approach to access AM from backing bean class and call custom methods of AM(Doing various, deletes etc from VOs).
    3)In these methods can we set any property of beans on the page, I am asking because in OAF, generally we use PPR for js alternatives.But all properties of beans cannot be set in post event.
    Thanks and Regards
    --ADF Learner                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Is it recommended to instantiate Model object from Backing Bean

    Wondering what are the best practices in developing JSF,Spring, Hibernate application.
    Appfuse/Equinox example instantiate Model Object i.e. POJO in the Backing bean. Here is the snippet
    UserForm.java (Backing Bean)
    public class UserForm {
    public User user = new User();
    public UserManager mgr;
    // Getter & Setter methods for user & mgr
    //Persistence
    public String save() {
    mgr.saveUser(getUser());
    addMessage("user.saved", getUser().getFullName());
    return "success";
    I undertand the purpose of having UserManager defined in backing bean but wondering why do we need to have Model (i.e. User) defined in backing bean . Is this a best practice?
    Is it recommended to populate model object with data in the backing bean and then call for business methods like mgr.saveUser(getUser());
    Regards
    Bansi

    Here is some more info
    UserForm is a JSF managed bean,
    User is a hibernate mapped POJO, and
    UserManager is manager class in Spring
    I am wondering about perfomance issues i.e. making DB calls from backing bean getters or setters. DB calls can mean a performance hit, and JSF will call the getters and setters multiple times per page request (which means you'll be doing multiple DB calls).

  • Opening new browser window from backing bean

    Is it possible to open new window from backing bean?
    Regards, Simy

    quite sure its not possibleIt is possible !! But a fifferent way of doint it!
    I assume this is what you want ! on click of a button you want to go to the backing bean and come back with the new page on a new window !!
    Do the following! On click of a button, call a javascript method which does the following
    window.open('/jsf/somepage.jsf',.....)In the constructor of the backing bean, do the backend processing and set the fields of teh backing bean. And when the page gets rendered its as good as what you want...

  • How To Customize displaying  of JSP page From Backing Bean

    I would like to customize the displaying of jsp page from backing bean based on user Roles
    For example
    - if the Role is Admin then backing bean should display Admin.jsp
    - if the Role is Guest then backing bean should display Guest.jsp
    Any pointers/suggestions will be highly appreciated
    Regards
    Bansi

    Thanks to all for providing thoughts
    I wanna make it more Dynamic. In the sense
    "Backing Beans should drive the rendering of first jsp page in the application " and not jsp page driving the backing bean or not to put some kind of hard coding in jsp page to see if its admin user then display certain set of UI Components or certain set of other UI components for other users.
    As we have atleast 10 different Roles and there can be Composite Roles i.e. combination of two roles. In this case how does the Backing Bean drives the rendering of jsp page?
    Regards
    Bansi

  • How to reset RichSelectOneChoice in JSF form from backing bean method?

    resetValue() is not working in this case. So any other method to reset from backing bean?

    Did you store the component instance on a bean by selecting a “Binding” property of the “RichSelectOneChoice” component?
    yourPage.jspx:
       <af:selectOneChoice
    binding="#{myBean._selectOneChoice}">
      </af:selectOneChoice>myBean.java:
        private RichSelectOneChoice _selectOneChoice;
        public void set_selectOneChoice(RichSelectOneChoice _selectOneChoice) {
            this._selectOneChoice = _selectOneChoice;
        public RichSelectOneChoice get_selectOneChoice() {
            return _selectOneChoice;
        private void rerenderSelectOneChoice() {
            AdfFacesContext.getCurrentInstance().addPartialTarget(this._selectOneChoice);
    }

  • Popup from backing bean not using facesContext.addMessage()

    I am creating a popup from backing bean as:
    FacesContext facesContext = FacesContext.getCurrentInstance();
    FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, null, "some message");
    facesContext.addMessage();
    I want the code after the popup creation to execute after the user clicks "ok" on the popup. But somehow the code after these lines gets executed first & then the popup appears after the control returns from the backing bean. Looks like the popup creation happens in a completely different thread. Is there a way to show the popup immediately where I want instead of this facesContext.addMessage() method where execution can wait for the user action?

    yeah, you can create a component declarative or popup that shows the message personalized, and call with javascript , see my others posts
    Re: Component Poppup declarative - problems with multiple instances
    this functional now with jdev 11.1.1.3.
    Regards
    joaquin

  • How can i call a taskflow methode from backing bean ??

    Build JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660
    i like to call a Methode (taskflow) from backing bean!
    my bean code :
        public void imageLinkActionListner(ActionEvent actionEvent) {
            String              id      = actionEvent.getComponent().getId();
            int                 linkID  = Integer.parseInt(id.substring(4));
            DCBindingContainer  bc      = (DCBindingContainer)ADFUtils.getBindingContainer();
            DCTaskFlowBinding   tf      = null;
            System.out.println("Region Change...."+id+" INT "+linkID);
            switch (linkID) {
                case LINK_CALENDAR_REGION:
                    tf = (DCTaskFlowBinding)bc.findExecutableBinding("calendartaskflowPage");                   
                break;
                case LINK_MAIL_REGION:
                    tf = (DCTaskFlowBinding)bc.findExecutableBinding("mailtaskflowPage");                   
                break;
              case LINK_ADDRESS_REGION:
                  tf = (DCTaskFlowBinding)bc.findExecutableBinding("addresstaskflowPage");                   
              break;
              case LINK_BLOGS_REGION:
                  tf = (DCTaskFlowBinding)bc.findExecutableBinding("blogstaskflowPage");                   
              break;
              case LINK_MAPS_REGION:
                  tf = (DCTaskFlowBinding)bc.findExecutableBinding("mapstaskflowPage");                   
              break;
            default:
                return;
            if (tf != null){
                uiMainRegion.setRegionModel(tf.getRegionModel());
                uiMainRegion.setValue(tf.getRegionModel());
                tf.getExecutableBindings();
                AdfFacesContext.getCurrentInstance().addPartialTarget(uiMainRegion);
        }i like to call *#{backingBeanScope.mapBean.initMap}*
    my taskflow source
    <?xml version="1.0" encoding="windows-1252" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <task-flow-definition id="map-task-flow">
        <default-activity id="__1">map</default-activity>
        <view id="map">
          <page>/map/map.jsff</page>
        </view>
        <method-call id="initMap">
          <method>#{backingBeanScope.mapBean.initMap}</method>
          <outcome id="__7">
            <fixed-outcome>init</fixed-outcome>
          </outcome>
        </method-call>
        <control-flow-rule id="__2">
          <from-activity-id id="__3">initMap</from-activity-id>
          <control-flow-case id="__5">
            <from-outcome id="__6">init</from-outcome>
            <to-activity-id id="__4">map</to-activity-id>
          </control-flow-case>
        </control-flow-rule>
        <use-page-fragments/>
      </task-flow-definition>
    </adfc-config>

    Hi,
    to call the bean, use the EL in Java and reference #{backingBeanScope.mapBean.initMap} as a method expression. If you try and access the bean directly then chances are that the instance is not available. Using EL from Java always guarantees this
    Frank

  • How to call a Javascript function from backing bean without any event

    Hi,
    Someone knows how to call a Javascript function from backing bean without any event ?
    thanks

    Please review the following thread:
    ADF Faces call javascript
    Luis.

  • Need to Add and Remove Columns of ADF Read Only table from Backing bean

    I have a scenario where I am trying to Populate TransientVO which is shown has a ADF Read Only Table in page.
    I have couple of Check Boxes Based on their selection I am trying to render and hide certain Columns.
    But the Issue which I am facing is only the Column Header seems to change where as the Rows and Values doesnt..
    even If I apply the expression language rendering condition on the outputText inside those columns.. ..
    So I am thinking to add and remove VO Attribute columns to the table from backing bean.
    Need some sample code snippet or a better design to achieve this. Its kind of urgent too...having an aggressive deadline :(
    Please chip in People..
    Thanks in Advance .
    TK

    Table Code..
    <af:table value="#{bindings.InventoryGridTrans.collectionModel}"
                                    var="row"
                                    rows="#{bindings.InventoryGridTrans.rangeSize}"
                                    emptyText="#{bindings.InventoryGridTrans.viewable ? 'No data to display.' : 'Access Denied.'}"
                                    fetchSize="#{bindings.InventoryGridTrans.rangeSize}"
                                    rowBandingInterval="0" id="t4"
                                    partialTriggers="::sbcSales ::sbcUsage ::cb1">
                            <af:column sortProperty="Period" sortable="false"
                                       headerText="#{bindings.InventoryGridTrans.hints.Period.label}"
                                       id="c38">
                              <af:outputText value="#{row.Period}" id="ot33"/>
                            </af:column>
                            <af:column sortProperty="Past12SalesCount"
                                       sortable="false"
                                       headerText="#{bindings.InventoryGridTrans.hints.Past12SalesCount.label}"
                                       id="c29"
                                       rendered="#{backingBeanScope.IndexPageBackingBean.onUsage != true and backingBeanScope.IndexPageBackingBean.onSales == true}">
                              <af:outputText value="#{row.Past12SalesCount}"
                                             id="ot40"
                                             rendered="#{backingBeanScope.IndexPageBackingBean.onUsage != true and backingBeanScope.IndexPageBackingBean.onSales == true}"
                                             visible="#{backingBeanScope.IndexPageBackingBean.onUsage != true and backingBeanScope.IndexPageBackingBean.onSales == true}">
                                <af:convertNumber groupingUsed="false"
                                                  pattern="#{bindings.InventoryGridTrans.hints.Past12SalesCount.format}"/>
                              </af:outputText>
                            </af:column>
                            <af:column sortProperty="Past12UsageCount"
                                       sortable="false"
                                       headerText="#{bindings.InventoryGridTrans.hints.Past12UsageCount.label}"
                                       id="c40"
                                       rendered="#{backingBeanScope.IndexPageBackingBean.onUsage == true and backingBeanScope.IndexPageBackingBean.onSales != true}"
                                       visible="#{backingBeanScope.IndexPageBackingBean.onUsage == true and backingBeanScope.IndexPageBackingBean.onSales != true}">
                              <af:outputText value="#{row.Past12UsageCount}"
                                             id="ot47"
                                             rendered="#{backingBeanScope.IndexPageBackingBean.onUsage == true and backingBeanScope.IndexPageBackingBean.onSales != true}"
                                             visible="#{backingBeanScope.IndexPageBackingBean.onUsage == true and backingBeanScope.IndexPageBackingBean.onSales != true}">
                                <af:convertNumber groupingUsed="false"
                                                  pattern="#{bindings.InventoryGridTrans.hints.Past12UsageCount.format}"/>
                              </af:outputText>
                            </af:column>
                            </af:column>
                    </af:table>

  • How to show popup from backing bean code immediately?

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

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

Maybe you are looking for

  • MacBook Pro running Windows XP with Snow Leopard 10.6.8

    When I got a MacBook Pro in 2006 I gave a small partition to my husband so he could log into his computer at the office. I used Boot Camp and an OEM WIndows XP disk. Everything ran smoothly for 5 years... last week he started having problems with win

  • I want to know before the step of go live?

    hi All, i want to know the step of start the sap project before GO-LIVE what we do in this and what is the the step related this because i m not in configration i am in support deppert. BS, Atul

  • Graphics failure in my G5 iMac

    Today my G5 iMac (serial #QP5160FQPNY) would boot up but the screen is reticulated with no Finder screen detail - screen is a solid color with a small checkerboard pattern throughout. I tried shutting it off, disconnecting all peripherals and the reb

  • How to PL/SQL Function returns type

    Hello, I need to create a function, which is returning a list of ID's, which is stored in a type T_IDs, something like: function search(searchstring in varchar2) return T_IDs I have a little problem with filling the type inside the function body usin

  • I can't get my new MuVo Fm to turn on without being plugged in, HE

    I recently purchased a MuVo FM, I'm pretty sure I've oaded everything correctly. I've put music on it & everything works fine, as long as it's plugged in. Once I unplug it, it won't turn on! Have I done something wrong? Any help would be greatly appr