Table component paging action events?

JSC2's Basic components suppose to replace the Standard components in JSC1. But I found that, while quite powerful the Table component doesn't expose paging action events at all. Is there anyway to be notified when user swtich pages?
Thanks,
Cecilia

The author of the Table component has pointed out that you can call tableRowGroup1.getPage() to find out the page number. So, effectively, you can call that method in preprocess and in prerender and compare the results to determine if the page has changed.

Similar Messages

  • Temparally remove rows from a ADF table by action event of a jsf page.

    Hello Developers,
    I needed to temporally remove rows of a ADF table when execute action event of corresponding page.
    So in this case my task can describe by following steps,
    (1). I created a ADF table using <af:table> on a jsf page.
    (2). The data populated using a VO.
    (3). Several radio buttons added to the page for temporally remove rows from the table.
    This means one radio button check, it responsible to temporally remove rows which contain empty cell values of a identified column.
    If I check another radio button it should temporally remove identified data included rows but above removed (empty cell included rows) rows should appear in this event
    My ultimate target is temporally remove rows of a table & re call again removed rows another event without again & again query from BC.
    Pleas advice me to archive this task very sealy?
    (Are there have a way to do this using EL or coding in Manage bean ?)
    Thanks in advance..!

    Hi,
    the DCIterator gives you an option to iterate over the fetched rows (the ones you see in the table). You can try call removeAndRetain() on these rows. This will not remove or delete rows but allows you to insert these rows back to the collection.
    JavaDocs:
    * Removes the row from the collection and then retain it for insertion
    * into another location.
    * <p>
    * This method differs from <code>{@link #remove()}</code> in that
    * it just removes the row from the collection. It does not
    * remove the underlying Entity row(s) or database row(s).
    * <p>
    * This method also differs from <code>{@link #removeFromCollection()}</code>
    * in that after the row is removed from the collection, it can be inserted
    * back into the collection at another location.
    void removeAndRetain();
    Frank

  • Getting action event of table component inside java script function of anot

    Hello,
    <af:document id="d1" partialTriggers="pt1" theme="dark">
    <f:facet name="metaContainer">
    <af:resource type="javascript"> function handleTableDoubleClick(evt) {
    var table = evt.getSource(); AdfCustomEvent.queue(table, "TableDoubleClickEvent",{},true); evt.cancel();
    function handleRowSelectionClick(evt) {
    var component = evt.getSource();
    AdfCustomEvent.queue(component, "rowSelectionClickEvent",{},true);
    evt.cancel();
    function handleLinkSelection(linkClickEvent){
    var table=AdfPage.PAGE.findComponent("tbl");
    alert("Components:"+table);
    AdfActionEvent.queue(table,true);
    </af:resource>
    </f:facet>
    <af:form id="f1" usesUpload="true">
    <af:pageTemplate id="pt1" viewId="/ESOPM_Base_Template.jspx">
    <f:facet name="main_content">
    <af:panelStretchLayout id="pgl" bottomHeight="0px" inlineStyle="width:auto;">
    <f:facet name="center">
    <af:table varStatus="rowStat" width="auto" value="#{MainContentBean.collectionModel}"
    rows="#{MainContentBean.collectionModel.rowCount}" rowSelection="single" contentDelivery="immediate"
    var="row" rendered="true" id="tbl" >
    <af:clientListener method="handleTableDoubleClick" type="dblClick"/>
    <af:serverListener type="TableDoubleClickEvent" method="#{MainContentBean.HandleDoubleClickTable}"/>
    <af:clientListener method="handleRowSelectionClick" type="click"/>
    <af:serverListener type="rowSelectionClickEvent" method="#{MainContentBean.HandleRowSelection}"/>
    <af:forEach items="#{MainContentBean.columnNames}" var="name">
    <af:column sortable="true" headerText="#{name}" headerClass="TableHeader" sortProperty="#{name}"
    inlineStyle="width:100px;" id="c1">
    <af:panelGroupLayout id="pnl_grCol" halign="center" valign="middle">
    <af:image source="/images/folder.gif" rendered="#{name eq 'Collection Name'}" visible="#{row['Document Type'] eq ''}"
    id="i2"/>
    <af:image source="/images/Computer_File.gif" rendered="#{name eq 'Collection Name'}"
    visible="#{row['Document Type'] eq 'Document' or 'Application'}" id="i3"/>
    <af:outputText value="#{row[name]}" id="aot1" clientComponent="true" >
    <af:clientListener method="handleRowSelectionClick" type="click"/>
    <af:serverListener type="SelectionClickEvent" method="#{MainContentBean.HandleRowSelection}"/>
    </af:outputText>
    </af:panelGroupLayout>
    </af:column>
    </af:forEach>
    </af:table>
    this is my code , In this when i am clicking on rowSelectionEvent its going to bean class i want the same action to be performed on the click of outputText so what can i do for that ,I want to execute same action as performed on table component for single click , on outputText
    Regards
    Mayur Mitkari

    Hi,
    I think there are two solutions to the problem
    1. <af:outputText ... clientComponent="true"
    2. If this doesn't work, replace af:outputText with <af:inputText ... readOnly="true"/>
    Frank

  • How to set fire action event for particular rows in a table

    HI All,
    I have a requirement in which I want to set fire action event for particular rows in a table based on some condition.
    The table has columns like fullname,employee id etc.
    So i want to set fire action event for particulars rows only which will saisfy some condition.

    Atanu,
    Your approach(setting fire action for few rows) seems not possible. Better to go ahead with workaround.
    Do you want this functionality in processRequest(while page loading) or processFromRequest(on some event) method ? Give more explanation regd. your requirement ?
    In either case loop through the rows and when your condition is met write the action to be performed in controller.
    Regards,
    Anand

  • JSF table component with paging

    Are you aware of any existing JSF table component with both navigation and paging ?
    I want to display the content of a database table with a large number of rows. The table component should be able to navigate through the entire table content, but building only a small ResultSet and dinamically populate it with data as we perform navigation.
    Thanks,
    Cosmin

    Thanks for the answer.
    But data scroller just takes a ResultSet and display it with navigation. It doesn't know about the total number of rows in the table. It only display the number of records in the ResultSet.
    What I am looking for is a data scroller which based on some input parameters knows how to split the table in several ResultSets, dinamically change the ResultSet and display the total number of rows in the table and not in the current ResultSet.

  • Row action event on data table does not occur when rows added dynamically

    Row action event on data table does not occur (only refreshes the page) when the rows in the data table are added dynamically at run time using button click and java bean.
    please tell me a way to catch the row click event when adding rows dynamically to data table. i m using RAD 6.0 to develop Faces jsp pages.
    thanks
    amit

    i got the answer

  • Missing Action Event from Custom Component

    Hi JSF Gurus,
    I have two custom components, both extends UICommand and have their
    own renderers. I use them on two seperate pages, say component1 on
    page1 and component2 on page2. And page2 is include inside page2.
    I registered an action listener on component2. When the composite page
    is rendered, I clicked on component2. However, the registered action
    listener was not invoked. Inside the debugging (I'm using IntelliJ
    IDEA 5.0) I set a breakpoint inside the decode method of Renderer2
    (renderer for component2). I do see the componen2 actually as an
    actionLister method binding being set to correct value. I do queue the
    new action event to component2 at the end of the decode method. But
    the action listerner never invoke.
    Any idea what did I miss?
    Thanks,
    Edmond

    Hi Yuki,
    Yeah, after I turn on detail JSF debugging as instructed by the book Core JavaServer Faces, I figured out I had a validation error. That solves the mystery.
    Thanks,
    Edmond

  • Clicking a tree node does not refresh the fields in the table component

    hi all,
    I am using a tree component along with a table component in my page.so whenever i am clicking on a node it should display the relevant information of that node in the table from the database.But whenever i am doing the page is not refreshing and the old values of the textfields in the table still exist.i have written the code to populate the table in a button click event.It is working fine but the same is not working when i am clicking any node in the tree component.Can anyone provide a solution to this problem.
    Thanks and regards,
    Prasant Kumar

    Never mind... I actually found something that works...
    treeModel.nodeStructureChanged(leadSelection);

  • Table component - how to find out which cell is clicked

    Hello!
    I have a couple of questions regarding table component
    1. Is there any way to find out which table cell is clicked on?
    2. And is it possible to paint clicked cell programmatically?
    Possible solution might be a Select Boolean Checkbox inside a cell, but anyway, i'd have to determine which cell contains this checkbox (some kind of cell coordinates, etc...)
    Thank you

    1. Is there any way to find out which table cell is clicked on? It would be easy to suggest the way, if you can share us the requirement
    2. And is it possible to paint clicked cell programmatically?You can do it through javascript by setting contentStyle property.
    Sample Code:
    <af:table ...>
      <af:column>
         <af:inputText ...>
                  <af:clientListener method="paintCurrentCell" type="click"/>
         </af:inputText>
      </af:column>
    </af:table>
    <!-- javascript method -->
    function paintCurrentCell(event){
        event.getSource().setContentStyle("background-color:red");
      }Sireesha
    Edited by: Sireesha Pinninti on Nov 10, 2009 7:01 PM

  • h:CommandLink : Action event not called on the first click

    Hi,
    I am facing a problem here.
    I have a JSF page:
    When I first load the page, I have few text boxes and dropdowns. With out doing anything If I click the <h:commandLink I call an action in my pagecode.
    But the problem is on the very first load of the page, without doing anything if I click on the command link action event in my pagecode is not called, but If I click on the link the second timethe pagecode actionevent is called.
    So I think tried submitting the form in the JSF page onclik of the commandlink it works in my Local IBM RAD. But doesnot work in the WebSphere Portal.
    So can you tell me if I can submit the form atleast once when the page loads for the first time
    This is my command link:
    <tr>
    <td colspan="2" align="center">
    <h:commandLink styleClass="commandLink" id="lnkBtnCreateUser" action="#{pc_Createuser.doLnkBtnCreateUserAction}">
    <hx:graphicImageEx styleClass="graphicImageEx" id="imgBtnCreateUser" value="/theme/images/btnCreateUser.gif" style="border:0;cursor:pointer" onclick="return onFormSubmit();"></hx:graphicImageEx>
    </h:commandLink>
    </td>
    </tr>
    function onFormSubmit(){
    //enabling all the disable components
    So can anybody please help me on this. Why exactly the pageCode action event is not called for the very first click ???

    seems that a prependID="false" attribute in the respective form was causing the trouble. At least it's working now that I've deleted it.
    I introduced it, because last time the component ID's messed up the output of the error/success messages ("j_id:xxx isn't that of a usefull information to the enduser).
    Edited by: stger on Apr 9, 2008 5:41 PM

  • Problem with action events........ :(

    hi all,
    there is a strange problem which me and my colleagues are facing now-a-days......
    For some odd and unknown reason, the links on the page suddenly stops woking... it goes like this....
    we write events (buttons or action links) .... we test them and they are working fine...... than we write some other piece of code and than run the program and links work no more... The program never goes in the action event for the component...... and surprisingly it also dont show an error.... It just keeps on refreshing itself again and again....... (this thing is also verified by using debugger that actions events just stop being called....) it happens for random situations ...... Once i thought that maybe its has to do something with beforeRenderResponse() method... but it happens even in beans without beforeRenderResponse() method.....
    Can anyone tell me whats going on around here???? we are extremely confused here with dead lines approaching fast........
    regards

    I've had this same problem....links were working fine yesterday. I added more functionality which didn't even affect the links, and now they're not working. Unfortunately, I don't have a solution either.
    Has anybody been able to access the logging in the facescontext or application to see what the lifecycle is doing before it stops???

  • Table Component and Row Height

    I am using XCelsius 4.5 and using the table component.  Is there anyway the row height on the table component can be linked to the Excel file?  It is not dynamically changing or wrapping text based on the amount of data that is imported in.

    Judging from the stack trace this has nothing to do with your variable row height. You are simply not respecting some array bounds (maybe your data array for the table model) when you insert the new row.
    In newRouteFare() do you fire a tableRowsInserted event? Or something similar? Check the rows passed into the Event object to see if you are exceeding the limits of the current table model.
    Thomas

  • Problem in deleting row from database in table component

    Hi,
    I have a table component that its content change by diffrent links.
    in this table i have a hyperlink in each row to deleting that row from dataBase.
    so i must get the current row .
    i do it like this:
    define a rowset in the page that have a delete query :
    delete from response where responseID=?
    in action of delete hyperlink ,i have:
    Integer responseId=(Integer)responseDataProvider.
    getValue("#{currentRow.value['responseID']}") ;
    getSessionBean1().getResponseRowSet().setObject(1,responseId);
    getSessionBean1().getResponseRowSet().execute();
    but in first line occure a exception:
    illigalArgument #{currentRow.value['responseID']}
    thanks.

    by using data table
    first you should get current record (row that recived action)
    then delete it by using data provider.
    I do not think that you could execute delete statement using rowSets because they just can provide Select statements.
    btw , following code will retrive clicked row from data table and
    delete that row
    try {
    RowKey rk = getTableRowGroup1().getRowKey();
    if (rk != null) {
    testDataProvider.removeRow(rk);
    testDataProvider.commitChanges();
    } catch (Exception ex) {
    log("ErrorDescription", ex);
    error(ex.getMessage());
    hth
    masoud

  • How to avoid editing a deleted record in a Table component

    Hi! Everyon,
    I am building a prototype using JSC. In Page1.jsp, I have a table displaying the records. On column one there are buttons that allow the user to edit the record, including deleting it. My problem is: when somebody else deleted a record and if the current user tries to edit the same record by clicking the edit button on the corresponding row he will get the next record. Could somebody tell me how to solve this problem? Thanks in advance.
    By the way, I do not access database directly from the Web part. Instead, I dropped a session bean's method on the Table compoment. In the edit button's event handler, I use
               TableRowDataProvider row = (TableRowDataProvider )getBean("currentRow");However, since that record was deleted already I always get the next record.
    With best regards,
    Daniel

    Thank you very much for your help. And sorry for not explaining clearly.
    I have a session bean that has getCities(), getCity(String code) and other methods. getCities() returns an array of CityDO objects and getCity(String) returns a CityDO object. class CityDO basically is a JavaBean containing city code, city name and other information. When I designed the web part using Java Studio Creator, I dropped a Table component to the design view first, then dropped the EJB method getCities() onto that Table component. Up to now, it is very similar to http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/ejb.html and everything worked fine.
    In order to edit a CityDO record, I added a column containg "edit" buttons into the Table component. If the user clicks the edit button we will show the CityDO in another page called editPage.jsp. In editPage.jsp, the user can update the city or simply delete it. Here is the major part of the event handler of the edit button in Page1,
        public String editCity_action() {
            TableRowDataProvider row = (TableRowDataProvider)getBean("currentRow");
            String code = (String)row.getValue("code");     // "code" is a field in CityDO
            CityDO city = null;
            try {
                city = cityClient1.getCity(code);
            } catch (Exception ex) {
                ex.printStackTrace();
                return null;
            getSessionBean1().setCity(city);          // pass the city to editPage
            return "editPage";
        }Usually, the above logic is good. However, if somebody else deleted one city and the current user tries to edit that deleted city (it is still in his table), he gets the next city. The real problem is in editCity_action(),
    row.getValue("code") returns an updated value, but I only need the old one.
    You memtioned ArrayList. That could be a good solution. Suppose I have an ArryList containing the CityDO objects, if I can bind the table to my ArrayList that will solve my problem. Could you tell me how to do the binding in that case?
    Thank you again.
    With best regards,
    Daniel
    By the way, I do not access database directly from
    the Web part. I do not understand what you mean by the above
    statement.
    Instead, I dropped a session bean's
    method on the Table compoment. Can you explain further. What method did you drop on
    the Table component?
    In the edit button's
    event handler, I use
    TableRowDataProvider row =
    (TableRowDataProvider
    )getBean("currentRow");However, since that
    record was deleted already I always get the next
    record.Here is the delete code from
    http://developers.sun.com/prodtech/javatools/jscreator
    /learning/tutorials/2/inserts_updates_deletes.html.
    As is is working on the rowkey in the page bean's
    table, that should not be affected by other users in
    other sessions, the rowkey should not change, even if
    the underlying record has changed.
        public String delete_action() {
    form1.discardSubmittedValues("save");
    try {
    RowKey rk = tableRowGroup1.getRowKey();
    if (rk != null) {
    tripDataProvider.removeRow(rk);
    tripDataProvider.commitChanges();
    tripDataProvider.refresh();}
    (Exception ex) {
    log("ErrorDescription", ex);
    error(ex.getMessage());
    return null;
    }What is the underlying structure for the table's
    data. Is it a row cache from a query? Is it an
    ArrayList?

  • Show return value of a method-call within a column of ADF table component

    Hi,
    I'm currently developing a ADF "Master Form - Detail Table" component, which displays trips of a car in master form, and all related trip-point information in detail table. This detail table contains the following fields within a row :
    - idTripPoint
    - receivedAt
    - speed
    - coordinates
    Everything is displayed well when deploying my app. What I now want to implement is one more column into my detail table, which displays the result of a method-call which gets the coordinates of the corresponding tripPoint and executes a query to find the nearest neighbour to this point. This method afterwards returns a string which contains a textual description for the coordinates (e.g. 10 km south of Hilton Plaza). This method is defined within my SessionBean and also available within the Data Control Palette.
    What I first did, was just to drag the result (String) of my getTripPointDescription(JGeometry) method to a newly created column within my details table, released it there and set the corresponding NDValue for my method. I used the id of my details table table definition in PageDef for that (${bindings.TripstripPointsList.currentRow.dataProvider.coordinates}). I don't know if this is correct.
    When deploying my app, nothing happened, because my method has never been called. So I decided to implement an invokeAction within my PageDef which calls the generated methodAction within PageDef.
    It looks like that now:
    <executables>
    <invokeAction id="callDescription" Binds="getTripPointDescription"
    Refresh="prepareModel"/>
    </executables>
    <bindings>
    <methodAction id="getTripPointDescription"
    InstanceName="TripsEJBFacadeLocal.dataProvider"
    DataControl="TripsEJBFacadeLocal"
    MethodName="getTripPointDescription"
    RequiresUpdateModel="true" Action="999"
    IsViewObjectMethod="false"
    ReturnName="TripsEJBFacadeLocal.methodResults.TripsEJBFacadeLocal_dataProvider_getTripPointDescription_result">
    <NamedData NDName="tripPoint"
    NDValue="${bindings.TripstripPointsList.currentRow.dataProvider.coordinates}"
    NDType="oracle.spatial.geometry.JGeometry"/>
    </methodAction>
    </bindings>
    Now my method is called once for the coordinates of the first row of my detail table and the generated result is entered within each row.
    So how is it possible to get this standard-behaviour (within other application-frameworks) work in ADF? I just want to display a textual description of a coordinate instead of x/y coordinates within my table. And the corresponding method to get this textual description based on the x/y coordinate should be called for each row displayed in my table.
    I currently walked through all ADF-tutorials and blogs I found on the Internet, but every table example I found only displays data of the associated Entity-Bean. And method Action and accessorIterator are only used with command objects.
    Thank you,
    Thomas

    Sorry, I forgot to say which technologies I use:
    - Toplink Essentials JPA for Model layer (EJB 3.0)
    - ADF in View Layer
    I still hope someone can help me finding an answer.
    Bets Regards,
    Thomas

Maybe you are looking for

  • How do I set up family share for 2 iPhones 2 iPads 2 iPods and 1laptop?

    My husband, son, and I cannot figure out how to set up family share. we have 7 devices between the 3 of us. we each have iTunes accounts, but we faked my sons birthday because he is 7. How can I set it up for all of us to share music, photos etc?

  • Unusual problem with NumPad

    I have quite an unusual problem with my iMac and I'm hoping someone has the answer. I will do my best to explain what's going on. I started using a new program called Blender, which is an open source 3D modeling suite. In it, there are hotkeys which

  • AEX-n and AEX-n (Gigabit)

    I screwed up and bought the AEX-n before the Gigabit ethernet was included. However, this is not all bad because I think the additional base station will help with the wireless range. Okay- here's what I'm hoping to accomplish: I have the AEX hooked

  • EventHandler, install/uninstall in succession or not

    Sorry to bother again, but now I have an architectural question regarding Visa event handlers. I like to react to SRQs several times during the life time of my instrument object, everytime in a different manner. Should I install and uninstall an even

  • I can't open  my mail on my mac

    I was trying to "clean up" my mail. Now i can't even open my mail icon on my imac.