0
votes

Well, I have another doubt. Every row of my list have those components Label - Button(-) - Button(+) - Label(0) when I clicked on Button(+) I need to get Label(0) value and increase one unit. So I need to get Label(0) reference to set new values. I am trying to find this component with:

Label l = (Label)findByName("lblVal", c.getParent());

Label l = findLblVal();

Label l = findLblVal(c);

Label l = findLblVal(c.getPrent());

My code in List Action Listener is:

List list = (List)c;

Button b = ((GenericListCellRenderer)list.getRenderer()).extractLastClickedComponent(); 

if(b != null)
{

    //lblVal is the name of my component in the renderer

    //MY PROBLEM IS HERE, I GET NULL REFERENCE

    Label l = findLblVal(c);

}

but I always get a null reference. How can I get reference to this component?

1

1 Answers

0
votes

Renderer's are stateless. I suggest reading the developer guide or following the How Do I? videos.

You need to edit your model so that it includes a field matching the name of the label with the proper string that you want.