I’m new to Axure and am using Axure 8. The tree widget was not powerful enough so I have replicated a tree structure with a repeater that contains images and text. (thanks to those in this forum who have unknowingly helped me with this )
Question:
Can an outside widget extract the image name from the repeater and use it via a “set image” statement?
Background:
I also have multiple separate widget groups (image + text) that represent a breadcrumb. When the user selects a row in the tree I want the breadcrumb to show the image + text for the selected row and all of its parents.
I have been successful in doing a “set image” and “set text” from an interaction in the repeater. However this code is getting messy and would prefer doing the “set image” and “set text” from within an interaction in the group itself (outside the repeater). I have successfully done this with the text field using a global variable to hold the text. However doing the same thing for the image field doesn’t work. I get the name of the image but when I do the “set image” it doesn’t find it.
After doing some snooping around in the browser debugger it appears that Axure changes the name of the image to something like P0 or P1 or P2. I have no clue why they did this but it is what it is. The irritating thing is that if I use the path/names of “images/home/P2.png” and do the “set image” I get exactly what I hoped for.
Is there a better way to get the images from outside the repeater?
Note: I’m hoping to make this tree + breadcrumb something that my colleagues can use so snooping around in the debugger is not something I can ask them to do.
I faced the same problem. If you use the value from the repeater.item.data you can set an image by value but after copying the value to a global variable (or trying to access the image property via localvariable) always failed.
If there was a value like image.url or something like that I did never find it.
There is a workaround you can use. If you instead adding the image to the repeater-dataset build a master with the images stacked in a dynamic panel you can set the images inside and outside the repeater by the panel index or panel name. This index or panel name can easily be shared from inside to outside the repeater.
Thanks for the reply. I am a little uncertain about what you mean…
When you say “images stacked in a dynamic panel” are you saying that I should create a dynamic panel state for each image?
When you say “you can set the images inside and outside the repeater by the panel index or name”… how do you do this? (in the set image action I don’t see how to set an image to an image stored in a particular dynamic panel state).
I think it would help me a lot to see some code that does this.
you build a master containing a dynamic panel… lest say you have 10 states with 10 images.
if you now have as “image” data in the repeater nothing else then the number (index of the panel) or the panel name (State 1, State 2…) you can set the state of the panel by value.
if you need the image outside the repater you now dont need to copy urls or image names but only the index or the name of the dynamic panel state.
Thanks again for replying… I think I understand what you are saying. I build a master with a dynamic panel with my images (one image per state). I then include that master as a widget in my repeater. In the repeater’s OnItemLoad case, I set the dynamic panel state to the appropriate value.
I also include the master as a widget outside of my repeater. Then when the user clicks on a row in the repeater, in the OnClick case I save the dynamic panel index as a global variable. Then in the outside widget I use the global variable to show the corresponding dynamic panel state which then shows the appropriate image.
Still the only way? I get tons of limitations when trying to build a prototype with actual dynamic stuff. Would be nice if Axure made more possibilities for dynamic interactive stuff, instead of visually pleasing but very static stuff.