You need to sign in to do that
Don't have an account?
GoForceGo
Creating an Editable Grid/Table using visual force
How would I go about doing it?
The usage is as follows:
For example, if an account has 10 contacts, instead of editing one at a time. I want to be able to display a table of with just First Name, Last Name, phone, e-mail, Title
The dataTable object - is there any option to create an editable grid?
The usage is as follows:
For example, if an account has 10 contacts, instead of editing one at a time. I want to be able to display a table of with just First Name, Last Name, phone, e-mail, Title
The dataTable object - is there any option to create an editable grid?
This does not work though. The problem is that the "Save" command is using "Accounts", not contacts, so when I change a name and save, it doesn't do anything.
Any thoughts?
Can you make the standard controller for Account (in the example above) save contact data?
If not, do you implement a custom controller?
The general problem as follows:
You want to display a "related list" Data table and edit the records of that object and save it.
The Apex Page itself would take the record id of the record that has the related list (e.g account for showing related contacts).
How do you get apex page to save the related list data?
consider the (custom) object model of parent and master-detail, in this case Consulting_Project and Deliverable
page
and now the extension ==> deliverablesController
you can (easily) modify this to work with accounts and contacts.
change Consulting_Project__c ==> account
change deliverable__c ==> contact
then modify the fields as you require.
to invoke this, besure to add ?id=your_account_id or the controller extension will not find any data in the constructor
I want to accomplish something else:
In the example above, pretend deliverable_type__c is a pick list. I want to break up the table into multiple tables based on different values of the pick list. It works great as follows if I know the pick list values and number of pick list items ahead of time.
How do I do it if picklist values and the number of pick list items are not known ahead of time?
Apex Page code:
Is there a way to get to metadata for an object in Apex - doesn't seem like DescribeSObject exists in Apex?
BTW, I did it with tabpanel and tab - even cooler! It also looks like x-cel spread sheet now!
Hi..
I am in same situation...
But I need inputtext and selectlist instead of inputfield (in the above Ron Hess code)... I able to retrive all records and display it in a table.. How to save edited inputtext value and change select list value in a database...
That is the cells are input text and select list values... I couldnt set the setter method for individual cells... The setter method is working only for last row.. That is its retrive and set last row only...
How to retrive all rows records....
Any one have the sample code please post it...
As long as you have an array (delivers in Ron Hess example and qauditItems, oAuditItems in my example) that maps to the table and as long as you update the entire table you should be fine.
Thanks for ur reply...
How to assign setter method for each row in a datatable.. If I am using setter method I able to get last row value only...
If u have sample code please reply me...
I don't user setter method for each row. Just an action method for entire table.
In my example:
@Ron Hess - this is a great example. Thank You!
One question... how do you add a record for the Deliverables grid?
The comments in your controller state, "...Action method called from page link...". Which page link are you referring to?
Again, thanks for a great example!
Thanks
A simpler way might be to use the open-source code available here: https://github.com/Up2Go/visualforce-table-grid
(I haven't tested it yet myself, but it looks good.)
If you want something simpler and don't need to put it in Visualforce, I recommend the GridBuddy app: https://appexchange.salesforce.com/listingDetail?listingId=a0N30000003IkInEAK. That's what I use now. You can get a few licenses for free if you are with a nonprofit.
Did any once find a solution for this?
Thank you