0

adding button in Listcell

asked 2008-08-05 10:53:54 +0800

irteza1 gravatar image irteza1
63 1

Hi all,

I'm adding different fields from database into a listbox and against each value of field in list i need a button,

for example i have added two fields name and callere id successfully;

(1st column in list) new Listcell(user.getCallerId()).setParent(li);
(2nd column in list) new Listcell(user.getName()).setParent(li);
(3rd column in list) here i want to add button , but problem is Listcell dontnot take Button class argument its only take string

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2008-08-05 14:56:14 +0800

madruga0315 gravatar image madruga0315 flag of Brazil
937 2 12

Hey there,

The default usage of listcell is as text (String).
But you can put any other component inside the listcell, as this

Listcell lc = new Listcell().setParent(li);
new Button("button").setParent(lc);

/Madruga

link publish delete flag offensive edit

answered 2008-08-05 15:24:29 +0800

ansancle gravatar image ansancle
317 9

Another example I ripped from some code I had in a ListitemRenderer

			
	public void render(Listitem item, Object obj) throws Exception
	{
                       
                        DHiMessagePart part  = (DHiMessagePart)obj;
			Listcell cell = new Listcell();
			String partType = DHnMessageType.MESSAGE.toString();
			cell.setId(part.getId());
			Button testButton = new Button();
			testButton.setStyle(DHzCssStyles.listCellWithGreenCircleIcon);
			testButton.setHeight("15px");
			testButton.setWidth("15px");	
			testButton.setParent(cell);
			Label label = new Label(part.getDisplayString());
			label.setParent(cell);
			cell.setParent(item);
        }

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2008-08-05 10:53:54 +0800

Seen: 232 times

Last updated: Aug 05 '08

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More