You need to sign in to do that
Don't have an account?
mritz
When i assign value="{!c}", for inputText.
i am getting an error -> 'unkown property c'
in my opinion i should work perfectly.
Please correct my mistake.
apex:repeat with inputText
Apex Code public class myClass1{ public string out1{get;set;} public list<decimal> capitals{get;set;} public list<decimal> revenues{get;set;} public myClass1(){ out1='Hello'; capitals=new list<decimal>(4); revenues=new list<decimal>(4); for(integer i=0;i<4;i++){ capitals[i]=revenues[i]=i; } } public void mySave(){ out1=String.valueOf(capitals[1]); //this line should display value entered in second input text in place of 'Hello' } } VisualFroce page <apex:page controller="myClass1" showHeader="false" doctype="HTML-5.0"> <apex:form id="form"> <apex:tabPanel > <apex:tab label="one"> <p>Tab one Content</p> <apex:outputtext id="out1" value="{!out1}" escape="false"/> <apex:commandButton value="Save" action="{!mySave}" rerender="dataTable,out1,rpt"/> <table id="dataTable" style="border:2px solid green"> <apex:repeat value="{!capitals}" var="c" id="rpt"> <tr> <td><apex:inputtext value="{!c}"/></td> </tr> </apex:repeat> </table> </apex:tab> <apex:tab label="two"> </apex:tab> </apex:tabPanel> </apex:form> </apex:page>ideally above code should display numbers 0 to 4 in four input Text fields.
When i assign value="{!c}", for inputText.
i am getting an error -> 'unkown property c'
in my opinion i should work perfectly.
Please correct my mistake.
Apex Class
This also includes a button action that helps read out the current values of the list to debug.
VF Page:
Avoids the problems once you perform an action... Hope this helps...
All Answers
Controller
Page
Hope this helps...
Subscript value 4 not valid. Must be between 0 and 3
Error is in expression '{!capitals[Value(num)]}' in component <apex:inputText> in page test_list1
Code:
but it seems its showing index.
if you change value in constructor. you will see error.
or
even if you try to change values in input text and do some action on it, it flags error.
Apex Class
This also includes a button action that helps read out the current values of the list to debug.
VF Page:
Avoids the problems once you perform an action... Hope this helps...