How to obtain the row data in the component datatable?

if I want to edit a row data, and then know which row is edited in the component datatable, and how to do?
How to obtain the row data in the component datatable, and update it to database, not simplely edit a simple table
Any ideas? Thanks

Thank you very much for your help Alexander !
It's quite confusing when you leave Struts and try to adapt your projects for JSF for the first time...
I wanted to click on a row with a "onMouseClick" on the TR tag like I used to do in Struts/JSTL. But it seems to be impossible in a dataTable.
Ok then. I've added a column at the end of the row with an icon.
But eventually I didn't need to declare link parameters.
In my BackingBean I did like this :
public String selectEventForUpdate() throws IllegalAccessException, InvocationTargetException {
        PortletAgenda event = (PortletAgenda) JSFUtils.getInRequestMap("event");
        BeanUtils.copyProperties(this, event);
        return null;
   }JSFUtils.getInRequestMap(...) is a method I wrote in a util object :
public static Object getInRequestMap(String name) {
        Object res = null;
        Map requestMap=FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
        if (requestMap!=null) {
            res=requestMap.get(name);
        return res;
}  " event " is the name of the item in my dataTable list.
My backingBean has the same attributes as "event".
So when the page is reloaded I have a backingBean full with the selected properties to edit/update.
Thanks to your reply I realized that putting this form in the middle of the dataTable seems to be impossible.
So I put this form in a floating DIV in front of the table with a shadow.
It works :o) !
But I'm a little bit disapointed to be honest...
I used to build my web applications with Struts and JSTL and doing this kind of interface was really easy.
I've decided 3 days ago to convert into JSF because the "GUI Layer" seemed to be improved.
But now I realize that I cannot put a onMouseOver and onMouseClick on a row and I cannot display a different row in the middle of a table....
I think it's a shame because there is a facet for header and footer.
And it would be great if we could create our own personal facet that appears only if a condition is true.
For exemple " if the current item id is the same as the request parameter id then display the following facet content ....... (with a panel group and a form inside to update the row) "
It's easy to do that with JSTL thanks to c:forEach and c:if but it seems to be impossible to use JSTL tags like this during the dataTable iteration.
And JSF tags seems to have no logical tags like " if " or loops that can be nested in dataTable.
I really need to realize this interface (you click on a row then an edit form appears where you clicked).
Do I have to write a component myself that extends dataTable?
Do you know if writing such a component is hard to do for a beginner like me?
(I've juste discovered JSF 3 days ago and I've used Struts/JSTL for 2 years til now)
I'd be glad to have much advices from you about that.
Regards

