Skip to Content
0
Former Member
Oct 17, 2005 at 10:34 PM

Link in tableview cell

29 Views

Hi all,

i have some problem producing a link in cell of portal

The spec is i have to search user which returns a table.

In the table the last column does not have name but it should provide a link wich leads to another iview or page.

two questions here:

(1)Not able to display link, I have posted my code below.

(2)When clicked on the link,it should call an iview or page and the attributes need to be passed to the new iview or page, like username, first name last name, email, phone etc., which i am gonna need in my next page.

import java.io.Serializable;
import java.util.Vector;

import com.sap.security.api.ISearchResult;
import com.sap.security.api.IUser;
import com.sap.security.api.IUserFactory;
import com.sap.security.api.UMFactory;

import com.sapportals.htmlb.table.DefaultTableViewModel;

public class searchBean implements Serializable {


	private boolean selection=false;
	public DefaultTableViewModel model;
	public int count=0;

	public DefaultTableViewModel getModel(){
		return model;
	}
	
	public void setModel(DefaultTableViewModel model){
		this.model=model;
	}
	public void createData(ISearchResult result) {
	
	//this is your column names
			Vector column = new Vector();
			column.addElement("Name");
			column.addElement("Email ");
			column.addElement("Phone ");
		    column.addElement("Company");
		    column.addElement("      ");
		column.addElement("Link");
		column.addElement("ActualLink");
		
	IUserFactory userFact = UMFactory.getUserFactory();
	Vector rVector = new Vector();
	try {
			while (result.hasNext()) {
				Vector data = new Vector();
				String uniqId = (String) result.next();	
				IUser thisUser = userFact.getUser(uniqId);
				data.addElement(thisUser.getDisplayName());
				data.addElement(thisUser.getEmail());
				data.addElement(thisUser.getTelephone());
				data.addElement(thisUser.getCompany());
				data.addElement ("link text");
	              
				rVector.addElement(data);
		}
				model = new DefaultTableViewModel(rVector, column);
	}catch (Exception e) {
				e.printStackTrace();
	}
	
}
	
	public int getCount(){
			return count;
		}

	/**
	 * @param b
	 */
	public void setSelection(boolean b) {
	this.selection = b;
		
	}
	public boolean getSelection(){
		return this.selection;
	}

Any help would be appreciated with nice points.

thanks,

Paul