Gabriel95 / scalafx

Automatically exported from code.google.com/p/scalafx
Other
0 stars 0 forks source link

scalafx.scene.control.Pagination PageFactory is not working #39

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use the following snippet to create pagination control:

    //Images to load pages
    val images = new Array[Image](7)

    for (i <- 0 until 7) {
      val ipStream=this.getClass.getResourceAsStream("animal" + (i + 1) + ".jpg")
      images(i) = new Image(ipStream)
    }

    val indexToNode = (index: Int) => {
      new VBox() {
        content = List(new ImageView(images(index)))
      }
    }

    //Pagination with 7 pages and index starts at zero
    val pagination = new Pagination(7, 0) {
      pageFactory = indexToNode
    }

What is the expected output? What do you see instead?
I would expect 7 images posted inside VBox control and pagination to see each 
image one at a time. But i dont see any images, instead i see only buttons 
numbered from 1 to 7.

What version of the product are you using? On what operating system?
1. Import Scala library 2.9.3
2. Add Scalafx-1.0-SNAPSHOT.jar in the path.
on Windows Vista Business Operating System.

Please provide any additional information below.
PageFactory is not at all called when i tried to debug. It is supposed to be 
having a callback method that takes integer and returns a Node. Seems its not 
invoked.

Original issue reported on code.google.com by abuabdu...@gmail.com on 25 Feb 2013 at 7:55

GoogleCodeExporter commented 8 years ago
Solved. See Revision da580c9fdb8 ( 
https://code.google.com/p/scalafx/source/detail?r=da580c9fdb89f00a53dc831f22677c
f8fdb0ad1b )

Original comment by rafael.a...@gmail.com on 30 Mar 2013 at 2:12