how to update database for selected rows from portal

Hi,

I am having a table control view to display the rows extracted from the databse for a particular input using the webservice.
Now, I want select a row and edit some information and then update the information in the database.
How do I bind the input variables of update service with the updated information of the selected row.

Thanks,
Navdeep Singh.

Hi Navdeep,

By using the “Select row check box” control u can achieve the functionality.
Add one more column to ur table and in that column place the select row check box control.
After user selecting the particular row that row will be available in control scoped variables.
But for this ur table must be binded to the “updatable table result provider”.

or in the source iterate over the result provider, and get the selected row.

Regards,
Sunil.

Hi Sunil,

I am able to get the selected row ID using the select row check box. But how to get other parameters of the row to update.
I do not find “updatable table result provider”, I am using Designer7.0
Is it possible to achieve the functionality like, as soon the user clicks on the check box, that particular row values becomes editable.

Thanks,

Hi Navdeep,

i dont have idea like whether we can allow the user to edit only the particular row which user have selected. Y because we can set the readonly property but it will apply to the entirerows.

what u can do is after selecting the paricular row, place a button called edit and bind that to an action. In the action

create the iterator for the result provider that has been binded to the tabel

Iterator itr=getMqtTestSchedule_ResultProvider().getSelectedRows().iterator();

if(getMqtTestSchedule_ResultProvider().getRowSelectedCount()==0)
{
getStudentRegistrationDetails().setStatusMessage(“Choose atleast one row to edit”);
return “stay in same page”;
}

if(itr.hasNext())
{
__CUR_MQTTESTSCHEDULE_01 re=(__CUR_MQTTESTSCHEDULE_01)itr.next();
startTime=re.getSTARTTIME();
}

like that u can retrieve the values from the result provider and display
if u r using radiobutton just if is enough, but if u r using checkbox(multiple selection)
use while instead of if

I believe in 7 version u can use List Table with Selection(first option in content providers)

Regards,
Sunil_N

Thanks Sunil,

I got the things worked. Your post was also helpful.