You need to sign in to do that
Don't have an account?
Gonzalosr
Help with pageblocks
Hi,
i am trying to make something, but i can't. I want to create a visualforce page where i will have a pageblock for each object, each object is in a list.
for example, i have a List<Account>, and i want to show a page block for each Account
[pageBlock Account 1]
[pageBloc Account 2 ]
..
..
[pageBlock Account n ]
where n is the size of my list, and pageblock i show the detail of the i element of the list.
thanks
Hi,
this should work with a repeat tag : <apex:repeat value="{!accountList}" var="acc">.
You can then embed your pageBlock inside this tag.
I didn't try, but it should work.
Kind Regards,
Catherin.
<apex:repeat valuea={!list} var = "element">
<call controller method >
somebody can help me?
Really thanks
in the page, i have a list of forms , and each form have a list of items, so i need to do the next :
<apex:repeat value= "{!Forms}" var = "form" >
<apex:pageblock headerValue = {!form.name } >
<apex:pageBlockTable value="{!items}" var="item">
<apex:column headervalue = "Item Name" value = "{!item.Name__C}" />
</apex:pageBlockTable>
</apex:pageblock>
</apex:repeat>
where items have to return the list of items to the current form. so i create an index, and i do the next
i = 0; // in the constructor
// more code
currentFormID = listOfForms.get(i).id;
listOfitems = (select items where form.id = : currentFormID);
and now i have to increment the index, so invoke a fuction "incIndex"
how can i do that?
thanks.
for me, there is no need to have an index. your page should look like this :
<apex:repeat value= "{!Forms}" var = "form" > <apex:pageblock headerValue = {!form.name } > <apex:pageBlockTable value="{!form.items}" var="item"> <apex:column headervalue = "Item Name" value = "{!item.Name__C}" /> </apex:pageBlockTable> </apex:pageblock> </apex:repeat>
In your controller, you must build the form so that it is a list which contains a field name and a list of items :
public form{ String name {get; set;} Object items {get; set;} public form(){ //form constructor .... } } public List<form> formList = new List<form>(); public List<form> getForms(){ .... return formList;
}I hope it helps.
Kind Regards,
Catherin.
i made an auxiliary object, where i made a relationship with the two objects
class Objects {
Form form;
List<items> items; // items of the form
public getForm();
public getItems();
}
the Object have worked perfectly, thanks!