You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by ccp999 <cc...@hotmail.com> on 2012/03/23 08:15:13 UTC
ScrollPane usage problem
Hi,
I was trying to use ScrollPane inside Accordion panels to display a list
view of data.
in my bxml file,
...
<Accordion bxml:id="centerAccordion">
<ScrollPane bxml:id="annotationsPanel" Accordion.headerData="%Annotations"
/>
</Accordion>
...
and inside my java file,
@BXML
protected ScrollPane annotationsPanel = null;
Component annotationPane = tabAdapter.getAnnotationPane();
annotationsPanel.add(annotationPane);
public Component getAnnotationPane() {
BoxPane bp = new BoxPane();
bp.setOrientation(Orientation.VERTICAL);
bp.getStyles().put("fill", true);
for (Annotate node : annotations) {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
AnnotateTablePane itemRenderer;
try {
itemRenderer = (AnnotateTablePane) bxmlSerializer
.readObject(getClass().getResource(
"../thumbnail/AnnotateTablePane.bxml"));
} catch (IOException e1) {
return null;
} catch (SerializationException e1) {
return null;
}
bp.add(itemRenderer);
}
return bp;
}
AnnotateTablePane.bxml is just a table pane with a group of components.
Despite all my effort, the content within the bp never shown up, unless I
change the ScrollPane to BoxPane. But then I will lost the view for large
list.
There must be something I missed. Please help!
Brendan
--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/ScrollPane-usage-problem-tp3850859p3850859.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
Re: ScrollPane usage problem
Posted by Noel Grandin <no...@gmail.com>.
You can't call add(Component) on a ScrollPane.
You need to call setView(Component), and there can be only one.
On 2012-03-23 09:15, ccp999 wrote:
> Hi,
>
> I was trying to use ScrollPane inside Accordion panels to display a list
> view of data.
> in my bxml file,
>
> ...
> <Accordion bxml:id="centerAccordion">
> <ScrollPane bxml:id="annotationsPanel" Accordion.headerData="%Annotations"
> />
> </Accordion>
> ...
>
> and inside my java file,
>
> @BXML
> protected ScrollPane annotationsPanel = null;
>
> Component annotationPane = tabAdapter.getAnnotationPane();
> annotationsPanel.add(annotationPane);
>
> public Component getAnnotationPane() {
>
> BoxPane bp = new BoxPane();
> bp.setOrientation(Orientation.VERTICAL);
> bp.getStyles().put("fill", true);
> for (Annotate node : annotations) {
>
> BXMLSerializer bxmlSerializer = new BXMLSerializer();
> AnnotateTablePane itemRenderer;
> try {
> itemRenderer = (AnnotateTablePane) bxmlSerializer
> .readObject(getClass().getResource(
> "../thumbnail/AnnotateTablePane.bxml"));
> } catch (IOException e1) {
> return null;
> } catch (SerializationException e1) {
> return null;
> }
> bp.add(itemRenderer);
> }
> return bp;
> }
>
> AnnotateTablePane.bxml is just a table pane with a group of components.
>
> Despite all my effort, the content within the bp never shown up, unless I
> change the ScrollPane to BoxPane. But then I will lost the view for large
> list.
>
> There must be something I missed. Please help!
>
> Brendan
>
>
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/ScrollPane-usage-problem-tp3850859p3850859.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.