Refresh UI shell component

Hi Experts ,
JDEV 11.1.2
for my application i used dynamic UI Shell......
In one of my JSFF page , i need to refresh the UI Component
here follows the code i used ,
private void partiallyRefreshUIComponent(String uid) {
FacesContext fctx = FacesContext.getCurrentInstance();
UIViewRoot viewRoot = fctx.getViewRoot();
UIComponent component = viewRoot.findComponent(uid);
partiallyRefreshUIComponent(component);
private void partiallyRefreshUIComponent(UIComponent component) {
AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
if (component != null) {
adfFacesContext.addPartialTarget(component);
UnFortunately, the above bolded code returns null......is my code wrong?
PMS

RequestContext:
import org.apache.myfaces.trinidad.context.RequestContext;
concerning JSFUtils, check here (add the appropriate import after download):
JSFUtils.java where??
You put this line in your bean or listener, the moment you want to refresh your component...
I wish I could help more
Apostolos
Edited by: apostolosk on Mar 21, 2012 11:14 AM
Edited by: apostolosk on Mar 21, 2012 11:18 AM

Similar Messages

  • Refreshing ADF Query Component after changing some property of a criteria

    Hi All
    Use Case : Refreshing ADF Query Component after changing some property of a criteria attribute.
    I have a query panel with 2 query criteria i.e. FirstName and DepartmentId where in DepartmentId is a drop down. The scenario is like when change the value of DepartmentId to 'Finance' with code value of '100' then my criteria attribute 'Firstaname' should be invisibe(queriable=false).
    Approach: Have overriden the queryOperationListener of adfquery as " queryOperationListener ="#{backingBeanScope.backing_queryLstener.processQueryOperation}" "
    My backing bean method goes as below :
    public void processQueryOperation(QueryOperationEvent queryOperationEvent) {
    // Add event code here...
    if( queryOperationEvent.getOperation().equals(queryOperationEvent.getOperation().CRITERION_UPDATE) ){
    DCBindingContainer bindings = (DCBindingContainer)this.getBindings();
    DCIteratorBinding iter =bindings.findIteratorBinding("EmployeeView1Iterator");
    ViewObjectImpl voimpl = (ViewObjectImpl)iter.getViewObject();
    ViewCriteria vc = voimpl.getViewCriteriaManager().getViewCriteria("EmployeeViewCriteriaDemo");
    Row currRow = vc.first();
    System.out.println("Department :"+currRow.getAttribute("DepartmentId"));
    if( (Integer)currRow.getAttribute("DepartmentId") ==100 ){
    AttributeDef[] attrs = voimpl.getAttributeDefs();
    int attrIndex = voimpl.getAttributeIndexOf("FirstName");
    ViewAttributeDefImpl attrDef = (ViewAttributeDefImpl) attrs[attrIndex];
    attrDef.setQueriable(false);
    // AdfFacesContext.getCurrentInstance().addPartialTarget(getQryId1()); //here i need to refresh the query component which is not happening
    // refreshQueryComponent(getQryId1());
    Everything is happening as expected but the query panel s not get refreshed.When i refresh the whole link/page then i can see the change.
    Please suggest.
    Thanks in adv.
    -Sanjeeb

    Hi,
    can's say anything about the first part of the question as more insight to the implementation would be required. However, have a look at http://www.oracle.com/technetwork/developer-tools/adf/learnmore/83-bidi-synchronization-tree-form-401841.pdf, which may be what you are looking for
    To the second part: You can programmaticallly refresh the tree component from a managed bean. So instead of using the declarative PPR option (or ChangeEventPolicy set to PPR on the iterator binding) you can wire the submit button to the managed bean, perform your validation and if it fails don't refresh teh tree
    The call is
    AdfFacesContext.getCurrentInstance().addPartialTarget(the_tree_instance)
    Frank

  • How to refresh an Image component

    Hi,
    jdev 1.1.1.5
    I have a parent page with a table to show employees and a tab to show detail of employees
    Detail is in a Region and is sharing the same datacontrol with parent page and i don´t have any parameter in task flow.
    Sincronization Parent - Detail works fine using Partialtriggers.
    Detail Region has a button for upload an image and another button to process the image and an Image component(by servlet) to show it.
    Process button call an operation exposed in AM, This method do Insert or Update in IMAGE TABLE.
    The problem is than image is not refreshed until i do full refresh the page.(but only occurs when updating the image, for insert the Image component show the new image)
    I tried this code at end of process button logic but i can't achieve refresh the image.
      public void saveFileUploaded() {
          oper =
              bindings.getOperationBinding("myMethodInAM");
           Map args = operaImatge.getParamsMap();
           args.put("empId", empId);
           args.put("imatgeBlob", createBlobDomain(file));
          oper.execute();
    // try refresh entire region method 1
           AdfFacesContext.getCurrentInstance().addPartialTarget(JSFUtils.findComponentInRoot("r1"));
       // try refresh image component
           AdfFacesContext.getCurrentInstance().addPartialTarget(JSFUtils.findComponentInRoot("imageEmp"));
      //  try refresh region method 2    
           RichRegion region = (RichRegion)JSFUtils.findComponentInRoot("r1");
           region.refresh(JSFUtils.getFacesContext());
      }Any suggestion?
    Thanks in advance
    Edited by: DV on 03-sep-2011 17:36
    Edited by: DV on 04-sep-2011 11:33

    Hi,
    I have updated the use case at first message.
    you wrote
    you have a binding to the component that is holding the image.. and then refresh the container region..
    that would refresh the image inside.
    can you give two cents?
    i just created a binding for image component but
    what must i do?
    Remember
    the button for process image (operation exposed in my AM service) and Image component(by servlet) are in the same .jsff.
    Means the changes occurs in same jsff without interaction with parent page.
    Thanks,
    Edited by: DV on 04-sep-2011 11:43

  • Can't Refresh OutputText/OutputFormatted Component PageTemplate

    Using JDev 11G 11.1.1.4.0
    I have a JSPX page that uses a PageTemplate. I have a <af:outputFormatted> component that will not refresh its value during any PPR as long as the JSPX is using the PageTemplate. The <af:outputFormatted> has partialTriggers enabled to listen for command button action.
    I can update the component value in a backing method and can see the value, but it will not display on the page. When I don't use a PageTemplate it all works as normal/expected.
    I've tried <af:outputText> as well and the same result. Is there a bug with PageTemplate and PPR for <af:outputFormatted> <af:outputText>???
    Thanks.

    Hi,
    a template reference is a naming container, which means that the naming container ID needs to be reflected in the partial triggers property reference. Alternatively you can try :::id-of-text field
    Frank

  • Problem refreshing the Tree Component icons

    Hello,
    I'm using the Tree, adding the nodes dinamically, following the example: http://www.netbeans.org/kb/55/vwp-databasetree.html
    This Tree shows the access permissions from the users, and show a red icon on the itens without permissions and a green icon on the itens with permissions.
    In the nodes, I add an action that change this permissions when the user click.
    If the permission is Ok on the clicked item, the action remove this permission and vice-versa.
    The action is working fine, but the problem is the refresh of the tree after click. The icons stay like before the click. It is refreshed only if I navigate to another page and return after. Then the icons are showed correct.
    In the method that add the nodes, I select the node icons like this:
    if (havePermissionModulo(grupo, modulo)){
    moduloNode.setImageURL(imgPermissaoOk);
    }else{
    moduloNode.setImageURL(imgPermissaoNegada);
    Where imgPermissaoOk and imgPermissaoNegada have the path to the images.
    Sorry by my english :)

    It is hard to tell
    When the user clicks on an icon, is the page submitted to the server and the page redisplaying itself?
    Is the tree's clientSide property cleared (that is, false).
    Is the browser caching the images? What if you hit a Shift-Reload?

  • Dynamic TaskFlow Gets Refreshed on Catching a Contextual Event

    Hi,
    I am using Contextual events in my application. I have 2 task flows in my parent page. One TF is raising an event and the other is catching it. As my catching TF is a dynamic TF, I have specified the event map in it only.
    Everything is working as intended only that my dynamic TF gets refreshed when it catches the event! I do not want that. I want to explicitly refresh any UI component that requires to be refreshed, not the whole TF.
    So is there any specific property of task flows that make it to refresh itself when ever it catches any contextual event?
    Also I have tried 'Refresh="ifNeeded"' and 'RefreshCondition="#{false}"' in my dynamic taskflow specification in the parent page but it does not make any difference.
    Regards,
    Rahul Saxena

    Rahul,
    there is no setting for this. If however the managed bean you setup for handling the dynamic region is in backing bean scope (or request scope) then chances are that the region is refreshed because the bean restes after the request (just assuming here). Yournot giving us much to chew on (no JDeveloper version, no implementation details etc. ) So its hard to provide further ideas. As a last resort, if you have a support contract, you can contact customer support with a test case
    Frank

  • Linking af:selectInputDate component to other Components

    Hello All,
    Can someone offer me any advice here? I have two components on my screen. One is a SelectInputDate component and the other component is a daily schedule component. Here's my problem (bear with me, its not as easy as it first appears). When the user selects the date from the selectInputDate control, I want to call an action on my backing bean which refreshes the Schedule component. Now, I thought I could bind the Action property of the selectInputDate control to my backing Bean method but if you do that, the action to popup the calendar dialog is intercepted so you don't get the popup calendar. How can I make the selection of a date trigger another action method? I've tried the listeners, but they don't perform an action method.
    One solution was to simply add a command button next to the selectInputDate control and make the user first select the date, then press the commandButton; but as you can imagine, this is really ugly.
    It's as if I need a second Action method that I can bind to once the date has been selected, or at least implement in code the call to the Date dialog and then add my action code after it.
    Any help would, as always be greatly appreciated.
    Nigel

    Hi,
    you can use partial page triggers for this
    - open the property inspector for the selectInputDate component
    - give a value to the ID property and set the autoSubmit property to true
    - Select the component to refresh and open the property inspector
    - select the PartialTrigger property and open the dialog [...] button
    - choose the ID of the inputDate component as a value
    This will refresh the component (e.g. table, panel, etc) upon value change
    Frank

  • PPR on custom component

    I have a custom component for calendar. When invoking PPR on the component it refreshes the entire contents of the page and the custom component doesn't work properly after that.
    If I manually do full a page refresh then the component works properly.
    There is a thread with a similar problem was resolved Re: PPR on custom component?
    In above thread the solution was to add below in the custom component class.
    @Override
    protected FacesBean.Type getBeanType()
    return TYPE;
    I do have this code in my custom component class but may be I am missing something else. Does anyone have a suggestion of how to make this work? I'd appreciate your help a lot.

    Yes, I've seen that page on Trinidad. It was helpful, but it seems it was mostly about using PPR, not about building it into a custom component. The one part that did talk about custom components was this, near the end:
    "Finally, if you're implementing a custom component, you aren't extending the Trinidad UIXComponentBase base class or one of its subclasses, and you want to support partialTriggers, you'll need to use addPartialTriggerListeners(). If you deliver events, and you want to support being the target of partialTriggers, you'll need to use partialUpdateNotify(). "
    Then it gives code snippets for each of those. In my case, I am extending UIXComponentBase, and I am including this code, and I know addPartialTriggerListeners gets called, but my component still doesn't get the updated data. If I right-click the page and select Refresh, it redraws correctly, and other components that have partial-triggers on the same component I do, do get the update properly. So I must be missing something.
    Also, where can I get the open source of the components from? I haven't found anywhere to download them from. Can you point me at them?

  • I want to refresh my jsf page on the click of command button.

    Hi all,
    i m using JDEV 11.1.2.1.0
    i have created one jsf page with fragment i want to refresh my whole page on the click of command button which is present in fragment page.Besause i want to refresh some field but those are present in jsf page so i cant apply partial trigger because command button property in fragment page backing bean class and those attribute which i want to refresh its property in other class.
    thanks.
    Rafat

    i didnt get you from your content so i go with subject for giving your answer
    refreshing some of the fields
    BindingContainer bindings = getBindings();
    DCIteratorBinding dciter = (DCIteratorBinding)bindings.get("xIterator");
    ViewObject vo = dciter.getViewObject();
    Row row = vo.getCurrentRow();
    vo.executeQuery();or else drop execute operation as button to execute vo.
    to refresh a page
    partial trigger nice options.
    to performs instant refresh
    af:poll component
    so if you don mine give me some scenario using hrschema i may give a liitle try to my small brain :)

  • ADF Treetable scrolling position resets to top on refresh

    I have a master details page with the following components.
    TreeTable with a Check Box on LHS  and TabbedPannel on RHS.
    So, users can select any row on the LHS and the corresponding details will be displayed on RHS in a new Tab. When user closes the Tab it will clear the Check Box on TreeTable.
    Issue is, when user is at last row of TreeTable when there are more rows (Scroll bar will be at last), and user closes the Tab on RHS side, I will be clearing the checkbox binding and refresh the treetable using PPR to reflect the same.
    This is causing the treetable  scroll bar to be reset to the top. And User lost the old position on needs to scroll down again.
    Can we control the Scroll bar position after PPR refresh (or)
    Can we just clear off the CheckBox selection (only one row) with out refeshing the whole treetable
    Environment:
    JDev Version : 11.1.1.6.2
    Component : ADF TreeTable with TreeModel binding (Not using BC)

    In my case, I am fine with disclosureState items. They do not collapse even after I remove the checkbox selection and refreshing the TreeTable component.
    Only issue is scrollbar is resetting to top.
    I can't use the disclosure event as they can do expandAll , select first compoenent scroll down and close the selection on RHS tab.
    Which will reset the LHS scrolling position to top.

  • Programmtically Setting View Criteria in ADF Query Component

    I have created two view criterias for a View Object and used ADF Query component for searching. User can select any one of the View Criteria from "saved search" in ADF Query component. but i want to set it programmatically based on some business rules. How i can do that?

    No I don't want to set view criteria on search click. Actually I have ADF Query component on my page which is by default disabled. There are also some fields outside the query component on the value of which i enable ADF Query component and wants to set a particular ViewCriteria based on context. All ViewCriterias are defined and listed in "saved search" of ADF Query component but i don't want to allow user to select it but wants to application set it automatically based on context. For it i will be needed to set a particualar ViewCriteria for ADF Query component through code and then refresh ADF Query component to show newly set ViewCriteria. I know how to refresh query component or any other component through code but don't know how to set ViewCriteria on ADF Query component?

  • How to refresh an image's source value

    I have an image component in a page fragment. When the page opens the image's source is set to the URI for a gif
    What I want is to be able to update the URI to another image once a managed bean's property value changes.
    The image component is bound to a managed bean property, pageAnimationImage.
    I'm new to ADF and tried to set the partial trigger when the property value is set and also set the image's clientComponent to true
    AdfFacesContext.getCurrentInstance().addPartialTarget(pageAnimationImage);
    I searched this forum and other blogs but couldn't find anything related.
    I'd really appreciate it if someone has a suggestion or point me to a related case.
    tia

    You can try to bind the component to broader scope e.g. pageFlowScope or applicationScope and see if this works.
    One other thing to try is to search for the component via its id
    // find a jsf component   
    private UIComponent getUIComponent(String name) {
    FacesContext facesCtx = FacesContext.getCurrentInstance();
    return facesCtx.getViewRoot().findComponent(name) ;
    }The method should find the component by its id. If you find it this way use the returned component to set the ppr on it with
    // PPR refresh a jsf component
    UIComponent image = getUIComponent("MyImageID");
    if (image != null)
        AdfFacesContext.getCurrentInstance().addPartialTarget(UIComponent);Timo

  • I need to refresh an application

    i need to refresh an application after an entry to a database
    is made....i know its not the right thing to do but im having
    trouble refreshing a tile component and its working after i refresh
    the whole app but not if just re-instantiate the component. is
    there an easy way to do this or maybe could i just redirect back to
    the app's url??

    i need to refresh an application after an entry to a database
    is made....i know its not the right thing to do but im having
    trouble refreshing a tile component and its working after i refresh
    the whole app but not if just re-instantiate the component. is
    there an easy way to do this or maybe could i just redirect back to
    the app's url??

  • Partial Submit type something for InputDate Component?

    Hi,
    I am using Build JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660. I have an ADF table inside my page fragement. One of the column inside table is of InputDate type. Whenever I am clicking input date my complete page fragment gets initialised or refreshed. I don,t want that because I have a method which is getting executed because of it again and again which is giving problem to me. Is their any Partial Submit type anything for Input Date component to resolve this.
    Regards,
    Vik

    As a tree stamps it's children (nodes) and each node can be different, a tree as such don't partial submit. The node content however can issue a partial submit.
    You can also add an other component as partial trigger target in the node selection listener using
    // PPR refresh a jsf component
    AdfFacesContext.getCurrentInstance().addPartialTarget(UIComponent);Timo

  • ValueChangeListener not refreshing Popup correctly

    I am using JDeveloper 11.1.1.6
    My use case has a screen with an ADF table. From this table the user clicks a button to add a row to the table. A popup form is presented. The primary key for the new row is a field that is formatted based on certain attributes selected by the user. The user will select a value from a selectOneChoice menu. The intention is for the application to then generate and display the primary key value in the popup. The user will then continue to enter the rest of their entries in the popup and then submit the popup to add the row to the DB. The selectOneChoice field in the form is as follows. Note it does include a value change listener and autosubmit:
    <af:selectOneChoice value="#{bindings.Field1.inputValue}"
    label="#{bindings.Field1.label}"
    required="#{bindings.Field1.hints.mandatory}"
    shortDesc="#{bindings.Field1.hints.tooltip}"
    binding="#{backingBeanScope.backing_ui_pages_MyPage_updateDatabase.soc9}"
    id="soc9" autoSubmit="true"
    valueChangeListener="#{backingBeanScope.backing_ui_pages_MyPage_updateDatabase.onField1Change}"
    valuePassThru="true">
    <f:selectItems value="#{bindings.Field1.items}"
    binding="#{backingBeanScope.backing_ui_pages_MyPage_updateDatabase.si9}"
    id="si9"/>
    </af:selectOneChoice>
    The primary key field is updated via a partial trigger. It is defined in the form as follows:
    <af:inputText value="#{bindings.PrimaryKeyField.inputValue}"
    label="#{bindings.PrimaryKeyField.hints.label}"
    required="#{bindings.PrimaryKeyField.hints.mandatory}"
    columns="#{bindings.PrimaryKeyField.hints.displayWidth}"
    maximumLength="#{bindings.PrimaryKeyField.hints.precision}"
    shortDesc="#{bindings.PrimaryKeyField.hints.tooltip}"
    binding="#{backingBeanScope.backing_ui_pages_MyPage_updateDatabase.it4}"
    id="it4" partialTriggers="soc9" readOnly="true">
    <f:validator binding="#{bindings.PrimaryKeyField.validator}"/>
    </af:inputText>
    The code in my backing bean for the value change listener is as follows:
    public void onField1Change(ValueChangeEvent valueChangeEvent) {
    BindingContainer bindings = getBindings();
    DCIteratorBinding dciter =
    (DCIteratorBinding)bindings.get("Container1Iterator");
    ContainerVORowImpl containerDispatchRow =
    (ContainerVORowImpl)dciter.getCurrentRow();
    Integer number =
    (Integer) valueChangeEvent.getNewValue();
    Number field1Number =
    new Number(number.intValue());*/
    String primaryKey1Number = computed value from another method
    containerDispatchRow.setPrimaryKeyField(primaryKey1Number);
    System.out.println("onField1Change() -- Reservation number: " +
    containerDispatchRow.getPrimaryKeyField());
    I am having 2 problems with the above mentioned components.
    First of all the "valueChangeEvent.getNewValue()" is returning the index number of the record selected in the selectOneChoice as opposed to the actual Number value of the row. The selectOneChoice contains a drop down of numbers (which may or may not start at 1).
    The second issue I am having is the primaryKeyField is not correctly displaying when refreshing the popup . My method computes the correct value and the System.out.println correctly displays my value. For some reason when the popup is refreshed instead of displaying my newly computed primaryKeyField, it is displaying the primaryKeyField associated with the first record in the Interator Binding (dciter)

    I use this code to get hte real data in a valueChangeListener
        public void StatusChangedListener(ValueChangeEvent valueChangeEvent)
            BindingContext lBindingContext = BindingContext.getCurrent();
            BindingContainer lBindingContainer = lBindingContext.getCurrentBindingsEntry();
            JUCtrlListBinding list = (JUCtrlListBinding) lBindingContainer.get("Status");
            int newindex = (Integer) valueChangeEvent.getNewValue();
            Object row = list.getDisplayData();  // load the data
            Row lFromList = (Row)list.getValueFromList(newindex);
            Object lAttribute = lFromList.getAttribute("Value");
            String newVal = (String) lAttribute;
            // Work with the value here
        }Next you should add a ppr from inside your valueChangeListener to the PK field as the one from the UI might already be worked on.
    // PPR refresh a jsf component
    AdfFacesContext.getCurrentInstance().addPartialTarget(UIComponent);Timo

Maybe you are looking for

  • How many computers can you Download lightroom on

    Wondering about the number of computer i can download on

  • How to give save as dialog box using servlet?

    hello, i am building one application where i am generatinfreport in excel format. now the file generated is output.xsl. this is in c:\bea\wlserver6.1 directory. now i want to write a servelt get this file from location given above and give user Save

  • Selection of Hierarchy for FS

    Hello there,    I am attempting to run Business Content Query: 0FIGL_VC1_Q0002 which is based on Virtual InfoCube: 0FIGL_VC1   I could successfully run Query: 0FIGL_VC1_Q0001(a separate query on this cube) and did receive the desired results.   Howev

  • Has anyone got AdvancedDataGrid to work in Gumbo?

    This seems like this should be a very common and discussed problem, but I haven't seen any discussions on this. I'm using the attached code to compile on Flex 4 SDK (build 4.0.0.4728). The AdvancedDataGrid shows up with a header and column etc. but n

  • Clarification on Update Rule Enhancement

    Folks, Would appreciate clarification on the following scenario I have an infocube being updated with data from R/3 There are fields in that infocube which needs to be updated with data from a custom table which is maintained in BW To be specific....