Refreshing the list.

Hi Friends,
Currently i am working on interactive report.
in this report basically i am getting alv grid as output, if user double clicks any line of this grid it will go for a list in this list i have two pushbuttons save and refresh.
when i press refresh button the list refreshes, but my main issue is if i go back it is one again comming back to list, but fo r me i should get the selection screen.
Can any one suggest.

hi,
MODULE exit_command INPUT.
  IF g_ok_code = 'BACK' OR
    g_ok_code = 'RW' OR
    g_ok_code = 'EXIT'.
    CLEAR :  g_screen_active_9001,
             g_screen_active_9002,
             g_status,
             g_wa_outtab.
    IF sy-dynnr = 9000.
      LEAVE PROGRAM.
    ELSE .
      LEAVE TO SCREEN 0.
    ENDIF.
ENDIF.
ENDMODULE.
You can use this.
hope this helps you.
plz reward if useful.
thanks,
dhanashri.

Similar Messages

  • How to refresh the list of select one choice which is inside a table?

    Hello I am using Jdeveloper Version 11.1.2.1.0.
    The table is a normal table that is made to look like a treeTable.
    For some rows are or can be parents with Parent_vo_group_id = null and other are children with parent_vo_group_id = vo_group_id of the parent...
    If a children changes its parent_vo_group_id to null it can become a parent as well.
    I am having a select one choice inside a table column. The list comes from the same table with column Name:
    <af:table value="#{bindings.VoGroupAdminView2.collectionModel}" var="row"
                                                      rows="#{bindings.VoGroupAdminView2.rangeSize}"
                                                      contentDelivery="immediate"
                                                      visible="#{bindings.VoGroupAdminView2Iterator.currentRow != null}"
                                                      fetchSize="#{bindings.VoGroupAdminView2.rangeSize}"
                                                      partialTriggers="::soc1" styleClass="AFStretchWidth"
                                                      rowBandingInterval="0" editingMode="clickToEdit"
                                                      binding="#{adminGroupManagementBean.groupTable}"
                                                      selectionListener="#{adminGroupManagementBean.groupSelectionListener}"
                                                      rowSelection="single" id="t5">
                                                <af:column sortProperty="#{bindings.VoGroupAdminView2.hints.Name.name}"
                                                           sortable="false" styleClass="columnData"
                                                           headerClass="tableHeader"
                                                           headerText="#{bindings.VoGroupAdminView2.hints.Name.label}"
                                                           id="c1">
                                                    <af:inputText value="#{row.bindings.Name.inputValue}"
                                                                  requiredMessageDetail="Please enter a group name"
                                                                  label="#{bindings.VoGroupAdminView2.hints.Name.label}"
                                                                  required="true" id="it7" immediate="true" autoSubmit="true"
                                                                  columns="#{bindings.VoGroupAdminView2.hints.Name.displayWidth}"
                                                                  maximumLength="#{bindings.VoGroupAdminView2.hints.Name.precision}"
                                                                  shortDesc="#{bindings.VoGroupAdminView2.hints.Name.tooltip}"
                                                                  contentStyle="#{row.ParentVoGroupId eq null? 'font-weight:bold' : 'padding-left:20px'}"
                                                                  valueChangeListener="#{adminGroupManagementBean.groupNameChangeListener}"
                                                                  partialTriggers="soc2">
                                                        <f:validator binding="#{row.bindings.Name.validator}"/>
                                                    </af:inputText>
                                                </af:column>                                   
                                                <af:column sortProperty="#{bindings.VoGroupAdminView2.hints.ParentVoGroupId.name}"
                                                           sortable="false" styleClass="columnData"
                                                           headerClass="tableHeader"
                                                           headerText="#{bindings.VoGroupAdminView2.hints.ParentVoGroupId.label}"
                                                           id="c4">
                                                    <af:selectOneChoice value="#{row.bindings.ParentVoGroupId.inputValue}"
                                                                        label="#{row.bindings.ParentVoGroupId.label}"
                                                                        simple="true" immediate="true"
                                                                        required="#{bindings.VoGroupAdminView2.hints.ParentVoGroupId.mandatory}"
                                                                        shortDesc="#{bindings.VoGroupAdminView2.hints.ParentVoGroupId.tooltip}"
                                                                        id="soc2" autoSubmit="true"
                                                                        unselectedLabel="&lt;null&gt;"
                                                                        valueChangeListener="#{adminGroupManagementBean.parentIdValueChangeListener}"
                                                                        visible="#{row.bindings.ChildrenCount.inputValue eq 0 ? true : false}">
                                                        <f:selectItems binding="#{adminGroupManagementBean.selectOneChoiceList}"
                                                                        value="#{row.bindings.ParentVoGroupId.items}"
                                                                       id="si2"/>
                                                    </af:selectOneChoice>
                                                </af:column>
                                            </af:table> My select one choice uses the same iterator as the table.
    <iterator Binds="VoGroupAdminView2" RangeSize="-1" DataControl="AppModuleDataControl"    id="VoGroupAdminView2Iterator"/>The table uses this view called VoGroupAdminView:
    Select t1.vo_Group_id,     
           t1.name,
           t1.Vehicle_Owner_Id,
           t1.Graphical_Symbol,
           t1.Lm_Comment,
           t1.Parent_Vo_Group_Id ,
           decode (t2.children_count, null, 0, t2.children_count) as children_count
           from
    (SELECT VoGroup.vo_Group_id,     
           VoGroup.name,
           VoGroup.Vehicle_Owner_Id,
           VoGroup.Graphical_Symbol,
           VoGroup.Lm_Comment,
           VoGroup.Parent_Vo_Group_Id
      FROM VO_GROUP VoGroup
    START WITH VoGroup.Parent_Vo_Group_Id IS NULL
    CONNECT BY VoGroup.Parent_Vo_Group_Id = PRIOR VoGroup.Vo_Group_Id
    order SIBLINGS by VoGroup.name) t1,
    (select parent_vo_group_id, count (parent_vo_group_id) as children_count from vo_group
    group by parent_vo_group_id) t2
    where t1.vo_group_id = t2.parent_vo_group_id (+)the ParentVoGroupId attribute has list of values from this view object called VoGroupAdminLov:
    SELECT
        VO_GROUP.NAME,
        VO_GROUP.VEHICLE_OWNER_ID,
        VO_GROUP.PARENT_VO_GROUP_ID,
        VO_GROUP.VO_GROUP_ID
    FROM
        VO_GROUP
    WHERE  VO_GROUP.PARENT_VO_GROUP_ID is null
    and VO_GROUP.VO_GROUP_ID <> ?
    order by  VO_GROUP.NAMEI want to refresh the list of values in the select one choice everytime when i add a new row in the table, delete row in the table or change the value of select one choice component.
    What I have tried:
        public void parentIdValueChangeListener(ValueChangeEvent valueChangeEvent) {
            this.setValueToEL("#{row.bindings.ParentVoGroupId.inputValue}", valueChangeEvent.getNewValue());
            BindingContainer bc = BindingContext.getCurrent().getCurrentBindingsEntry();
            DCIteratorBinding voGroupAdminIterator = (DCIteratorBinding)bc.get("VoGroupAdminView2Iterator");
            Key selectedGroupKey = voGroupAdminIterator.getCurrentRow().getKey();
            AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
            am.getTransaction().postChanges();
            am.getVoGroupAdminView2().executeQuery(); //refresh the table view object;
            am.getVoGroupAdminLov1().executeQuery(); //refresh the list of values view object
            voGroupAdminIterator.invalidateCache();  //remove the cache of the iterator
            voGroupAdminIterator.setCurrentRowWithKey(selectedGroupKey.toStringFormat(true)); // set the selected row again.
            RichSelectOneChoice soc =
                (RichSelectOneChoice)FacesContext.getCurrentInstance().getViewRoot().findComponent(":pt1:t5:soc2");
            AdfFacesContext.getCurrentInstance().addPartialTarget(soc);
            AdfFacesContext.getCurrentInstance().addPartialTarget(this.groupTable);    
        }When i am adding a new row to the table its select one choice list is refreshed but only for the new row. The rest rows have not updated list of values for their select one choice components.
        public String addGroupButtonAction() {
            AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
            ViewObjectImpl voGroupAdminView = am.getVoGroupAdminView2();
            Row newRow = voGroupAdminView.createRow();
             newRow.setNewRowState(Row.STATUS_INITIALIZED);
            voGroupAdminView.insertRowAtRangeIndex(0, newRow);
            am.getTransaction().postChanges();
            return "null";
        }Edited by: 897833 on Mar 19, 2012 9:07 AM

    I made a button to refresh the value of select one choice and it doesn't work yet.
    So I just move one of the
        public String refreshParentIdSOCButtonAction() {
            BindingContainer bc = BindingContext.getCurrent().getCurrentBindingsEntry();
            DCIteratorBinding voGroupAdminIterator = (DCIteratorBinding)bc.get("VoGroupAdminView2Iterator");
            Key selectedGroupKey = voGroupAdminIterator.getCurrentRow().getKey();
            AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
            am.getTransaction().postChanges();
            am.getVoGroupAdminView2().executeQuery();
            am.getVoGroupAdminLov1().executeQuery();
            voGroupAdminIterator.invalidateCache();
            voGroupAdminIterator.setCurrentRowWithKey(selectedGroupKey.toStringFormat(true));
            AdfFacesContext.getCurrentInstance().addPartialTarget(this.parentIdSelectOneChoice);  //refresh the binded SOC as you said
            AdfFacesContext.getCurrentInstance().addPartialTarget(this.parentIdSelectOneChoiceList); //refresh the binded list even
            AdfFacesContext.getCurrentInstance().addPartialTarget(this.groupTable); //refresh the table it is in;
            return null;
        }Edited by: 897833 on Mar 23, 2012 2:58 AM

  • IE does not run "refreshing the list of places" Lesson 12 Adobe Dreamweaver CS5 with PHP

    Hi anyone else experience this.  In lesson 12 everything works as it should until I add the code for refreshing the list of places as well as the list of photos.  Live view works fine, Chrome, Dreamweaver and safari works as well.  However IE 9 does not.  If anyone can explain the cause of this I will be very grateful

    I am sorry to see that you did not receive a reply. I'm having the same problem ... apparently the Adobe Extension Manager only sees the earlier versions of Dreamweaver, and so exits out of the installation.
    If would be great to have the courtesy of a reply from Adobe regarding their extension manager.

  • Selection color disappears after refreshing the list control

    Hi,
    I have two list boxs 'tracklist and racelist' in which we have setted a  selection color. We uesd to refresh the datas in listbox every one  minute. When the cursor is idle over an entry in the Track or Race list  while the data refreshes, thst entry is not displayed until the cursor  is moved.That its rollover color changed to white. How to overcome this.
    Regards,
    Jayagopal.

    Hi,
                 I have applied a fixed selection color only.
    Thanks,
    Jayagopal.

  • Refreshing  the  list  output   upon clicking  a  push button

    Hi All,
       How  do i  refresh the <b>list  output(not ALV)</b>  already  displayed  upon  clicking  a  push -button  under  AT  USER-COMMAND ,if  at   all   it  is  feasible ?
        Any  pointers will be rewarded with points.......
    Regards
    jaman
    Message was edited by:
            ABAP Techie
    Message was edited by:
            ABAP Techie
    Message was edited by:
            ABAP Techie
    Message was edited by:
            ABAP Techie

    Hi,
    Try with the method "refresh_table_display". 
    It has the syntax very similar to creating the table. It has two parameters. In the first one, you can mention if you want to refresh only the data (the icons are not refreshed)
    Regards,
    Bhaskar

  • ADF 10.1.3 Programatically committing changes and refreshing the list page.

    Hello,
    I have a requirement where on list page i select a recrod and than modifies it on next page. I am using different database views for list and update purpose. So when i save the changes, control comes back to REFRESHED list page.
    Pls let me know how can i commit and refresh the changes programatically. I hav added a method on managed bean as part of action binding.
    Thanks
    Manish

    public String beanMethod() {
    //obtain a reference to your bindingcontainer. chances are you have the "bindings" member variable of the mangaged bean and you have the getBindings() function already built by the wizard for you.
    DCBindingContainer bc = (DCBindingContainer)getBindings();
    //Make sure you have the "Commit" action binding on your pageDef. If not ob will return a Null reference. If you have drag and dropped the Commit operation on your ApplicationModule found on the Data Control Pallete on your page, the "Commit" operation should be there on your pageDef
    OperationBinding ob = (OperationBinding)bc.get("Commit");
    ob.execute();
    return "navigationToListPage";
    I think when you go back the listPage, the ADF framework will execute the query automatically.
    When you go to the update page, are you just updating the current row or creating a new row and then filling out the attribute values?

  • Finder doesn't refresh the list of files

    Hello!
    I have a problem in Finder, it has stopped automatically refreshing the content in folders. Earlier I could move/rename/etc files and folders in other applications and the finder would automatically keep my view up to date.
    Now i have to go out and back in to the folder to view the new content.
    What's wrong?

    first, restart the computer. if that does not help reset your finder preferences. delete the file /users/yourusername/library/preferences/com.apple.finder.plist, then control-option-click on finder in the dock and choose "relaunch". see if that helps.

  • How to refresh the list of SCs?

    Hello All,
    Here's what I have done so far.
    -Installed NWDI.
    -Ran the configuration wizard which created MYCOMPONENT, MYPRODUCT and SANDBOX track.
    -When I go to SLD, I see that MYCOMPONENT has 3 "BuildTime" "Dependencies" 1) DI BUILD TOOL 7.0 2) SAP J2EE Engine 7.0 3) SAP JAVA TECH SERVICES 7.0.
    - When I go to my CMS Track, landscape configurator, I see "MYCOMPONENTS" listed in the table of "Developed Software Components"
    - When I go to CMS - Transport Studio - I see the 3 SCAs in the CHECKIN tab and I checked them in and later IMPORTed to Development. Import finished fine.
    Now, my goal is to load the CRM Java Components 7.0, CRM Java Web Components 7.0, SAP Shared Java Components 7.0, SAP Shared Web Java Components 7.0, Tealeaf and CRM IPC Mobile into the SANDBOX track so that I can view the source code of the CRM application through NWDS.
    I have all the SCAs downloaded. I imagine I should go to SLD, Components and add the above "new" dependencies to MYCOMPONENT. When I try to do that now, I get a screen where I have to search for the components and when I search for "shared", I get search results showing version 5.0 of the Shared components, even though I have copied them onto the inbox folder folder (I only see the older three SCs in the track Checkin and not the newly downloaded ones).
    As you know I downloaded version 7.0. But How can I load them up so that the list shows the newly downloaded ones?
    Please help!
    Kiran

    Satya,
    Thanks for answering.
    I guess my question is two folds -
    1) How do I make the newly downloaded (now on my desktop) SCAs to appear in the SLD > Components so I can add them as dependencies for MYCOMPONENT.
    After downloading the SCAs, what do I do with them? I probably should upload them somewhere? or copy them to some area so SLD is aware? something else, may SDM?
    At this point, when I go to SLD > Components > pick MYCOMPONENT and try to add dependencies, I see a lot of CRM stuff in the search table - but not 7.0.
    2) If I can accomplish the above task, I am sure as per the note you mentioned, they would appear under CMS > Transport Studio > CheckIn tab.
    I hope I am clear in explaining what I am looking for.
    Thank you Satya.
    Kiran

  • How do I use one drop down list to refresh the list in another drop down?

    I am using a drop down list full of years (i.e. 2008, 2009..etc). When I make my selection from this drop down list (say for instance I select 2009) I want it to update the available data in the second drop down list. I have the query statement set up within the JSP page but it needs to be a dynamic SQL statement based off the value I selected in the first drop down.
    String sql = "SELECT GameId, GameDescription FROM Games WHERE Year = " + year;
    The variable "year" is the value I need to figure out how to assign. Now this variable is a Java variable (attribute) and Im unsure how to get the value from the previous drop down and assign it to that. Basically I need the JavaScript value from the first drop down assigned to the Java attribute "year".
    Anyone able to help me with this???
    Thanks,
    Jed

    Here are my two drop down lists. As you can see I build the second list dynamically based off the value of the year. I want to be able to assign my year to the value I select in this first drop down. How do I do that?? I only want to show games for the year I select. I currently have the year hardcoded to "2009" as you see below. How can i change that to be assigned to the JavaScript value i extract from the first select box?
    <select name="season">
    <option value='2009' selected>2009</option>
    <option value='2008'>2008</option>
    </select>
    <select name="gameselect">
    <%
    try
    String year = "2009";
    String connectionURL = "jdbc:mysql://localhost:3306/ElmwoodExpos";
    Class.forName("com.mysql.jdbc.Driver");
    Connection con = DriverManager.getConnection(connectionURL, "root", "thejedster");
    String sql = "SELECT GameId, GameDescription FROM Games WHERE Year = " + year;
    Statement s = con.createStatement();
    s.executeQuery(sql);
    ResultSet rs = s.getResultSet();
    while(rs.next())
    %>
    <option value="1"><% out.print(rs.getString("GameDescription"));%></option>
    <%
    catch(Exception e)
    %>
    </select>
    Thanks,
    Jed

  • Refresh the drop down list after update the table

    I have tab with three pages in each page one data block. I have table with primary key of combination of the other tables foreign key. I am populating the combination of foreign key in dorp down list. In the when-new-form-instance trigger I populate the two lists, work fine. But if I add a new record in the other tables and I need this one to display in the list. I am trying to execute the same procedure which is populate the list
    First time I get this error. FRM-41337. How can refresh the list to display the new record as well.
    Thanks in advance
    null

    Hellow Tamer
    What you wanna do is to display the element entered in the List after you have added it manualy.
    I think you must re-populate the Recordgroup
    again.
    The Procedure you used to populate the RecordGroup in the When-new-Form-Instance,
    must include the statement:
    DELETE_GROUP()
    like This:
    PROCEDURE Populate_The_List(list_id ITEM, sql_stat VARCHAR2) IS
    group_id RecordGroup;
    outcome NUMBER;
    BEGIN
    --Create temporary record group.
    group_id := CREATE_GROUP_FROM_QUERY('List_Elements', sql_stat);
    IF ID_NULL(group_id) THEN
    MESSAGE('Record Group could not be created in Populate_the_List.');
    RAISE FORM_TRIGGER_FAILURE;
    END IF;
    --Populate record group.
    outcome := POPULATE_GROUP(group_id);
    IF outcome <> 0 THEN
    MESSAGE('Record Group could not be populated in Populate_the_List.');
    RAISE FORM_TRIGGER_FAILURE;
    END IF;
    --Populate list item
    POPULATE_LIST(list_id, group_id);
    --Destroy the temporary record group to release resources
    DELETE_GROUP(group_id);
    EXCEPTION
    WHEN OTHERS THEN
    MESSAGE('Internal error occurred in Populate_the_List.');
    RAISE FORM_TRIGGER_FAILURE;
    END Populate_the_List;
    SQL_STAT refers to the SQL statement used further to populate the List.
    Hope this Helps
    Regards
    Tariq

  • How to refresh the updated R/3 Hierarchy in BW

    Hi Guys,
    Could you please let me know the generic procedure about updating the R/3 hierarchy in BW?
    Regards,
    Sagar

    Dear Fellas,
    I am still stuck on the issue which i have asked below. Let me reitirate the issue that I am facing.
    There are 4 hierarchies on 0COSTELMNT infoobject. I am trying to load one of the hierarchy (ex:XYZ), this hierarchy is maintained on the R/3 side and i could clearly see it being maintined under transaction KAH3.
    Now when i try to load it to BW by creating an IP the hierarchy XYZ doesn show in the Hierarchy selection tab of the IP. I tried the option of refreshing the list of available hierarchies on the R/3 side also. even then the required hierarchy is is not showing.
    Please help.
    Regards,
    Sagar

  • Refresh a list when a mxml is opened

    Hi all,
    I have two mxml. In the first, i've a datagrid that is correctly populated and it has some headercolumns (for example: name).
    In the second mxml, I want to show the user all the names  in the datagrid.
    To show the names I use a list. That list is populated when the mxml creation is completed (event 'creationCompleted'). The problem is when the datagrid change so the new names are not shown to user.
    Is there any way, event or similar wich I can refresh the list when the second mxml is opened?
    Thanks in advance!

    Hi, thanks for your answers!
    DataBinding is very "hard" for my app because I really haved lot of mxml.
    I tried to use dataChange property but nothing happens.
    This is my actual code:
          Datagrid in main.mxml
    <comp:ColoredDataGrid id="dg_events" width="100%" height="100%"
                             dataProvider="{eventList.eventCollection}"
                             rowColorFunction="getRowColor"
                             dataChange="dataChangeDg()">
                             <comp:columns>
                                  <mx:DataGridColumn headerText="Nombre de evento" width="150"
                                       dataField="name"/>
                                  <mx:DataGridColumn headerText="ID" width="40"
                                       dataField="eventId"/>
                                  <mx:DataGridColumn headerText="Propietario" width="120"
                                       dataField="owner"/>
                                  <mx:DataGridColumn headerText="Fecha" width="70"
                                       dataField="date"/>
                                  <mx:DataGridColumn headerText="Hora" width="55"
                                       dataField="time"/>
                                  <!-- <mx:DataGridColumn headerText="N. Parámetros" width="100"
                                       dataField="numParams"/> -->
                                  <mx:DataGridColumn headerText="Parámetros"
                                       labelFunction="eventList.getParams"/>
                                  <!--<mx:DataGridColumn headerText="Archivo" width="40"
                                       dataField="numFile"/>-->
                             </comp:columns>
                        </comp:ColoredDataGrid>
    And now filterParam.mxml (this is where I want to refresh the list). I paste a bit of code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:comp="comp.*"
               creationComplete="load()"
               dataChange="load()">
              //Activamos panel de filtrado por parámetros y cargamos valores                    
              public function load():void{
                   panel.percentHeight = 100;                              //Ajustamos tamaño
                   eventsArr = new Array();
                   eventsArr = eventList.categories_events();          //Obtenemos listado de eventos
                   eventsArr.push('---Todos---');                         //Añadimos etiqueta todos para el filtrador
                   eventsArr.sort(1);                                        //Organizamos alfabéticamente
                   owners = eventList.categories_owners();               //Obtenemos objetos propietarios
                   owners.push('---Todos---');
                   owners.sort(1);
                   categories = eventList.categories_params();          //Obtenemos todos los parametros
                   categories.sort(1);
                   matchFilter = new MatchFilter(dg);                    //Herramientas de filtrado
    <mx:VBox>                    
                                  <mx:List id="nameList" dataProvider="{eventsArr}" width="200" height="200"
                                        doubleClick="nameEv = nameList.selectedItem.toString();"/>
                                  <mx:HBox width="100%">
                                       <mx:Spacer width="100%"/>
                                       <mx:Image source="@Embed('/assets/images/system/add.png')" click="addEvent()"
                                                     toolTip="Bla bla bla bla"/>     
                                  </mx:HBox>                              
                             </mx:VBox>
    Thanks for your answers!

  • JPA -- Best way to refresh a List association?

    Hi,
    I need to refresh a OneToMany association.
    For example, I have two entities: Header & Detail.
    @Entity
    @Table(name="HEADERS")
    public class Header implements Serializable {
        @OneToMany(mappedBy="header")
        private List<Detail> details;
    @Entity
    @Table(name="DETAILS")
    public class Detail implements Serializable {
        @ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="HDR_ID", referencedColumnName="HDR_ID")
        private Header header;
    }So, I fetch the Header along with all its Details.
    At a later point of time, I know that some Detail rows in the database have been changed behind my back. I need to re-fetch the list of Details. What should I do?
    1. I could add a cascade parameter to the @OneToMany association. I could specify:
    @OneToMany(mappedBy="header", cascade={CascadeType.REFRESH})Then I could run:
    entityManager.refresh(header);The trouble is that, since all the Details are already in the cache, the cached entities will be returned, not the ones fetched from the database. So, I won't refresh a thing. A query will be sent to the database indeed, but I will get the cached (i.e. stale) entities. I don't know of a way to specify something like
    setHint(TopLinkQueryHints.REFRESH, HintValues.TRUE)dynamically for associations, so that the values in the cache would be replaced with the ones fetched from the database.
    2. I could try to turn off the caching for the while Entity class. The trouble is that for some reason this doesn't work (see my other question here JPA -- How can I turn off the caching for an entity? Besides, even if it worked, I don't want to turn off the caching in general. I simply want to refresh the list sometimes.
    Could anyone tell me what's the best way to refresh the association?
    Best regards,
    Bisser

    Hi Chris,
    First, let me thank you that you take the time to answer my questions. I really appreciate that. I wish to apologize for my late reply but I wasn't around the PC for a while.
    TopLink doesn't refresh an entity based on a view. I will try to explain in more detail. I hope you'll have patience with me because this might be a bit longer even than my previous post. I will oversimplify my actual business case.
    Let's assume we have two tables and a view:
    create table MASTERS
      (id number(18) not null primary key,
       master_name varchar2(50));
    create table DETAILS
      (id number(18) not null primary key,
       master_id number(18) not null,   -- FK to MASTER.ID
       price number(7,2));
    create view DETAILS_VW as
      select id, master_id, price
      from details;Of course, in real life the view is useful and actually peforms complex aggregate calculations on the details. But at the moment I wish to keep things as simple as possible.
    So, I create Entities for the tables and the view. Here are the entities for MASTERS and DETAILS_VW, only the essential stuff (w/o getters, setters, sequence info, etc.):
    @Entity
    @Table(name="MASTERS")
    public class Master {
         @Id
         @Column(name="ID", nullable=false)
         private Long id;
         @Column(name="MASTER_NAME")
         private String masterName;
         @OneToMany(mappedBy="master", fetch=FetchType.LAZY, cascade=CascadeType.REFRESH)
         private List<DetailVw> detailsVw;
    @Entity
    @Table(name="DETAILS_VW")
    public class DetailVw {
         @Id
         @Column(name="ID")
         private Long id;
         @ManyToOne(fetch=FetchType.LAZY)
         @JoinColumn(name="MASTER_ID", referencedColumnName="ID")
         private Master master;
         @Column(name="PRICE")
         private Double price;
    }So, now we have the tables and the entities. Let's assume one master row and two detail rows exist:
    MASTER:  ID=1, MASTER_NAME='Master #1'
    DETAIL:  ID=1, MASTER_ID=1, PRICE=3
    DETAIL:  ID=2, MASTER_ID=1, PRICE=8And now let's run the following code:
    // List the initial state
    Master master = em.find(Master.class, 1L);
    List<DetailVw> detailsVw = master.getDetailsVw();
    for (DetailVw dv : detailsVw) {
         System.out.println(dv);
    // Modify a detail
    EntityTransaction tx = em.getTransaction();
    tx.begin();
    Detail d = em.find(Detail.class, 2L);
    d.setPrice(1);
    tx.commit();
    // Refresh
    System.out.println("----------------------------------------");
    em.refresh(master);
    // List the state AFTER the update
    detailsVw = master.getDetailsVw();
    for (DetailVw dv : detailsVw) {
         System.out.println(dv);
    }And here are some excerpts from the console (only the essentials):
    DetailVw: id=1, price=3
    DetailVw: id=2, price=8
    UPDATE DETAILS SET PRICE = ? WHERE (ID = ?)
         bind => [1, 2]
    SELECT ID, MASTER_NAME FROM MASTERS WHERE (ID = ?)
         bind => [1]
    SELECT ID, PRICE, MASTER_ID FROM DETAILS_VW WHERE (MASTER_ID = ?)
         bind => [1]
    DetailVw: id=1, price=3
    DetailVw: id=2, price=8You see, the UPDATE statement changes the DETAILS row. The price was 8, but was changed to 1. I checked the database. It was indeed changed to 1.
    Furthermore, due to the refresh operation, a query was run on the view. But as you can see from the console output, the results of the query were completely ignored. The price was 8, and continued to be 8 even after the refresh. I assume it was because of the cache. If I run an explicit query on DETAILS_VW with the hint:
    q.setHint(TopLinkQueryHints.REFRESH, HintValues.TRUE);then I see the real updated values. But if I only refresh with em.refresh(master), then the DetailVw entities do not get refreshed, even though a query against the database is run. I have tested this both in JavaSE and in OC4J. The results are the same.
    An explicit refresh on a particular DetailVw entity works, though:
    DetailVw dvw = em.find(DetailVw.class, 2L);
    em.refresh(dvw);
    System.out.println(dvw);Then the console says:
    DetailVw: id=2, price=1So, the price is indeed 1, not 8.
    If you can explain that to me, I will be really thankful!
    Best regards,
    Bisser

  • NSArrayController and refreshing the associated TableView

    Hello,
    I'm a Cocoa rank newbie and I'm probably trying to do something too complicated for my current abilities but here goes. I've been using Hillegass' book and am building an App that uses the NSArrayController to manage an NSTableView. I can add and delete objects and all that stuff. My problem comes when the data in the objects that are bound to the TableView changes "behind the Controller's back". The values in the objects are clock-based and I need to cause the TableView to refresh it's view of the bound data every second. I have scoured the web for how to cause a refresh and the answer seems to be either use the KVO method (which I can't really do (I think) because I'm not changing the data) or "send a -fetch" to the ArrayController.
    Sending the fetch seems like what I want to do but I can't find any information on how to do it. In the end, I don't really understand how to get a reference to the ArrayController object sitting in the Doc window that has all the bindings. I basically don't understand any of the objects in the Doc window. I dutifully drag them in and make connections to them but I don't really understand why.
    Any help on refreshing the NSArrayController would be much appreciated.
    Tom

    OK, incase anyone else is struggling with this, I got this working. From various posting, it seemed that I needed to create an IBOutlet and connect it to my ArrayController. I was having a tough time getting my head around that since all I'd ever done till now was connect IBOutlets to visual things such as TextFields. I finally found a hint that said I needed to connect the outlet from File's Owner to the ArrayController. So, I created an IBOutlet in my myDocument file;
    @interface MyDocument : NSDocument
    NSMutableArray *myObject;
    IBOutlet NSArrayController *arController;
    Then, in IB, I right-clicked File's Owner and dragged from the arController Outlet to the ArrayController object in the Doc window.
    Then, in myDocument.m, in the place that I wanted to refresh the list, I did this;
    (bracket)arController rearrangeObjects(bracket);
    (how do you post code snippets in these forums without it being "interpreted"?)
    Simple enough now that I've done it but it took me awhile to connect the dots.
    Anyway, I hope this helps someone else in the same boat.

  • Refresh custom list.

    Hi,
    I have a PriorityQueue-class that extends ArrayCollection which contains a bunch of Task-objects. The priority is checked from timeLeft(), the method converts _date to seconds.
    I also got an ItemRenderer-class that extends UIComponent and contains a few labels. One label is: timeLeftLabel.text = data.timeLeft() + " left";
    The thing is that I want to refresh the list every 5 seconds or so, this can be done by using a Timer and then call PriQueue.refresh(), this seems to be the wrong approach since I don't want to refresh the whole list and since im using an ArrayCollection as a data provider, it should work - right?
    Thanks!

    You may also want to post your question to the Flex forum:
    http://forums.adobe.com/community/flex/flex_general_discussion

Maybe you are looking for