Skip to main content

Change image in viewer

Comments

7 comments

  • Gareth Evans

    Hi Berend, I think you could do this in a Set Form Element Property Activity to target the image form element Image URL property

    1
  • Ken Lyon

    Berend Veldkamp While we don't let you delete the footer, you can set visible = false to hide it. Your form might live forever, though. :)

    1
  • Berend Veldkamp

    @...  Ken Lyon  

    Thanks for the suggestions. I can indeed change the image on a Display Form, but that can only be done in response to an (external) event. And although a Display Form can listen to custom events, I don't think there is a way to raise one.

    I seems that the only way for this to work is to run the workflow again (with the new image as input argument). As far as I can see, this will kill the running workflow, and start a new instance. I tried this, and it works for a single image. However, if I have more than one, all instances of that workflow are killed, and only one is restarted :-(

    For context, what I have in mind is a tabbed interface with 8 tabs, and an image on each one. 

    I posted an idea

     

     

    0
  • Zack Robison

    I'm curious to flesh out the use case here a bit more, but I don't have much to add regardless.  Except in response to this part:

    “I can indeed change the image on a Display Form, but that can only be done in response to an (external) event.”

    I've had success updating forms across separate workflows by placing the form itself in application state, i.e. WF1 has a dropdown whose items change based on user input to WF2. I use Set App Data in WF1 with that form as the input then WF2 can access and modify the form with Get App Data.  I don't expect this would be an issue with multiple instances running but wouldn't be shocked to hear otherwise.

    I don't understand why you don't have eight images in your viewer and change them all with a Workflow, though.  

    1. Run Op “layout”: viewer.get-current-layout 
    2. Create Value “imgLayout”: =$layout.result.selectById('image-abcd1234')
      1. get the id from your .xml, or hit ctrl+shift+e in designer
    3. Create Value “imgConfig”: =$imgLayout.result.model
    4. Evaluate Expression: =$imgConfig.result.src = 'https://some.new.url/image.ext'
    3
  • Berend Veldkamp

    Zack Robison 

    I don't have 8 images and a workflow because I didn't know I could change the image in that way, which was my initial question :-)

    Thanks!

    1
  • Zack Robison

    My pleasure =D

    0
  • Gareth Evans

    Ahh, nice catch Zack Robison ! Passing the form state back was not something that immediately occurred to me.

    0

Please sign in to leave a comment.