Skip to main content
Zachariah Rosenberg 님이 #Visualforce에 질문했습니다
I'm trying to create a visual force page with a table and a "request" button that will take the selected row and append it as a task.

Here's a photo of the table:

Apex:CommandButton Passing Value from VF to Controller

When a user hits request, I want to create a task that includes the deal name and deal owner.

Here is the VF page:

<apex:page controller="A7_OppsCntrl" standardStylesheets="false" sidebar="false">

<apex:form>

<table id= 'a7Table' class='display'>

<thead>

<tr>

<th>Deal Name</th>

<th>Deal Owner</th>

<th>Request</th>

</tr>

</thead>

<apex:repeat value="{!A7Opps}" var="row">

<tr>

<apex:repeat value="{!A7Opps[row]}" var="cell">

<td> {!cell} </td>

</apex:repeat>

<td>

<apex:commandButton action="{!send2Admin}" value="Request" title="Send Request to Admin" oncomplete="" reRender="block">

<apex:param value="{!A7Opps[row]}" assignTo="{!paramValue}"/>

</apex:commandButton>

</td>

</tr>

</apex:repeat>

</table>

</apex:form>

</apex:page>

Here is the controller:

 

Global With Sharing class A7_OppsCntrl {

static string paramValue;

public static void send2Admin(){

user adminId = [SELECT id from user where name like 'Sir Admin' limit 1];

string userId = toolbox.grabUserId(); //Grabs context user ID

user userName = [SELECT name from user where id = :userId];

task leadReq = new task();

leadReq.OwnerId = adminId.id;

leadReq.Subject = 'New Request';

leadReq.Description = userName.name+' is requesting '+paramValue;

insert(leadReq);

}

The task is successfully inserted, but the paramValue comes up as null.

What am I doing incorrectly (probably a lot ;)? How can I get the row data to be appended to the description of the task?

I've tried following https://developer.salesforce.com/forums/ForumsMain?id=906F000000095uXIAQ

Didn't help.

Thanks!
답변 5개
0/9000