Similar Messages

  • Valuations default profit center, how to obtain the original profit center?

    Hi Experts,
    Currently our valuations are being booked; they book the BS Account vs Unrealized Exchange Gain or Loss.
    The Profit Center for that BS Account is being determined automatically by the 3KEH table. Is there any way to derive the profit center from the Original Line Item?
    Example Entry
    PK     Account     Amount     Profit Ctr     
    40     10403494     549.21     OO6376DDD      BS Account - How to obtain the profit center from the original postin?
    50     37300104     549.21-     OO6376AAA  Exch Gain/Loss
    Thanks.

    Hi.
    '2. I know its going to be reversed the next month, our concern is that the amount that is going to the default profit center then will be allocated via cycle based on SKF so reflecting the data in profit centers that are not the ones that were originally affected.'-actually you can exclude adjustment account from sender while allocating,but it's better to substitute with right PC.
    '3. any logic on how substitution might work?' in fibf you can use process 1120
    'will it bring performance issues?'-no
    '1. How can this be worked via Doc Split for Unrealized? Do you have any example.'-it's not clear a question
    Edited by: alex ice on Apr 14, 2011 11:12 PM

  • How to obtain the license for the mentioned products.

    Hi All,
    Please help me in below licensing issues.
    1) Our functional team got the below error while accessing "Job Scheduling Workbench".
    Error: The Workbench is inaccessible because Oracle Manufacturing Scheduling has not been licensed. Please work with your Account Manger to purchase the license.
    2) Another error message while accessing the navigation Flow Manufacturing --> Product Sync --> Flow Routings
    Error: APP-BOM 20972: You cannot access this form
    Cause: You do not have a license for Oracle Flow Manufacturing.
    Action: Obtain a license for Oracle Flow Manufacturing.
    Please guide me how to obtain the license for the above products.
    Environment: eBS R12.1.3 on Linux 5.8
    Regards,
    Siva

    Thanks for providing the document. I follow the document and get back to you for any issues.
    Regards,
    Siva.

  • How to obtain the updated column name in a trigger?

    Hello everyone,
    I need to know for audit propose the updated column name in a After Update Trigger on a Table.
    The table have more than 20 columns, and i think that do more than 20 conditions asking for the difference between the :new value and the :old value is not the best way.
    Thanks for the help!
    LCJ

    Hi,
    Thanks to all for the replays.
    I didn't know that i can pass the column name to the UPDATING. This is only possible on 10g??
    Any way, i pass the column name and works fine, but i have another issue because of that.
    I obtain the column name from a cursor that query user_tab_columns view, when i try to obtain the value of the :old or :new, i can't because i don't know how to obtain the value of the value.
    This example show better:
    DECLARE
    vOldValue Varchar2(50);
    Cursor cur_Column_Names Is
    Select COLUMN_NAME
    From User_Tab_Columns
    Where TABLE_NAME = 'table_name';
    BEGIN
    For var_cursor In cur_Column_Names Loop
    If Updating(var_cursor.COLUMN_NAME) Then
    vOldValue := '?'; -- How obtain the value of the :old. + >var_cursor.COLUMN_NAME??
    End If;
    End Loop;
    END;Thanks to all for the help.
    LCJ

  • A very simple question: how to obtain the mail server name?

    In our JSP application, at one point an email will be sent to notify one event. Currently, that is done by using the html tag: mailto. To have more control on the email in tems of context format (a bad layout right now) and others. I would like to have it processed at servlet by using the JavaMail API, so that it have a nice format and have the sender's email address right in case email client is not installed in the machine where the browser in. The JavaMail API is straight forward. The question is how to obtain the mail server name, and the sender's email address if there is one?
    Thanks.
    v.

    How to obtain the mail server's name? It's your server, you should know its name. Or if it isn't your server, you should ask the administrator for its name. Point is, you need to decide in advance what server you are going to use and hard-code its name into the program or into a properties file.
    And how to obtain the client's e-mail address? You have to ask the client, probably by putting a box in the HTML and asking them to type it.

  • How do obtain the number words typed in a Pages document?

    How do obtain the number words typed in a Pages document?

    I found it!  To get the number of words in my Pages 5.1 document...I clicked on the paper-icon on the far left...(at the very left edge) it gave me a selection that ended with "count words."  TaDa!  Thanks

  • How to obtain the alv reports in the dilog programing.

    how to obtain the alv reports in the dialog programming, that is when the push button in the screen in clicked it must be directed to the report, where to write the code for the report.

    Hi
    Use LEAVE TO LIST PROCESSING and develop your normal ALV dispaly as usual. System automatically takes care of this.
    I tried for normal report but try above even in the case of ALV reports
    Cheerz
    Ram

  • How to obtain the manage beans instance to oprate it in javacode

    in the faces,there is some manage bean, but i what to operate it ,eg: carbean.carName = "xxxx"; carbean is a managed bean:
    How to obtain the manage beans instance to oprate it in javacode

             ActivityContentBean activityContentBean = (ActivityContentBean) FacesContext
                        .getCurrentInstance().getApplication().createValueBinding(
                                  "#{currentActivity}").getValue(
                                  FacesContext.getCurrentInstance());

  • How to obtain the default serie for a document

    Hi,
        Anybody know how can obtain the default serie for a document throw a query??
    I can`t see the relation between the ONNM and the NNM1 tables because the 'dfltseries' field of the ONNM not corresponding with the 'Series' field of the NNM1.
    For example for an A/P Invoice
    Thanks!!

    Hi Mariano,
    According to the SDK Help file, you need to query the NNM2 table
    Series Default
    Table name: NNM2
    ObjectCode     UserSign     Series     DocSubType
    So, the query to retrieve the A/P default series for the manager user would be:
    SELECT T0.Series FROM [dbo].[nnm2] T0 WHERE T0.ObjectCode='13' AND T0.UserSign = 1
    From the SDK you can replace the T0.UserSign = 1 for T0.UserSign = oCompany.UserSignature to retrieve the default series for the current user...
    Regards,
    Vítor Vieira

  • How to obtain the running time of a task?

    How to obtain the running time of a task? I want to write a program about task progress.
    My email: [email protected]
    Thanks!

    First, Thanks for your code.
    But, I want obtain running time before running it.
    Example:
    class a extends JFrame{
    a() {
    initComponent() ;
    new progressBar(this); // my fancy. (may be other type variant.)
    void initComponent() {
    class progressBar {
    JProgressBar proBar = null ;
    Timer taskTime = null ;
    Double longTime = null ;
    progressBar(JFrame frame) { //JFrame or other.
    longTime = // ??????? You know ?????
    void monitor() {
    taskTime = new Timer(1000, new ActionListener() {
    public void actionPerformed(ActionEvent event) {
    //repaint the proBar code.
    taskTime.start();
    }

  • Formatting Tips, how can obtain the right  format?

    how can obtain the right format of code,
    http://forum.java.sun.com/help.jspa?sec=formatting
    if is possible do a example.
    Thanks in advantage

    Wrap your code between [code] and [/code]
    [code]
    // Here goes my code
    [/code]
    looks like
    // Here goes my code.

  • How to get current row data in table control

    Hi , expert ,
       I am professional in oracle ,  but  now I am a new guy in SAP ABAP .
    I  have a question in UI
    How to get current row data and click pushbutton  in table control  to open next screen ?
    I want to get the current data and open next screen to carry out detail detail .
    Thansk for all your suggestion .

    GET CURSOR LINE SY-CUROW .
      READ TABLE internal_table index SY-CUROW.

  • How to construct the component tree in my custom component?Help!

    Hi, i am writing a custom component like this:
    public class HtmlCategory extends HtmlPanelGrid
         public void processRestoreState(javax.faces.context.FacesContext context,
                java.lang.Object state)
              setColumns(1);
              HtmlCommandLink link=new HtmlCommandLink();
              link.setValue("Let's Bingo");
              MyUtil.setActionListener(context,link,"#{temp.mytest}");
              UIParameter param=new UIParameter();
              param.setName("name");
              param.setValue("Robin!");
              link.getChildren().add(param);
              param.setParent(link);
              getChildren().add(link);
              link.setParent(this);
              super.processRestoreState(context,state);
    }         you see, i want to construct the compont tree at Restore View phase this way,because the structure of the component tree will always be the same, so i don't the user to write extra code.
    But the children of the component are not rendered,the renderer of the HtmlCategory component just extends the HtmlGridRenderer(myfaces) directly,and always calls the "super" methods in the encode methods of the renderer.
    I got a message from the console:
    Wrong columns attribute for PanelGrid id0:id4: -2147483648
    but i have set the columns attribute in the code above, so what's happening? or please give some advice about how to render the component tree by myself in Restore View with the tree constructing code in the custom component class code,just lke the code above.
    Best Regards:)
    Robin

    Well, i don't know if i have got my question clear.
    usually, according to the tags you use in the jsf page, a component tree will be created at the Restore View phase,for example:
    <f:form>
      <h:panelGrid ...........>                         
              <h:dataTable ................>
              </h:dataTable>
       </h:panelGrid>
    </f:form>but because i am writing a component for my web app, all the child components and their attributes are not likely to change. so i want to reduce the tags into one custom tag, and construct the component tree internally by myself.But it is not the case of backing bean.So i wrote the the code in the method:
    public void processRestoreState(javax.faces.context.FacesContext context,java.lang.Object state)as it is shown in my orginal message.But it seems that it is not right way to construct my component tree.So where should i put the code that construct the component tree?Overriding the method :
    public void processRestoreState(javax.faces.context.FacesContext context,java.lang.Object state)is not the right way?
    Best Regards:)
    Robin

  • How to change the component styles (inside panelFormLayout.)

    Hello friends,
    Can anyone help me, How to change the component styles where components (af:inputtext) inside af:panelFormLayout.
    i changed all of the components one by one style, inlinestyle .. from the inspector. By result is nothing.
    how to extend blafplus-rich and override some of the components style?
    thanks for your helps

    thanks alright but i want to learn again after this.
    Which component has a content or border or how can i find list components attributes for change style?
    For example i want to change document content pane, what will i write to css. i am little knowledge about css.
    Thanks for help

  • How  we get the component at front or back in a Jpanel

    How we get the component at front or back in a Jpanel. I want to manage the Z-axis position of the components in the Jpanel.

    [url http://java.sun.com/docs/books/tutorial/uiswing/components/layeredpane.html]How to Use Layered Panes

Maybe you are looking for