function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
robertcw777robertcw777 

InputType based on Cell Value

I'm rendering a table of text values, and I want to make each cell editable based on a value in a wrapper around the cell value. Here is the wrapper definition for the rows and cells:

 

public class rowWrapper {
public List<Cell> CellList{get;set;}
}


public class Cell {
public String Value{get;set;} 
public Boolean Input{get;set;} //true if cell allows input
}

 

This is what I'm trying to do:

 

<apex:repeat value="{!Rows}" var="row">
    <tr>
       <apex:repeat value="{!row.cellList}" var="c">
         <td align="right">
               "{!If(c.input,  "<input type="text" value="{!c.value}" name="inputtype" />"  ,"{!c.value}") }"
          </td>
       </apex:repeat>
     </tr>
</apex:repeat>

 

I get a syntax error "Line 1 Syntax Error. Missing )

 

Am I on the right path here to do what I want to do? Is this an issue with nested quotations?

 

Thanks. 

 

 

 

 

 

 

Puja_mfsiPuja_mfsi

HI,

Why r u not used "Disabled" attribute of apex:inputText in VF.

You can use like :

<apex:inputText value="{!c.Value}" disabled="{!NOT(c.Input)}"  /> 

With the use od disabled if  c.input equals true then it enabled edit otherwise non-editable mode.

 

Please let me know if u have any problem on same,and if this post helps you please throw KUDOS by click on star at left.