pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brendan cheng <ccp...@hotmail.com>
Subject RE: ItemRender Layout question
Date Wed, 28 Dec 2011 07:49:20 GMT

Hi,
in renderer function, is this going to work? 
@Override
	public void render(Object item, int index, ListView listView,
			boolean selected, boolean checked, boolean highlighted,
			boolean disabled) {
		if (item != null && item instanceof Tab.LogView) {
			Tab.LogView logview = (Tab.LogView) item;
			fieldsflowPane = logview.fieldsPane;
		}
	}
I couldn't get logview.fieldsPane to be shown in fieldsflowPane.How to assign the logview.fieldsPane
into fieldsflowPane?How to change a component's parent reference?
Brendan
From: ccp999@hotmail.com
To: user@pivot.apache.org
Subject: ItemRender Layout question
Date: Tue, 27 Dec 2011 14:21:45 +0000







Hi,
I'm trying render a list of list view with a nested list view.  Despite all my effort,  I
can't get it display on screen.
Here is the snippet of code:
	public void addNode(Person person) throws
			IOException, SerializationException {


		BXMLSerializer bxmlSerializer = new BXMLSerializer();
		LogItemRenderer logItemRenderer = (LogItemRenderer) bxmlSerializer
				.readObject(getClass().getResource(
						"fullview/LogItemRenderer.bxml"));


		ListView listView = new ListView();
		listView.setItemRenderer(logItemRenderer);


		org.apache.pivot.collections.List<LogView> logviewlist = new org.apache.pivot.collections.ArrayList<LogView>();
		for (Log log : person.getLogs()) {
			if (log instanceof Log) {
				Log restclientlog = (Log) log;
				ListView sysfieldlistView = new ListView();
				sysfieldlistView.setItemRenderer(new FieldItemRenderer());
				org.apache.pivot.collections.List<Field> syslist = new ArrayList<Field>();
				for (Field field : restclientlog.sysFields) {
				      syslist.add(field);
				}
				sysfieldlistView.setListData(syslist);
				FlowPane flowPane = new FlowPane();
				flowPane.add(sysfieldlistView);			
				logviewlist.add(new LogView(log, flowPane));
			}
		}
		listView.setListData(logviewlist);
		Accordion.setHeaderData(listView, "Log");
		centerAccordion.getPanels().add(listView);


	}
Both FieldItemRender and LogItemRenderer follow your ListViewItemRenderer and most component
show up properly except the content of FlowPane.
I have no idea why the content in the FlowPane can't show up.
Any help?
Brendan   		 	   		   		 	   		  
Mime
View raw message