Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
210
How can we get the current row components in gridView ?
posted

Hi Everybody,

I am trying to get the current row components Id's dynamically from backing bean. But i am not getting the solution to get the ids. please anybody tell me the code to get the ids.

 

Thanks in Advance,

 

A.Viswanath Yadav

 

  • 1765
    Verified Answer
    posted

    Hello Viswanath, Not sure if I correctly understood your question. However, in order to get the current WebGrid row value into the backing bean i.e. if each row contains link or button, then below code works.

    // JSP Code
    <h:commandButton actionListener="#{simpleGridRows.getRowValue}" value="#{DATA_ROW.firstName}"/>
    <ig:link actionListener="#{simpleGridRows.getRowValue}" value="link"/>

    // Backing bean
    public void getRowValue(ActionEvent evnt){
     PersonInfo obj = (PersonInfo) grid.getDataRow(evnt.getComponent());\
     System.out.println(obj.getFirstName());
    }


     

    Thank you!