REPORT CURRENT ROW

Hi to all,
Sorry for previous post: i've changed approach, i display the details directly in another region.
thanx
Message was edited by:
Marcello Nocito

Hi,
The Apex does have substitution variable ROW_STATUS that is used in the Report template to highlight the current row.
In order to use it you have to modify your Report Source Query and select the value of 'SELECTED' in the column ROW_STATUS
(Just a quick example - say your page is 200 and you set your required item P200_EMPNO to the required value):
SELECT empno, ename ,
CASE WHEN empno = :P200_EMPNO THEN 'SELECTED' ELSE NULL END
as row_status
FROM emp
What happens upon rendering the page is that Report Template replaces all occurences of row_status='SELECTED' with the value defined in Column Template of the Report Template. E.g.
<td class="yourCSSclassSelected" #ALIGNMENT#>#COLUMN_VALUE#</td>
Open you Report Template and under Column Templates specify(if it is not already there):
for Column Template 1 (which will be used for all rows that does not have the SELECTED status)
<td class="yourCSSnotSelected" #ALIGNMENT#>#COLUMN_VALUE#</td>
Column Template 1 Expression
NVL(UPPER('#ROW_STATUS#'),'x') != 'SELECTED'
for Column Template 2 (which will be used for the row that does have the SELECTED status)
<td class="yourCSSclassSelected" #ALIGNMENT#>#COLUMN_VALUE#</td>
Column Template 2 Expression
NVL(UPPER('#ROW_STATUS#'),'x') = 'SELECTED'
You can modify yourCSSclassSelected in your style sheet to create the desired colour etc.
If you are using standard Apex templates it should be already there so just include something like
CASE WHEN empno = :P200_EMPNO THEN 'SELECTED' ELSE NULL END
as row_status
in your Source Query and check that the currently selected record background color is changed in the case empno = :P200_EMPNO
Hope it helps.
Rado

