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

Adding rows to a table
Next question,
I'd like to use a rerender to allow me to add rows to a table I'm building on a page. This is the standard type of "you get one line of blank fields, and after you fill it out, you click 'new X' to get a new row to fill in"
I have the table backed by a list, and I can get it to render the row properly. However, I can't figure out how to call an action on the controller to add the row before I do the rerender. My first guess was to try:
<apex:commandlink action="addShift" reRender="shiftable" >Add Shift</apex:commandlink>
(where shifttable is an output panel wrapped around the datatable, and addShift is a controller action that adds a new object to the list of objects that the table iterates on) But what happens, and what I see in Firebug, is that it just does a normal rerender on the datatable without calling the action. Any hints on how I should do this?
James
I'd like to use a rerender to allow me to add rows to a table I'm building on a page. This is the standard type of "you get one line of blank fields, and after you fill it out, you click 'new X' to get a new row to fill in"
I have the table backed by a list, and I can get it to render the row properly. However, I can't figure out how to call an action on the controller to add the row before I do the rerender. My first guess was to try:
<apex:commandlink action="addShift" reRender="shiftable" >Add Shift</apex:commandlink>
(where shifttable is an output panel wrapped around the datatable, and addShift is a controller action that adds a new object to the list of objects that the table iterates on) But what happens, and what I see in Firebug, is that it just does a normal rerender on the datatable without calling the action. Any hints on how I should do this?
James
Which still leaves me with the "How do you do in-action validations and errors" question. I can't find anything in the doc about it.
James