You need to sign in to do that
Don't have an account?

Urgent------- how to create and save grid view atructure at visual force
hello,
Actually i want to create a result document. in which i have to make a grid structure like
student name/subjects sub1 sub2 sub3
studentname1 text field(marks) text field(marks) text field(marks)
studentname2 text field(marks) text field(marks) text field(marks)
student name3 text field(marks) text field(marks) text field(marks)
.
.
.
Now here subjects are coming from one custom object and student names are coming from other objects and marks will be enter by current object.
If any body know how to implement this plsss reply soon i need this urgently....
Actually i want to create a result document. in which i have to make a grid structure like
student name/subjects sub1 sub2 sub3
studentname1 text field(marks) text field(marks) text field(marks)
studentname2 text field(marks) text field(marks) text field(marks)
student name3 text field(marks) text field(marks) text field(marks)
.
.
.
Now here subjects are coming from one custom object and student names are coming from other objects and marks will be enter by current object.
If any body know how to implement this plsss reply soon i need this urgently....
Hi Gupta,
Here is wat you can do
Lets say we have two lists
List<Subject> subjects,List<Student> students;
now List<List<grid>> gridlist has to be populated.
in vf page you can access it as
<apex:datalist value="{!gridlist}" var="grid">
<apex:datalist value="{!grid}" var="gridvar">
{!gridvar}
try this.
hope it hepls
thanks,
sid
Thanx for your reply..
bt in student list we fetch student namefrom student object in subject list we fetch subject names from subject objects
bt in gridlist what we have to do??? can you please clear this more and how to save it later on if you can help thi than i shall be very thank ful to you...
Hi Gupta,
Sorry to confuse you with the nested list idea.
you can simply loop through both the lists in vf page
<table>
<tr>
<td>StudentName/Subjects</td>
<apex:repeat value="{!subjects}" var="subject">
<td>
{!subject}
</td>
</apex:repeat>
</tr>
<tr>
<apex:repeat value="{!students}" var="student">
<td>
{!student}
</td>
<!-- now the text boxes related to each subject are to be populated -->
<apex:repeat value="{!subjects}" var="subject">
<td>
<input type="text" name="{!student}:{!subject}" value="" />
</td>
</apex:repeat>
</tr>
</apex:repeat>
</table>
In the controller we can access the values of the marks for each subject using
for(Student st:students)
{
for(Subject sb:subjects)
{
ApexPages.currentPage().getParameters().get(''+st+':'+sb);
}
}
hope it helps,
Sidz
Sorry SId it will not work ... i send u my code
apex class==========
=====================Visual Force page============================================
<table border="1" align="center">
<tr>
<td>
</td>
<apex:repeat value="{!Subjects}" id="repeat1" var="item">
<td>
<center><b><apex:outputField value="{!item.Subject__c}" id="theValue"/></b></center>
</td>
</apex:repeat>
</tr>
<apex:repeat value="{!Records}" id="repeat2" var="pitem">
<tr>
<td><center><b><apex:outputField value="{!pitem.Student_Name__c}" id="theValue"/></b></center></td>
<apex:repeat value="{!Subjects}" id="repeat3" var="item">
<td>
<center><b><apex:inputField value="{!item.Marks__c}" id="theValue"/></b></center>
</td>
</apex:repeat>
</tr>
</apex:repeat>
</table>
My objects are student profile from which i fetch student names, 2nd object is subject from where i fetch subject names and my current object is examination setup .
Student name/subjects sub1 sub2 sub3..........
sname1 inputfield(marks) inputfield(marks) inputfield(marks)
sname2 inputfield(marks) inputfield(marks) inputfield(marks)
this thing which i cant do is i dnt knw how to locate the marks with suject and sname while saving
please send me the correct code for this.....
as i suggested do not use apex:input field to send your data
use a html input text
there you can submit your form without binding it to your backend.
that can be accessed via ApexPages.currentPage.getParameters().get('the parameter name');
you can name the parameter in this fashion
studentId:subjectID which will be a unique one for each student and subject
hope this helps,
sid
thanx for your replies... but i still have aproblem while saving the records. when i save the record of 3 students than it will just ave the record of 1st student not ol. that is my main problem..
and i dont find this solution thats why i send you my code .I already display my record in matrix form i got a problem while saving it.... if you can help me regarding this than i will be very thank ful to you..