Similar Messages

  • Sql report, How to access current rows 6 columns data

    I have one page having page items & SQL report having 8 columns.
    First column of report is a link for editing.
    on clicking first column, that record gets displayed on page items, which are opn same page.
    Now my problem is i have used link column of report and set 3 page items value on click of link column.\
    But i need to set values for 2 more page items.
    I tried to create computation & process but not working. i am confused about which process point to select & whether onclick page gets submitted or not.
    I tried to write jscript but not succeeded. I dont know how to get current row id in jscript & different column values of current rowid.
    any help.

    Hi,
    Thanks for reply.
    in 5 items, first three are numeric and last two are timestamp fromtime, totime.
    as I mentioned earlier if i interchange 4 & 5 items i.e. now ITEM4 is totime & ITEM5 is fromtime
    and their values. I get value for totime & not for fromtime. all records contain values for all 5 columns. no null.
    So basically their is no problem in value or data, The only problem is whatever sequence is maintained first 4 items get value & 5th item remains blenk.
    Either I type all 5 ITEM NAMES in one Item name-value pair of link or use all three pairs, 5th ITEM remain blank.

  • How to accessing current row report column value in Lov Query?

    Hi,
    which access methods (eg. bind variables, substitutions, ...) for getting the current row report column value can be used in the "Lov Query" property of a report column?
    As what I know of and what I have read on the forum there are no bind variables for the report columns. For the "Link Text" property it seems that the column values exist as substitution strings (#COLUMN_NAME#). But they don't work in the Lov Query. => And would be good because of a hard parse each time the Lov query is executed.
    The following post (Re: Simulating a correlated sub query in lov
    is showing a solution to use package variables for temporary storage of the referenced value, but the only problem with that solution is that if a new record is added with the "Add rows to tabular form" process the package variable still contains the value from the last queried row! Is there a way (variable, APEX package, ...) to determine if the lov query is executed for a new record so that the package can return null?
    I know that I could write the package in a way that the value is immediately cleared when lov_pkg.keyval is called (one time read), but then I would have to create several variables if I'm accessing the value multiple times in the query or in another query => I think an one time read solution would be very obscurely.
    Thanks for your help
    Patrick
    http://inside-apex.blogspot.com

    Hi Patrick,
    I agree that it's a waste to continually use Ajax to go back to the server to get the contents of a dynamic select list.
    There are no bind variables for any row item - but what you do have, as per my previous post, is the value of the data entered by the user in the first row. You can pass this into your application process (using get.add("VARIABLENAME", value)), which can use it to retrieve the correct LOV in your Ajax code - this will give you a "bind variable" that your process can use.
    What you could do, however, is generate hidden select lists on your page - one for each possible LOV list and replace the contents of the new row's select list with the contents of the appropriate hidden select list. This is easy to do with javascript (using innerHTML functions). Obviously, though, the usefulness of this depends on the number and size of the select lists.
    Even if you don't generate them to start with, you can keep a copy of any select lists returned by Ajax in the DOM for use on new rows. So, if you have retrieved a select list, you will have a copy of it in DOM which you can then copy into the new row. If you don't have the list in DOM, use Ajax to get it, store a copy of it and copy it into the new row.
    Which method you use will depend on the number/size of select lists needed. If they are few in number and/or size, I would suggest generating hidden lists. If they are large, use Ajax to get them once, store them and then retrieve them from the DOM when needed.
    There is another thread here where Arie recommends going to the server every time to make sure you get the most up-to-date data for the lists. If you want to follow this advice, for this reason, use get.add("VARIABLENAME", value) to pass the value to your process. If this is not an issue, you can use one of the other methods I outlined above.
    Regards
    Andy

  • Highlight current row on Interactive Report

    What is the best way to highlight (or identify) the current row in an Interactive Report?
    I’ve created an interactive report, based on a custom SQL query, with a link (on the primary key (id)) to give the user the possibility to select a certain record (that will show some additional regions with detail information). How can I identify (highlight, indicator) the selected row in an Interactive Report?
    Many thanks for your help,
    John

    I wanted the same without using jQuery. Roel's example set me on the right track. To ensure keeping my current row highligthing after using the pagination links I've managed to dynamicly modify the pagination link in the IR using javascript, but I have a little (I hope) problem left.
    I've managed to change the pagination link when rendering the page from
    <a h ref="javascript:gReport.navigate.paginate('pgR_min_row=16max_rows=15rows_fetched=15')"></a>to
    <a h ref=javascript:gReport.navigate.paginate('pgR_min_row=16max_rows=15rows_fetched=15');highLight(this)></a>Unfortunatly my added code does not notice the changes made by the gReport.navigate.paginate code. It does only work when I add an alert (); in my highLight code. This alert will force showing the changes made in the DOM-model by gReport, allowing the highLight function to re-exame the DOM-model and change the pagination link.
    Anyone an idea how to overcome this problem ?
    Kind regards,
    Ralph

  • Highligh current row not working for classic report in 4.1

    Hello experts,
    One of our customers is migrating applications from APEX 3.0 to 4.1.
    All their applications use classic reports because interactive reports didn't exist in 3.0.
    The end users of the applications like the row color changing when they hover there mouse over the rows (highlight current row) and they insist on keeping this "functionality" in the applications.
    For some reason, this "functionality" doesn't work anymore after the migration to APEX 4.1.
    I thought it was something theme related so I created a new application with a classic report, tried some APEX built-in themes, and with none of them, I manage to get the highlight current row working.
    For interactive reports it is not an issue.
    Is this an undocumented no-longer-available feature of APEX 4.x or has there changed something which caused this functionality to stop working??
    Regards,
    Bart

    Hi,
    I created a service request for this issue, and the support analyst that helped me confirmed that this is a bug:
    "I have created the bug :
    Bug 13584762 - ROW HIGHLIGHTING NO MORE WORKS IN CLASSIC REPORT IN APEX 4.1
    While working on the problem , I have found the following solution in order to make the Row HighLightng work in APEX 4.1
    In the apex_4_1.min.js (file located in images\javascript ) , Search for :
    function setRowHighlight(a){apex.jQuery("#report_"+a+" .highlight-row").live("hover",function(b)
    and replace "hover" by "mouseover mouseout" :
    After the modification :
    function setRowHighlight(a){apex.jQuery("#report_"+a+" .highlight-row").live("mouseover mouseout",function(b)
    A refresh in the browser may be necessary in order to "reload" the file apex_4_1.min.js"
    I implemented the suggested workaround and this solved the problem!
    HTH,
    Matthias Hoys

  • How do I set an Apex mulri-row reports form value for the specifc current row using Javascript?

    I have a multi-row region based on a table in which I have two particular columns of interest.  The first has an LOV defined for which I have set up a pick-list of codes associated with the item's status as "OK" or having some problem, for which there are a small number of set codes associated.  Most rows will be OK, but when there is a problem, the pick-list will be used.
    When that pick list has been used, there is an optional "comments" column that can be filled in.  I want my screen to dynamically enable/disable a pushbutton that links to the comment based on the code.  This being row-based, the push-button needs enabling or disabling by row, not as a whole "conditional column".  That bit is ok, I think, but I don't know and can't find the syntax for how within the javascript onchange function I set the current row value for a different column to the one that triggered it.
    My header function (that doesn't work) is going to be something like this (where the status column LOV having a value = 6 means "OK").  Note I'm using alert for a debug mechamism.  The $s line is my failed attempt to set he column value, here with a hard-coded string "Changed COMMENTS":
    <script type="text/javascript">
    function doActivateButton(object)
      if(parseInt(object.value)!='6')
        alert('It is not 6!');
        $s('#COMMENTS','Changed COMMENTS','Changed COMMENTS',TRUE);
      else
        alert('It is 6, you know!');
    </script>
    Ideally, I want any existing comments blanked if the user picks "OK" (6) as the new status, whereas for debug above I'm setting the hardcoded debug string.  You will probably also note I realise I haven't properly understood the purpose of the third parameter in the $s API.
    (This is a reports region, by the way.  A detail block, in forms-speak, with a header block above it.)
    Thanks for any assistance.
    Mark

    Sorry, versions are: Apex 4.1 on Oracle RDBMS 11.2.

  • Multi-record report: content LOV depending on value of current row

    I have a multi-record report based on a query.
    For each row in the report it should be possible to choose a value from lov.
    The content of the lov is depending on a field in the current row.
    Later on I will update a record based on the chosen value but that is not the
    issue right now.
    The problem I am facing is that I don't know how to refer in a list to a value
    from the current row.
    For example.
    In the example below it should be possible to choose (from the lov) a best buddy for
    an employee. The buddy should be an other employee working for the same department.
    So in the lov I must refer to the deptno from the current row. How is this possible???
    select empno
    , ename
    , deptno
    , htmldb_item.select_list_from_query
    ( 1
    , empno
    , 'select ename, empno from emp where deptno = #deptno# '
    ) buddy
    from emp

    Hi Scott,
    I've created this application "TestLov" at the site you mentioned.
    Application ID : 800
    Workspace Name : ANUWKSPC
    The first page has an employee report with the solution as suggested by Raju Mattamal in this thread. That query seems to work fine without any errors...(I'm surprised why I'm getting errors on my application with the same query, even though data appears?! Is it to do with some setting?)
    The second page has the report with my actual query. This is throwing errors.
    On the third page I've tried to implement the solution you've suggested in Tips & Tricks section of HTML DB Studio(Simulating a correlated sub-query in report LOVs)
    http://htmldb.oracle.com/pls/otn/f?p=18326:54:2188928890822530056::::P54_ID:1282
    This doesn't seem to work either.
    I'm unable to figure out the problem.
    Pls look into the application and let me know how I shld go abt this.
    Thanks in advance,
    Anu

  • How to get the value of column from previous row to current row?

    Hi All,
    I am facing a critical problem in SQL query (for reporting purpose (COGNOS)). please reply to my query.
    REQUIREMENT: i want to retrive value of a column (this is not a table column, this will be calculated based expression) from previous row to current row.
    EXAMPLE:
    TABLE NAME: i have to join multiple tables. so, i am not mentioning table names here.
    DISPLAY COLUMNS in the report: item, loc, sku, beginval (not table column), endval (not table column, this will calculated based on some expressions), etc. Here, first time the value of BEGINVAL will be taken from some x column name of x table. ENDVAL will calculated based on the expression. For the next row onwards, BEGINVAL will become the value of ENDVAL and the value of ENDVAL will be calculated based on the expression and this expression uses the value of BEGINVAL.
    my report will look like below.
    ITEM LOC SKU BEGINVAL ENDVAL
    1 HYD 1-HYD 10 10+1+2 (13)
    2 HYD 2-HYD 13 13+1+2 (16)
    3 SEC 3-SEC 16 16+1+2 (19)
    4 SEC 4-SEC 19 19+1+2 (22)
    etc....
    in the above output, BEGINVAL and ENDVAL columns are not part of any table. they are alias column names.if you observe intially BEGINVAL will be assigned to some value, but from subsequent rows, BEGINVAL will become the ENDVAL of previous row.
    Please help me on how to write this query?

    Hi, please find the detail description of the problom.
    DDL (table scripts)
    ITEM
    CREATE TABLE ITEM
    ITEM VARCHAR2(50 CHAR) NOT NULL,
    DESCR VARCHAR2(50 CHAR) DEFAULT ' ' NOT NULL,
    UOM           VARCHAR2(50 CHAR)
    SKU
    CREATE TABLE SKU
    ITEM VARCHAR2(50 CHAR) NOT NULL,
    LOC VARCHAR2(50 CHAR) NOT NULL,
    OH float
    SKUPROJSTATIC
    CREATE TABLE SKUPROJSTATIC
    ITEM VARCHAR2(50 CHAR) NOT NULL,
    LOC VARCHAR2(50 CHAR) NOT NULL,
    STARTDATE DATE
    VehicleLoad
    CREATE TABLE VEHICLELOAD
    LOADID VARCHAR2(50 CHAR) NOT NULL,
    DESCR VARCHAR2(50 CHAR) DEFAULT ' ' NOT NULL,
    SHIPDATE DATE DEFAULT TO_DATE('01/01/1970','MM/DD/YYYY') NOT NULL,
    ARRIVDATE      DATE
    VEHICLELOADLINE
    CREATE TABLE VEHICLELOADLINE
    LOADID VARCHAR2(50 CHAR) NOT NULL,
    ITEM VARCHAR2(50 CHAR) NOT NULL,
    QTY float(126)
    DML scripts
    I can't provide the the DML scripts, because its very huge data.
    Main QUERY is below.
    below is the query which i have to write and execute.
    select
    i.item,
    i.descr,
    i.unitsperpallet,
    sp.loc,
    sp.startdate,
    'Crucial_IND',
    LAG (EndBal,1,0) OVER (ORDER BY STARTDATE) BeginBal,
    SP.FCSTCUSTORDERS CustOrders,
    SP.COMMITINTRANSOUT,
    SP.RECARRIV,
    SP.TOTINTRANSIN,
    (BeginBal - sp.FCSTCUSTORDERS - sp.COMMITINTRANSOUT + sp.TOTINTRANSIN ) EndBal,
    'CuttingQty',
    VLL.QTY,
    vl.source,
    vl.arrivdate,
    vl.shipdate,
    vl.loadid,
    s.oh
    from item i, skuprojstatic sp, sku s, VehicleLoad vl, VehicleLoadLine vll
    where sp.item = i.item
    and s.item=i.item
    and sp.item =s.item (+)
    and sp.loc = s.loc (+)
    and vll.item = s.item
    and vll.loadid = vl.loadid
    and to_char(sp.startdate ,'mm/dd/yyyy') = to_char(vl.arrivdate,'mm/dd/yyyy')
    and sp.loc = vl.dest (+)
    order by sp.startdate
    problem description: in the above query, BeginBal and EndBal is what i am looking for. when i execute this query, oracle throwing an error saying that alias names can't be used as expressions. For the first row, the BeginBal should be the value sku.OH and for the subsequent rows, this value will be the previous row value of EndBal.

  • How to print a report without row numbers or grid lines?

    Is there a way to print a Discoverer report without row numbers or grid lines?
    Thank you.
    Blake

    Hi Blake
    You're not doing anything wrong.
    The settings made when you use Tools | Options | Sheet are global settings that are only applied to new workbooks and worksheets going forwards. These have no impact on existing worksheets or even the one you currently have open. This is because Discoverer does not know whether your original worksheets were setup in a certain way deliberately as opposed to inheriting the global settings as they were at that time. What this also means, reading between the lines, is that these settings must then be stored within the worksheet itself, and this is exactly what happens.
    Thus, to edit an existing worksheet's settings you need to open the worksheet, right-click in the sheet and from the popup select either Format Table or Format Crosstab depending upon the type of worksheet you are working with. After making any necessary changes you will need to save or re-save the workbook in order for those settings to be remembered for the next time.
    Best wishes
    Michael

  • Highlight Current Row

    Apex 4.2
    Theme 21
    I am able to highlight current form fields using get focus and lose focus dynamic actions.
    How do I highlight the current row of a tabular form or updateable report.
    I have tried using DA with
    JQuery Selector tr[headers="FEE"] (column in my report)
    Execute Javascript
    $x_RowHighlight(this.triggeringElement,'yellow');
    Any help appreciated
    Gus

    Gus ,
    you can look at my demo ... ( the one you aked for in my other discussion)
    http://apex.oracle.com/pls/apex/f?p=53793
    demo / demo
    when i click on on row of the IR , the text of selected row is set to red .
    i m sure that you can use it to highlight your row .
    Just remember that when you set for example background-color of a cell, the style of the region may hide what you try to change. I m not sure why but if you disable the region class
    your modifications will appears.

  • ROWS BETWEEN 12 PRECEDING AND CURRENT ROW

    I have a report with the last 12 months and for each month, I have to show the sales sum of the last 12 months. For example, for 01/2001, I have to show the sales sum from 01/2000 to 12/2000.
    I have tried this:
    SUM(sales)
    OVER (PARTITION BY product, channel
    ORDER BY month ASC
    ROWS BETWEEN 12 PRECEDING AND CURRENT ROW)
    The problem is: this calculation only considers the data that are in the report.
    For example, if my report shows the data from jan/2001 to dec/2001, then for the first month the calculation result only returns the result of jan/2001, for feb/2001, the result is feb/2001 + jan/2001.
    How can I include the data of the last year in my calculation???

    Hi,
    I couldn't solve my problem using Discoverer Plus functions yet...
    I used this function to return the amount sold last year:
    SUM("Amount Sold SUM 1") OVER(PARTITION BY Products.Prod Name ORDER BY TO_DATE(Times."Calendar Year",'YYYY') RANGE BETWEEN INTERVAL '1' YEAR PRECEDING AND INTERVAL '1' YEAR PRECEDING )
    The result was: it worked perfectly well when I had no condition; so it showed three months (1998, 1999, 2000) and two data points (Amount Sold, Amount Sold Last Year). The "Amount Sold Last Year" was null for 1998, as there aren't data for 1997.
    Then I created a condition to filter the year (Times."Calendar Year" = 1999), because I must show only one year in my report. Then I got the "Amount Sold" with the correct result and the "Amount Sold Last Year" with null values. As I do have data for 1998, the result didn't return the result I expected.
    Am I doing something wrong??

  • Can Highligt current row being changed mid-app?

    I have a table called PREFERENCES which allows users to set their environment to their preferences. One of the things I would like to set is their Highlight Current row Color. I have created an application level item named F101_HIGHLIGHT. On app startup, I read the database value into this global Application item.
    In the report region I have set the highlight current row item to &F101_HIGHLIGHT. . However, I have noticed when the page renders, the page source has &F101_HIGHLIGHT. within quotes as a literal.
    Is there any way to use substitution for this feature?
    Thank you for your kind help.
    --JM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    I have a table called PREFERENCES which allows users to set their environment to their preferences. One of the things I would like to set is their Highlight Current row Color. I have created an application level item named F101_HIGHLIGHT. On app startup, I read the database value into this global Application item.
    In the report region I have set the highlight current row item to &F101_HIGHLIGHT. . However, I have noticed when the page renders, the page source has &F101_HIGHLIGHT. within quotes as a literal.
    Is there any way to use substitution for this feature?
    Thank you for your kind help.
    --JM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • ExportCollectionAction causes current rows values to be copied in the first row of the table

    Greetings experts,
    I use JDev 11.1.2.3
    I'm facing a really strange behavior of the exportCollectionActionListener. I have a table, and for each row of this table, a link, which calls a popUp. This popUp shows the history of this selected record changes (means it displays the data from another table/VO, which keeps the history of the first one) in a table. I have a button which calls the exportCollection for this second table. When i press it, an excel file is generated and downloaded, and that's all fine untill now. If there wasn't any record in this table, and o go back to the first one, pressing the submit button doesn't track any changes. But if there where any records in that history table (always talking about the history of the current row) , get back to the first one and press Submit, than the very first row of the firs table, gets all it's values set as the last row of the second table, as it is copied from one to the other. I have to press Rollback to get it back into normal ( note that the popUp has it's CancelListener invoke a Rollback operation from a backing bean).
    Why is this happening?
    Thanks in advance

    Hi Frank,
    Well, that's it. No code is involved in this process, that's why i'm asking here. The only code invoked in here is that of the CancelListener of the popUp, and i've inserted it because of this problem, but it didn't resolve anything.
    As per other code, i have another button which invokes code to generate and download a Jasper Report, in Pdf format. This has nothing to do with the exportCollection. Different buttons, different beans containing obviously different code. Further more, this behavior doesn't happen when i download the pdf (press the other button)
    As per the popUp, there is just a link in each row of the main table, which has a showPopUpBehavior, which calls this popUp, containing the second table.
    Note: if i download the pdf or do not do any operation with the popUp (i.e. just close it after it is opened) that behavior doesn't occur.
    This is the source of the popUp, i've just removed the columns as it would take too much space in here:
    <af:popup childCreation="deferred" id="p2"
                                              contentDelivery="lazyUncached"
                                              popupCanceledListener="#{popUp.adminPanelCancelListener}">
                                        <af:dialog id="d3" type="none">
                                            <f:facet name="buttonBar">
                                                <af:panelGroupLayout id="pgl7" halign="end" styleClass="AFStretchWidth"
                                                                     layout="horizontal">
                                                    <af:commandLink text="Download Excel" id="cl18">
                                                        <af:exportCollectionActionListener type="excelHTML" exportedId="t3"
                                                                                           filename="User history.xls"
                                                                                           title="User history"/>
                                                    </af:commandLink>
                                                    <af:commandLink text="Download Pdf" id="cl3">
                                                        <af:fileDownloadActionListener method="#{reportBean.downloadUserHistory}"/>
                                                    </af:commandLink>
                                                </af:panelGroupLayout>
                                            </f:facet>
                                            <af:table value="#{bindings.UsersHistory1.collectionModel}" var="row"
                                                      rows="#{bindings.UsersHistory1.rangeSize}"
                                                      emptyText="#{bindings.UsersHistory1.viewable ? 'No data to display.' : 'Access Denied.'}"
                                                      fetchSize="#{bindings.UsersHistory1.rangeSize}" rowBandingInterval="0"
                                                      selectedRowKeys="#{bindings.UsersHistory1.collectionModel.selectedRow}"
                                                      selectionListener="#{bindings.UsersHistory1.collectionModel.makeCurrent}"
                                                      rowSelection="single" id="t3" width="800px"
                                                      columnStretching="column:c10" styleClass="AFStretchWidth">
                                            </af:table>
                                        </af:dialog>
                                    </af:popup>

  • Problem with Current row of a VO???

    I have a Advanced table region in which i add many rows..and i get the data in to it from the lov page (lov mappings).
    for each row i add... i have to set a item in main page table region doing some validations the data i get from lov region.
    with examples..more detailed..
    i have paymentAmount and AllocAmount...i get the payment Amount from LOV...after doing some validation on paymnetAmount i have to set the same value to the AllocAmount.
    ARTransactionLine is the VO which contains the above mentioned attributes....and advanced table i mentioned above is based on this VO.
    for this purpose im using the following code..
    ARTransactionLineVOImpl
    vo=(ARTransactionLineVOImpl)findViewObject("ARTransactionLineVO1");
    ARTransactionLineVORowImpl TransDetailsVORow = (ARTransactionLineVORowImpl)vo.getCurrentRow();
    payment_amount = TransDetailsVORow.getPaymentAmount();/*for this paymentAmount i made a lov mapping..so that currentrow contains the value of paymnetAmount from lov page*/
    if(/* some validation*/){
    TransDetailsVORow.setAllocAmount(payment_amount);
    now when i do this ..for the first row it is working fine...but for the second row it is failing...getCurrentRow() is giving the values of previous row..not the current row...
    first of all what does this getCurrentRow return???
    help me ...n tell me where i was wrong...

    I m sure you have not gone through the tutorials completely.
    ARTransactionLineVOImpl vo =(ARTransactionLineVOImpl)findViewObject("ARTransactionLineVO1");
    ARTransactionLineVORowImpl TransDetailsVORow = (ARTransactionLineVORowImpl)vo.getCurrentRow();
    with this row i am doing the below opeations..
    Number x=TransDetailsVORow.getPaymentAmount();
    /* some validations*/
    TransDetailsVORow.setAllocAmount(x);
    Change to
    ARTransactionLineVOImpl vo =(ARTransactionLineVOImpl)findViewObject("ARTransactionLineVO1");
    ARTransactionLineVORowImpl TransDetailsVORow = (ARTransactionLineVORowImpl)vo.first();
    while (TransDetailsVORow!=null)
    Number x=TransDetailsVORow.getPaymentAmount();
    /* some validations*/
    TransDetailsVORow.setAllocAmount(x);
    TransDetailsVORow = (ARTransactionLineVORowImpl)vo.next();
    Tapash

  • Maintain the current row position of a table after refresh.

    Hi,
    I use a poll to refresh tables continuously. when a table is refreshed, the current referring row is reset.
    To maintain the current row position after a refresh I use the following poll method.
    public void refreshTableT1(PollEvent pollEvent) {
    FacesContext fctx = FacesContext.getCurrentInstance();
    ValueBinding dcb = fctx.getApplication().createValueBinding("#{bindings}");
    DCBindingContainer bindings1 = (DCBindingContainer) dcb.getValue(fctx);
    DCIteratorBinding dciter = bindings1.findIteratorBinding("<VOIterator>");
    if(dciter!=null){
    if(dciter.getCurrentRow()!=null){   
    Key current_row_key = dciter.getCurrentRow().getKey();
    dciter.executeQuery();
    if(current_row_key!=null){
    try{
    dciter.setCurrentRowWithKey(current_row_key.toStringFormat(true));
    }catch(Exception ex) {
    System.out.println("Exception in current_row_key");
    }This works for normal tables well. But when I use it to master-detail tables (pair of tables) it does not.
    At the master-detail tables, before the first data fetch, it works well. if we go below the first data fetch, it sets the current row into another position.
    how can I overcome this...??
    Thanks,
    Dinuka.

    Hi Mr.Frank,
    I have an association in two VOs.
    for example: There are 2 tables called Emp and Dept. Every Department has Employees. so there is an association (both tables have a common column). Master table is the Dept table. when you click on one record of the Dept table Detail table will show the details of the employees belongs to that selected department. That's what I referred as master-detail tables. first one is master table; second one is detail table.
    When the web page loads all the table data is not fetched from the db (it will depend on the fetch size). when we scroll down the table data fetch happens again and again.
    think my data fetch size is 25 rows per time.
    Suppose we use mine poll method and think I have clicked on the 20 ^th^ row of table1(master table). then the table2 will display details belongs to selected department. that is OK even after refresh. that works well.
    when I go to 30 ^th^ row data fetch will happen (my fetch size = 25)
    when I click on the 30 ^th^ row of the table1(master table), table2 will display details belongs to selected department. but after the poll method is called the selected row at the table1 disappears and is set to another position. now the 30 ^th^ row is not in the 30 ^th^ position. but it is the selected row and table2 displays correct details.
    I think you have got the problem now. :D
    Thanks a lot.
    Dinuka.

Maybe you are looking for