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
j.vinodj.vinod 

Input Text field, not setting the parametres

Hi ,

I have a Visual Force Page , I have a Text Box in the Page. When I enter any value in the text box from Browser, I Expect it to get set in a Class Variable.

The Text Box , I have included , is inside a data table.

One entire Row in a data table , is a instance of user defined Apex Class. So if there are 5 rows, then 5 objects of my Apex Class , are added in a list and the list is iterated through the List in the data table. So I have a attribute inside my apex class, which is associated with the Text Box field. So once I enter some value in a list, the attribute is expected to be set, But It is not getting set. Always the set value is null.

 <apex:dataTable value="{!LabourList}" var="L2" id="LabourItems" rowClasses="odd,even" styleClass="tableClass" cellspacing="20" columnsWidth="5">

 <apex:column >
                     <apex:facet name="header"><apex:outputLabel value="Hours" style="font-weight:bold" for="Hours"/> </apex:facet>
                     <apex:outputPanel layout="block" styleClass="requiredInput">
                             <apex:outputPanel styleClass="requiredBlock"/>
                             <apex:inputText value="{!L2.Quantity}" id="LabourQuantity"></apex:inputText>
                         </apex:outputPanel>
 </apex:column>

</apex:dataTable>

Here LabourList is the List of objects my Class, and L2 is the iterating variable.  Here L2.Quantity is not being set.

Please help me out as it is a production critical issue.

Regards

Vinod

JimRaeJimRae
Post your controller code, so we can see how you have the class implemented,and your setter and getters for the list.
I have a similar problem myself, maybe if someone figures your issue out, it will also address mine.
j.vinodj.vinod
I am pasting my controller code , for reference. If any body could help.

My apex class
public class TableFields{

public Double quantity;

public Double getQuantity(){
return quantity;
}

public void setQuantity(Double quantity){
this.quantity=quantity;
}
}

As specified the above labourList , it is of type Table Fields

List <TableFields> labourList = new List <TableFields> ();

My Controller

public List <TableFields> getLabourList(){
return labourList;
}

public void setLabourList(List <TableFields> l2){
labourList=l2;
}
If any one needs any further code assistance , let me know, so that I can come out with as much information as required.

Any help, Is whole heartedly appreciated.

Regards
Vinod
Technical Consultant
Lister Technologies

iceberg4uiceberg4u
Try using the <apex:pageBlockTable> .and do you really require the <apex:outputPanel> as the <apex:column has a styleClass of its own and then try.
<apexutputPanel layout="block" styleClass="requiredInput">
                             <apexutputPanel styleClass="requiredBlock"/>
                             <apex:inputText value="{!L2.Quantity}" id="LabourQuantity"></apex:inputText>
                         </apexutputPanel>


As far as I can see I dont find anything wrong with the code.