# no operation cameraRoll

**URL:** <https://forums.fusetools.com/t/no-operation-cameraroll/1664>\
**Category:** How-to Discussions\
**Created:** [March 23, 2017, 2:25pm UTC](https://forums.fusetools.com/t/no-operation-cameraroll/1664 "2017-03-23T14:25:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![operate2v](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/operate2v/32/627_2.png) [@operate2v](https://forums.fusetools.com/u/operate2v)\
**Post date:** [March 23, 2017, 2:25pm UTC](https://forums.fusetools.com/t/no-operation-cameraroll/1664/1 "2017-03-23T14:25:26Z")

</div>

hi!

Every time I click on the Panel, getImage () is executed to change the picture.

However, the change is made only once in the first place. Not more than two times.

I also want to run it only when I click on the Panel,  
However, it runs every time the app is run.  
It is executed regardless of clicking the Panel.

Can I get help?

```auto
  <DockPanel Dock="Top" Margin="0,30,0,0">
              <Text Dock="Top" Value="Image" Font="FontNanumGothic" FontSize="13" />

              <Circle Dock="Top" Width="60" Height="60">
                  <ImageFill File="{img}" WrapMode="ClampToEdge"/>
              </Circle>

              <Panel Dock="Top" Alignment="Center" Width="100" Height="40" Color="Red">
                  <Text Value="ok" FontSize="11" TextColor="White" Clicked="{cameraRoll}"/>
              </Panel>
          </DockPanel>

```

```auto
var img = Observable('Assets/Images/sidebar_bg.png')
var i = 0

cameraRoll.getImage()
    .then(function (image) {
      console.log('success : ' + image.value)
      img.value = image
    }, function (error) {
      console.log('fail')
    })

module.exports = {
  cameraRoll: cameraRoll.getImage,
  img: img
}

```

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [April 26, 2017, 7:05am UTC](https://forums.fusetools.com/t/no-operation-cameraroll/1664/2 "2017-04-26T07:05:58Z")

</div>

Hi operate2v,

sorry for a delayed response.

The cause of issue you’re describing is quite straight-forward. In your JavaScript code, you execute the `cameraRoll.getImage()` - it’s not a function definition, it is the actual call. So instead your code should look something like this:

```auto
var imgPath = Observable("");
function getImage() {
    cameraRoll.getImage()
    .then(function(i) {
      console.log("success : " + JSON.stringify(i));
      imgPath.value = i.path;
    }, function (error) {
      console.log("failed with: " + error.message);
    });
}
module.exports = {
    imgPath: imgPath,
    getImage: getImage
};

```

and in UX:

```auto
<Circle Dock="Top" Width="60" Height="60">
    <ImageFill File="{imgPath}" WrapMode="ClampToEdge" />
</Circle>

<Panel Dock="Top" Alignment="Center" Width="100" Height="40" Color="Red">
    <Clicked>
        <Callback Handler="{getImage}" />
    </Clicked>
    <Text Value="ok" FontSize="11" TextColor="White" />
</Panel>

```

Hope this helps!
