Set current record after dataset filter or sort

How do you set the current record as the first record after a
filter or sort? I have multiple dataset filters and sorts on the
page and the current record always remains the first record after
using them. Is there a way to force the current(viewed product,
picture or whatever) to the first record after the Filter has been
completed?

thanks for your help,
I was wanting the latter, "Or were you asking how to make the
first row of the filtered data selected?" After the filter runs I
want the current record set (to be displayed) to the first record
in the filtered data.
I am using the non-destructive filter method filter(), so I
dont have to reload the data to bring the dataset back to original
data, I can provide a reset button or set back to all records
button.
What I am using this for is a Home/Standard Plan Catalog. I
want to filter our plans by square footage, number of bedrooms or
baths, garage size, etc. so initalally it loads the complete
catalog. the user selects the square footage range they want or any
combination of specs and the filter works to narrow the dataset to
the appropriate records. The filter works fine it returns the
correct records from the dataset but after the filter I want the
current (displayed) record to change after the filter, to the first
record in the newly filtered data.
Eventually we are going to have all 200 or so standard plans
we have in the dataset and giving the user the ability to filter by
these specs is the ultimate goal to help our customers make
decisions. The page loads thumbnails of the exterior renderings for
each standard plan. they click the thumbnail and it opens. With 200
or so eventully I will have to page the results of the dataset or
something else eventually, but I will cross that bridge when I get
too it.
here is my filter:
>>>>>>>>
function StartFilterTimerALL(){
if (StartFilterTimerALL.timerID)
clearTimeout(StartFilterTimerALL.timerID);
StartFilterTimerALL.timerID = setTimeout(function() {
StartFilterTimerALL.timerID = null; FilterDataALL(); }, 100);
function FilterDataALL(){
var SqFtVal = document.getElementById("sqft").value;
if (!SqFtVal){
dsStandards.filter(null);
return;
// for each value get the matching records sqftage
if (SqFtVal == 1){
var filterFunc = function(ds, row, rowNumber){
var str = row["sqftage"];
if (str < 1000)
return row;
return null;
dsStandards.filter(filterFunc);
if (SqFtVal == 2){
var filterFunc2 = function(ds, row, rowNumber){
var str = row["sqftage"];
if ((str > 1000) && (str < 1501))
return row;
return null;
dsStandards.filter(filterFunc2);
if (SqFtVal == 3){
var filterFunc3 = function(ds, row, rowNumber){
var str = row["sqftage"];
if ((str > 1500) && (str < 2001))
return row;
return null;
dsStandards.filter(filterFunc3);
if (SqFtVal == 4){
var filterFunc4 = function(ds, row, rowNumber){
var str = row["sqftage"];
if ((str > 2000) && (str < 2501))
return row;
return null;
dsStandards.filter(filterFunc4);
if (SqFtVal == 5){
var filterFunc5 = function(ds, row, rowNumber){
var str = row["sqftage"];
if ((str > 2500))
return row;
return null;
dsStandards.filter(filterFunc5);
thanks Jim

Similar Messages

  • Keeping current record after refreshing iterator (iterator refresh)

    Greetings,
    I'm using the following code to refresh a master iterator, so that when data is saved\edited it is automatically refreshed in the user interface. I'm using BC for the model layer.
    public String commandButton_save_action() {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding =
    bindings.getOperationBinding("Commit");
    OperationBinding operationBinding2 =
    bindings.getOperationBinding("Execute");
    System.out.println("Now @ Global bean ... going to ...");
    operationBinding.execute();
    operationBinding2.execute();
    // It should be a error page
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    // Refresh main view object
    DCBindingContainer bc =
    (DCBindingContainer)FacesContext.getCurrentInstance().getExternalContext().getRe
    questMap().get("bindings");
    FirstCareAppModuleImpl fc =
    (FirstCareAppModuleImpl)bc.findDataControl("FirstCareAppModuleDataControl").getD
    ataProvider();
    ViewObject vo_SitSocProf = fc.findViewObject("EpisodiosMain");
    vo_SitSocProf.executeQuery();
    System.out.println(" All done. Ciao ");
    return "back";
    I just want to refresh data from database and still show the current record. This is always taking me to the first record in the iterator.
    The issue is: How to show the current record after the refresh? If the above
    code is not correct, or not the most adequate, please don't hesitate and tell
    me.
    Thanks.

    You can do this as follow:
    1) In your ApplicationModule (e.g ScottAM) define function:
    public void refreshView(){
    getMainViewObject().executeQuery();
    2) Expose this function to client
    3) In your manage bean define:
    public String commandButton_save_action() {
    String dc = "#{data.ScottAMDataControl.dataProvider}";
    FacesContext ctx = FacesContext.getCurrentInstance();
    ValueBinding vb = ctx.getApplication().createValueBinding(dc);
    ScottAM am = (ScottAM)vb.getValue(ctx);
    am.refreshView()
    return null;
    Note, that this solution will set you on the first row after invoke.

  • Open a SharePoint List item in Modal Pop up in SP 2013 fails after you filter or sort the list

    Sorry for the long post. This has been killing me. I had this script working perfectly fine in SharePoint 2010 (online) and basically i have a source custom list (list A) with a hyperlink column and a Destination List with say title and my name.
    Source List (list A) looks like this with these 2 columns
    Title    Test Link
    A         Link 1
    B         Link 2 
    C         Link 3
    Each of these links link to the actual list item in the destination list, so for example, link 1 is/sites/2013DevSite/Lists/Destination%20List/EditForm.aspx?ID=1
    So basically i want anytime the Link are clicked that point to another list's item to open in a modal dialog and the script below worked perfectly fine in SharePoint 2010 (online)
    <script language="javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
    <script language ="javascript" type="text/javascript">   
    jQuery(document).ready(function() {
    jQuery('a[href*="EditForm.aspx"]').each(function (i, e) {
    // Store the A tag's current href in a variable
    var currentHref = jQuery(e).attr('href');
    jQuery(e).attr({
    'href': 'javascript:void(0);', 
    // Use the stored href as argument for the ShowInModal functions parameter.
    'onclick': 'ShowInModal("' + currentHref + '");'
    function ShowInModal(href) {
    SP.UI.ModalDialog.showModalDialog({title: "Edit Item", url: href});    
    </script>
    All it does is find the href tags for that particular value Editform.aspx and the pop modal works in SP 2010 online. So the site page is designed in such a way there is a content editor web part with the reference to this javascript file and the sharepoint
    list is right beneath it and this worked perfectly opening in modal windows in SP 2010.
    Since migration to 2013, this is what exactly happens
    1.) when you come to the site page, the modal works,
    2.) If you filter or sort on say the Title or Test Link column in Source list (lets say you select the Value A), the script does not fire at all, if i hover over the hyperlink, the who hyperlink is shown and does not open the hyperlink in the modal pop up.
    - This is important because i want to be able to sort on a particular item...
    Could someone please let me know what am i doing wrong and why is this not working when i sort the list. Thanks for all the help.
    Once again i am trying to open a sharepoint list item in Sharepoint 2013 from another list using Jquery

    A ListItem has its own unique row id so in all likelihood, an insert with the same data will result in a new list entry. The Lists Web Service however, has an UpdateListItem method which will take an update request. [refer
    http://msdn.microsoft.com/en-us/library/office/websvclists.lists.updatelistitems(v=office.15).aspx ]
    There is another note in the conference (marked answered) to your List Item Update problem. Probably worth a try too. [refer
    http://social.msdn.microsoft.com/Forums/en-US/bee8f6c6-3259-4764-bafa-6689f5fd6ec9/how-to-update-an-existing-item-in-a-sharepoint-list-using-the-wss-adapter-for-biztalk?forum=biztalkgeneral ]
    Regards.

  • Re: Displaying Current Record After Delete

    Hi all,
    I am using Jdeveloper 11.1.2.3.0
    I have two tables which has parent child relation among the both.
    I dragged the parent table as a adf form on to the .jspx page.
    Now if i am trying to delete fifth record in the parent table it is giving error message like "Table has child record, delete unsuccessful"
    It is fine, but the control going to first record after deletion.
    But i want to display current deleting record on the page if deletion is unsuccessful.
    Can anybody help me to resolve the above one.
    Thanks,
    Syam

    In this code when the bolded if condition fails i want to delete that record. I tried "delete struct1 index sy-tabix" but that record is not deleted.
    I tried "clear  struct1 ". its deletes the current record.
    but in some field its getting zero value & it is appending as a additional record.
    Please help me.
    loop at cdhdr.
    if ( it1-tcode = 'FSS0' or it1-tcode = 'FS00' ).
        w1_saknr = it1-objectid+4(10).
        w_orgid = it1-objectid+14(4).
       loop at it_cdpos  where changenr eq it1-changenr
                      and objectid eq it1-objectid
                       and   objectclas eq it1-objectclas.
       <b>If w_orgid in r_orgid.</b> 
      IF ( it_CDPOS-FNAME = 'XLOEV' AND it_cdpos-value_new eq 'X' ).
         replace struct1-change_ind with 'D' into struct1-change_ind.
                struct1-bukrs = w_orgid.
                struct1-cost = space.
                struct1-plant = space.
                append struct1.
          else.
             struct1-bukrs = w_orgid.
             struct1-change_ind = w_chngid.
             struct1-cost = space.
             struct1-plant = space.
             append struct1.
          endif.
       <b> else</b>.
        <b>delete struct1 index sy-tabix</b>.
      endif.
        append struct1.
           endloop.
    endif.
    endloop.

  • Set current record to uppercase

    Hi,
    How can i set a particular item in the current record to uppercase at runtime.
    Set_item_property is setting the item
    in all the records to uppercase.
    Thanks in advance.
    Phebe

    If you just want the value to be in upper case you can code a trigger to do this for you in when-validate-item or post-change.
    Just do it manually without a builtin .

  • Moving to current record after execute query

    Hi all,
    I have a form where i can list all db jobs which can be start or stop.
    for more details, form is having columns like jobs, current db status, action(start/stop drop down)
    The user will view list of jobs in the screen and he straightly goes to a record and start (submit) the job using drop down for that record.
    once they start/stop the job, execute query will fire to show the current status of the job.
    Now going to my requirement,after execute query, I want to go to the record (job) which user has started the job .
    Currently the cursor will go to first record.
    Is there any oracle 10g AS property where i can get current record , put it in parameter and go to that record after execute query?
    Is there any other way?
    Regards,
    Leonard

    Hello,
    If you are sure the record after query will keep the same position, you can before, store the current record in a number variable with Get_Block_Property( CURRENT_RECORD) built-in, then after query use the Go_Record() with stored number variable in parameter.
    If you think that after re-query the record number can change, you have to loop through your records, then stop navidation while you find the corresponding key.
    Francois

  • ALV grid, prevent return to line 1 column 1 after using filter button

    How can I prevent the ALV grid display from returning to line 1, column 1, after a user has modified the display using the filter or sort button ?  I know this is possible using the is_stable field when control is passed to my ALV code, but when the automatic on-screen buttons are used I can't find a way of controlling how the screen is displayed.

    Max,
    Thanks, the AFTER_USER_COMMAND event allows me access after the filter or sort button has bee npressed, but I am unable to prevent the grid from reverting to column1 line1.  By using the method GET_CURRENT_CELL I can find out the column, but it does not return me the row.   I have tried putting this column id into  SET_CURRENT_CELL_VIA_ID, as suggested by Naimesh above, and calling this from the AFTER_USER_COMMAND method, but it does not effect how the grid displays.    
    Any further advice would be very welcome.

  • How to retain current set of records in advanced table in OAF

    I have an advanced table in a OAF page. Number of records displayed is set to 5. Now, when I have more than 5 records, we can view the next set of records using navigation buttons of the advanced table. One of its column is an image which has "Action Type" as "fireAction" and "Submit" set to "True", which when clicked displays further details about the selected record in a separate region. However, in this process the page is getting refreshed and the table is again displaying the first set of 5 records even if i chose to display details about record in the next set of 5 (i.e after navigating using "Next 5" button of the table).
    Is there any way to retain the current set of records displayed in the advanced table across the page refresh.?
    Thanks
    Nagamanoj

    Solved.
    Somewhere in our code, while populating one of the columns of the table, we were resetting the VO which was causing the issue. Modified that method call to add a parameter to mention from which row should the table be populated.
    Thanks
    Nagamanoj

  • Need to set attribute of current record based on value in next record

    Using Forms 6, I have a form showing a list of records. There can be multiple records with the same ID but having different expiration dates. I need to set attributes to hilite only the record with the latest expiration date. The current list hilites the records with future expiration dates-but we've found that sometimes the subscription is renewed before the old expiration date has been reached, resulting in two records with the same ID having expiration dates in the future.
    I can (and do) sort the records by ID & expiration date so the record with the latest expiration date is always the last one for that ID, so what I want to do is check the next record to see whether or not it has a different ID. If it does then the current record has the latest expiration date & should be hilited. Since I might need to hilite the current record I can't simply navigate to the next record which, from the description I've found, is what the next_record builtin does. Does anybody know how I can check a value in the next record without making it the current record?
    Thanks.

    The database is 10g but I've never heard of the LEAD function before. Now that I've read about it it sounds like I can check the next record using the following:
    LEAD(ID,1,0) OVER (ORDER BY ID ASC) NEXT_ID
    But I'm not sure where to put this. Maybe create a control item & load the value in the POST-QUERY trigger? I'll give this a try but if you have a suggestion I'd be glad to hear it. Thanks. On second thought I don't think selecting the next ID in the POST-QUERY trigger would work as that would require a complete select statement which would start at the top of the list each time, I think.
    Bugger. I can do it in SQL-Plus but I can't see how to incorporate it into the form.
    Edited by: user6931915 on May 18, 2011 11:09 AM

  • How to set current row in table after use tab key on inputText

    Hello all,
    My first post .., I'm newbie in ADF and I will try to explain my problem.
    For the moment we use ADF 11g (11.1.1.4), in a jsff page I have a table with an inputText column.
    On the valueChangeListener of the inputText, I invoke a method in a viewScope bean which call an EJB method, make some services in the EJB on the line modified. After that I refresh the VO and the table (because others values on the line have been modified) and reset the focus on the same inputText modified by the user with javaScript because focus was lost after refresh.
    So far, everything works fine.
    When I use the arrow keys to change the selected row in the table, it's work fine (focus is still in the next or previous inputText), but if user try to use tab key to change the current line, the inputText on the next line have the focus but the current row of the table is not changed (I think it's normal).
    My question : how can I change the current row after tab key pressed in this case ?
    I don't know if it's really clear, not easy to explain, don't hesitate to ask more details.
    Thanks in advance.

    Frank Nimphius wrote:
    Hi,
    My question : how can I change the current row after tab key pressed in this case ?
    Use a client event to listen for the keyboard entry and intercept the tab. The use af:serverListener to call the server to set the rowKey on the table and issue a PPR for the table to re-paint
    See sample 11 on http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html#CodeCornerSamples
    to learn about how to use the client listener and server listener
    FrankHi,
    Thanks a lot for your advices, I used the client and server listener
    I used this code on the method call in order to change the selection after key tab pressed, I don't know if it can be easier, but it works.
              if (LOGGER.isDebugEnabled()) {
              LOGGER.debug("START changeSelectedRow");
              RowKeySet oldRowKeySet = myTable.getSelectedRowKeys(); // get oldRowKeySet
              if (oldRowKeySet == null) {
                   if (LOGGER.isDebugEnabled()) {
                        LOGGER.debug("oldRowKeySet is null");
                   return;
              RowKeySetImpl newRowKeySet = new RowKeySetImpl(); // The new RowKeySet use to change the selectedRow
              DCIteratorBinding bindingIterator = ADFUtils.findIterator(MY_ITERATOR);
              bindingIterator.setRangeSize(-1);
              // set the new index of the current row.
              int index = bindingIterator.getCurrentRowIndexInRange();
              if (index < bindingIterator.getAllRowsInRange().length - 1) {
                   index++;
              bindingIterator.setCurrentRowIndexInRange(index);
              // get the current row after changed the index
              Row currentRow = bindingIterator.getCurrentRow();
              if (currentRow != null) {
                   ArrayList nextLst = new ArrayList(1);
                   nextLst.add(currentRow.getKey());
                   newRowKeySet.add(nextLst);
                   // set the new selectedRow
                   myTable.setSelectedRowKeys(newRowKeySet);
                   SelectionEvent selectionEvent = new SelectionEvent(oldRowKeySet, newRowKeySet, myTable);
                   selectionEvent.queue();
                   AdfFacesContext.getCurrentInstance().addPartialTarget(myTable);
              if (LOGGER.isDebugEnabled()) {
                   LOGGER.debug("END changeSelectedRow");
    Best Regards
    Benjamin

  • Current Record Pointer after ResultSet.DeleteRow()

    I have a question about the position of the Current Record Pointer in a ResultSet after a call to DeleteRow(). I have three records in the ResultSet, and call DeleteRow() while positioned on the first record. If I call moveToCurrentRow() or do not call any routine. It appears I am still pointed at the deleted first row. I can call getString() and get the data from the first row, which has been deleted. If I call next(), I find myself positioned on the third row, not the second row. How do I delete the first row and position myself on the NEW first row?

    Here it is again, this time with some formating.
        private void DeleteButtonActionPerformed(java.awt.event.ActionEvent evt) {
            try {
                int result = JOptionPane.showOptionDialog( PeriodicalMaint.this, "Delete Current Periodical?",
                                                          "Warning", JOptionPane.OK_CANCEL_OPTION,
                                                          JOptionPane.WARNING_MESSAGE, null, null, null);
                if ( result == JOptionPane.OK_OPTION ) {
                    String Periodical = PeriodicalField.getText();
                    deleteAllIssues( Periodical );
                    periodicalsRS.deleteRow();
                    JOptionPane.showMessageDialog(PeriodicalMaint.this,
                                                  "Periodical " + Periodical + " has been Deleted!",
                                                  "Periodical Deleted", JOptionPane.PLAIN_MESSAGE);
                    clearAllFields();
                    disableAllFields();
                    boolean rsEmpty = false;
                    periodicalsRS.moveToCurrentRow();
                    if ( periodicalsRS.isAfterLast() && !periodicalsRS.previous() ) {
                        rsEmpty = true;
                    if ( !rsEmpty ) {
                        populateAllFields();
                        addMode = false;
                        if ( Periodicals.UpdatePriv ) {
                            enableAllFields();
                        IssuesTable.setEditable( false );
                        NameField.requestFocus();
            catch (SQLException sqle) {
                JOptionPane.showMessageDialog( PeriodicalMaint.this, "SQLException: " + sqle.getMessage(),
                                               "Delete Error", JOptionPane.OK_OPTION );
        }

  • How to get the table with no. of records after filter in webdynpro

    Dear Gurus,
    How to get the table with no. of records after filter in webdynpro?
    Thanks in advance.
    Sankar

    Hello Sankar,
    Please explain your requirement clearly so that we can help you easily.
    To get the table records from your context node use method get_static_attributes_table()
    data lo_nd_mynode       type ref to if_wd_context_node. 
    data lt_atrributes_table  type wd_this->elements_mynode. 
    lo_nd_mynode = wd_context->get_child_node( name = wd_this->wdctx_mynode ). 
    lo_nd_mynode->get_static_attributes_table( importing table = lt_atrributes_table ). 
    Note: You should have already defined your context node as a Dictionary Structure.
    BR,
    RAM

  • I lost my iphone4 and replaced it with a 4s. It's been a year since my last sync. Do I set up my phone as "new" or "restore from backup?" Im hoping game center will automatically have a current record of game data...please help or advise.thx

    I lost my iphone4 and replaced it with a 4s. It's been a year since my last sync. Do I set up my phone as "new" or "restore from backup?" Im hoping game center will automatically have a current record of game data...please help or advise.thx

    Restore from backup.

  • Current Record not in Filtered Records

    OK... has anyone written any logic to circumvent this issue.
    I had a filter I applied and the page I was on was outside the
    current filter. What happened is the filter changed the records in
    the set... but it ended up displaying an empty set of rows
    (paging). Had to page back to the rows. I would think we need a
    standard function so if the filter returns less rows than the
    current offset that it would automatically jump back to the first
    set of rows.

    Hi John
    Don't know whether what I learned applies to you situation on
    not; but, I had trouble getting the right detail records after
    doing filtering. (I had to filter out some records in the original
    XML based on a status attribute.). Found the problem in that the
    number of records and the actual records were now different. I had
    to experiment with the ID and the RecordNumber to get the right
    stuff. The code snippit shows this:
    <div id="collsList" spry:region="dsColls">
    <div spry:repeat="dsColls" id="c_{ds_RowNumber}"
    spry:hover="rowHov" onclick="handleCollClick('{ds_RowID}');"
    onmouseover="mOver('{ds_RowNumber}');" onmouseout="mOut();"
    title="click to see listing of available documents in {collName}"
    class="liveColl">{collName}</div>
    </div>
    Usually, I've used ds_RowID as the key value. Althought this
    was needed in some situations with my filtered set, in others I
    needed to use ds_RowNumber. That got me the right stuff for the
    situaion.
    As I said, don't know whether this is similar situation as
    yours, but if so, this might help.
    Good luck
    Keith

  • SSRS Dataset Filter expression query

    I have an SSRS report which has a simple dataset and accepts two date parameters, and filters the results based on a Position parameter. The Position parameter filter is:
    Expression: Position
    Operator: In
    Value: [@Position]
    I have now been told that each position has a few other aliases in the database against the Position column. i.e. For a Position of "Contractor" I now also need to return "Consultant" records, based on the same field. Note, only one Position
    can be selected at a time.
    I imagine I have to update the Value expression above to do something like:
    - When @Position in "Contractor" also return rows where Position is x, y, z (I am happy to hard code these)
    I have about 10 Positions each with one or more aliases - can someone help guide me on how to set up the expression?
    Thanks!

    Thanks Ione.
    Ok - I have set my parameter values in the value box, comma separated
    My dataset filter for the param Operator is set to IN and the value [@Position]
    However where I have multiple values set against a position I do not get any results (there is data in the DB)
    Do I need to do something different when setting the paramter values? i.e. use the expression and then a function to parse the comman separted values
    Or - something in the Filter to make the expression parse the incoming paramter?
    Thanks again

Maybe you are looking for