+ Start a Discussion
RajeevlsHydRajeevlsHyd 

How to make the first row of any list non editable

I want to make the first row of a list non editable  ..but it has to display  and update value automatically through a logic.. While other rows will be editable.

 

I want to restrict the first row of the dealSplits list(given below) as non- editable while the other rows as editable

-----------------------------------------------------------------------------

 

public PageReference addSelectedProductAction()
{
for(ProductWrapper pw: products){
if(pw.isSelected){
pw.addDealSplitAction();
selectedProds.add(pw);
}
}
return null;
}

public PageReference addDealSplitAction(){
DealSplitWrapper dealSplit = new DealSplitWrapper(product);
dealSplits.add(dealSplit);

return null;
}

 

 

 

--------------------------------------------------------------------------------

 

 

Deepa.B.AnkaliDeepa.B.Ankali
@RajeevIsHyd,

If you are displaying it in a visualforce page, then use it as outputField and rerender it onchange of other fields.
RajeevlsHydRajeevlsHyd

Thanks..
I am using the list in a vf page ... but not getting how to restrict the first row as non editable...

Deepa.B.AnkaliDeepa.B.Ankali
@RajeevIsHyd,

You can use outputField. It wont allow to edit.
digamber.prasaddigamber.prasad

Hi,

 

The best way I can think of to achieve this is to user wrapper class to render records on vf page. Create an element say 'ReadOnly' in wrapper class. For first record of list, keep its value as true and false for other records. In your VF page, you can render output text if 'ReadOnly' has true value and for other records in edit mode.

 

Let me know if you have any specific question about this.

 

Happy to help you!