Greetings,
I'm working on on app where the user will be presented with a list of pictures. Each picture has an associated label and progress bar.
When the user clicks on a picture, a new window will open up with a bigger view of the picture and a button to like the picture. When this button is clicked, I would like the progress bar associated with the picture in the previous window to be updated. How can I go about implementing this?
Side note: I see this being done in the Google+ app for Android where if I open a post and +1 it, the button changes within the post view as well as within my stream view, all without refreshing the stream.
Thanks.
2 Answers
Hi,Kevin Sheppard
I think you need to make function for that on click event close that window and call that function which is created in previous window and put your progress code for update inside that function.Best luck
After doing some fiddling, I was able to mock up a small JS application to demonstrate (and solve) my question. You can find it here: http://jsfiddle.net/kshep92/XZMXm/2/
In the app, a series of buttons are created using a loop. These buttons will represent my pictures. As each button is created, it creates a click handler, which creates another button. This sub-button represents the window I want opened. When the sub-button is created, it is given a click handler which changes the label of its parent button and only its parent button. This will represent the updating of the progress bar when the button in the other window is clicked.
The example code is not perfect, but it sure helped me get a good start on wrapping my head around the concept.
Thanks Nitin for all your help!
Your Answer
Think you can help? Login to answer this question!