Results 1 to 22 of 22

Thread: Finding data from one Repeater to add to second Repeater

  1. #1
    Sifu
    Join Date
    Jul 2013
    Location
    Chicago, IL
    Posts
    331
    Thanks
    11
    Thanked 74 Times in 68 Posts


    Question Finding data from one Repeater to add to second Repeater

    I'm working on a page that has two lists of items, each item in the list has a few attributes that I'm tracking in various columns within the repeater. I have no trouble adding and removing items from a single repeater. What I'm stuck on is how to read the data from one repeater and use those values to add to the second repeater. Both repeaters use the same columns.

    When I add an item to selected from one repeater, the other doesn't seem to be able to read from selected, leading me to believe I'm either doing it wrong or "selected" is unique to each repeater. I also don't see a way to set the value of a variable to be equal to any of the attributes of an item, allowing me to use variables to transfer the data.

    Imagine a button on each repeater item that when clicked will remove it from that repeater, and add a new item to the other repeater with the same data.

    Any ideas or insights? Thanks!

  2. #2
    Sifu
    Join Date
    Dec 2011
    Location
    Chicago, IL
    Posts
    676
    Thanks
    95
    Thanked 136 Times in 113 Posts


    My Twitter My LinkedIn
    Hey nkrisc,

    Fellow Chicagoan . Nice! Do you have a sample file to share?

    I wonder if Jim Bunzol's file here will help Example for Add/Remove from a repeater. It explains the add/remove concept.

    light_forger
    Svetlin Denkov
    User Experience Professional
    Twitter: @svetlindenkov LinkedIn: http://linkd.in/JbZDre
    Meetup: http://bit.ly/1qITjzK

  3. #3
    Sifu
    Join Date
    Dec 2011
    Location
    Chicago, IL
    Posts
    676
    Thanks
    95
    Thanked 136 Times in 113 Posts


    My Twitter My LinkedIn
    Hey nkrisc,

    I was able to mock something up for you, but it is not perfect since it assumes copying of items one at a time.

    Currently Axure does not allow for copying of Selected Items from one repeater to another. I could not figure out a way to iterate over all items in the Selected Items collection so that I can copy them e.g., "for each item in Selected Items of Repeater 1 copy to Repeater 2". I even tried using global and local variables for "Add items" but there is still no way to access the Selected Items collection. It seems to be a black box.

    Also, due to the nature of repeaters, newly added items get appended at the end. There are no options (that I know of) as of now that allow to specify which index location an item gets copied/added to.

    The solution here may not work if you have entries in the repeaters that use images or more complex data...unless image path names can be passed via a variable. In the future, best case scenario is Axure includes a Copy Repeater Item action which copies the item as an object. Just my 2 cents!

    light_forger
    Attached Files Attached Files
    Svetlin Denkov
    User Experience Professional
    Twitter: @svetlindenkov LinkedIn: http://linkd.in/JbZDre
    Meetup: http://bit.ly/1qITjzK

  4. #4
    Sifu
    Join Date
    Jul 2013
    Location
    Chicago, IL
    Posts
    331
    Thanks
    11
    Thanked 74 Times in 68 Posts


    Just got back from vacation, thanks for the reply!

    Looking at your file, your first page is the road I ultimately started heading down: using variables to read from the text widgets (which are set based on the table of the repeater - a bit circuitous, really). It would be nice to have the ability to directly copy a repeater item from one to another. Even a "move" action with the option to "cut" or "copy" it.

    When looking at your second page, I get some very strange results. I haven't been able to discern any pattern or cause and effect, but using the buttons seems to cause items to randomly disappear when being copied over, only to seemingly just as randomly reappear. After playing with it, I eventually had only 2 items displayed, and then shortly after all 6 were shown. Have you noticed this as well?

  5. #5
    Sifu
    Join Date
    Dec 2011
    Location
    Chicago, IL
    Posts
    676
    Thanks
    95
    Thanked 136 Times in 113 Posts


    My Twitter My LinkedIn
    Nkrisc,

    Welcome back! I agree with your suggestions. I requested something similar already: Feature Wish: Action for Copying a Repeater's Selected Items

    Hmm, this is strange. I have not been able to reproduce this. I am attaching a zipped .swf demo of the target interaction. Unzip it and drag and drop it in your favorite browser. If you have he latest Flash player it should play fine.

    Are the steps that you are using different the one shown in the video? If you are trying to do multi-select and copy, I don't think it would work!

    light_forger
    Svetlin Denkov
    User Experience Professional
    Twitter: @svetlindenkov LinkedIn: http://linkd.in/JbZDre
    Meetup: http://bit.ly/1qITjzK

  6. #6
    Newbie Level
    Join Date
    Jul 2013
    Location
    London
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts


    +1 for this feature. If anyone figures out a way of accessing an image stored in a repeater on a page other than that of the repeater, I'd be very grateful to know.

    EDIT: after playing with this for 24 hrs, the best way I've found is to set the app up as a single dynamic panel, with its state1, state2 etc each containing a page of the app. The reason being that interactions can access and edit data stored in other states of the same panel but not data stored on separate pages, I think....
    Last edited by casdavies; 07-29-2013 at 02:30 PM.

  7. #7
    Axure Fu Master
    Join Date
    Jan 2012
    Location
    Tel Aviv, Israel
    Posts
    107
    Thanks
    36
    Thanked 30 Times in 17 Posts


    My LinkedIn
    Quote Originally Posted by light_forger View Post

    Also, due to the nature of repeaters, newly added items get appended at the end. There are no options (that I know of) as of now that allow to specify which index location an item gets copied/added to.


    light_forger
    Hi, interesting post.
    Here's my idea of adding an item at a specific location in the repeater. Lets say my repeater items are indexed 1,2,3, then if I add an item with index 0, and then add sorting to the repeater, it will be added as the first element. If I want to add an item between 2 and 3 - I'll add it with index 2.5 (that is - (2+3)/2).
    To add to the start / end of the list, we should also maintain a variable to hold the index of the first / last item, and update it after every add.

    I haven't tried this approach fully, but I think it should work...

  8. #8
    Apprentice Level
    Join Date
    Jul 2013
    Location
    Hamburg, Germany
    Posts
    22
    Thanks
    1
    Thanked 9 Times in 6 Posts


    Hi everyone,

    I don't have time to try this out myself right now, but here's an idea that you could explore:

    The OnLoad event of any repeater widget is actually not just triggered on the first load (page load). It is also triggered whenever the repeater changes, e.g. when filtes are set/removed.

    Using this "feature", you might actually be able to iterate over all repeater items. Simply add an item to your second repeater using the data of the first repeater in this "for-loop". This part I have actually done already by using a central database-repeater to fill multiple other repeaters with the same data on page load. It works, but I can't show it because it's a client project.

    You should even be able to only copy selected items through if-statements in the repeater OnLoad-loop.

    Now the trick if course is that you don't actually want all this stuff to happen every time the repeater OnLoad is triggered (e.g. on page load or on changes). My idea here would be setting a global variable and checking it in the OnLoad-loop. Like so:

    #where your copy action is triggered:
    set CopyAction to true # indicates we're now doing the copy thing
    add/remove filter on repeater1 # just do something that triggers the repeater OnLoad event
    set CopyAction to false # indicates we're now done with the copy thing

    # inside the repeater OnLoad:
    if CopyAction == true # so that this is only executed when we wanna do the copy thing
    add item to repeater2 using repeater1 values

    So I havn't tested this at all, but I know that some aspects of it work and have used them. Feel free to give this a try and post your results. I'd love to know if it works and see a demo, but I don't have the time atm.

  9. #9
    Sifu
    Join Date
    Jul 2013
    Location
    Chicago, IL
    Posts
    331
    Thanks
    11
    Thanked 74 Times in 68 Posts


    Quote Originally Posted by Shiraluk View Post
    Hi, interesting post.
    Here's my idea of adding an item at a specific location in the repeater. Lets say my repeater items are indexed 1,2,3, then if I add an item with index 0, and then add sorting to the repeater, it will be added as the first element. If I want to add an item between 2 and 3 - I'll add it with index 2.5 (that is - (2+3)/2).
    To add to the start / end of the list, we should also maintain a variable to hold the index of the first / last item, and update it after every add.

    I haven't tried this approach fully, but I think it should work...
    I think indexing would be very useful. However a more practical method for controlling the location of the copied item would be to simply identify an index location in the target repeater and simply ask whether it should be before or after. Same effect, less math

  10. #10
    Sifu
    Join Date
    Jul 2013
    Location
    Chicago, IL
    Posts
    331
    Thanks
    11
    Thanked 74 Times in 68 Posts


    Quote Originally Posted by jaern View Post
    Hi everyone,

    I don't have time to try this out myself right now, but here's an idea that you could explore:

    The OnLoad event of any repeater widget is actually not just triggered on the first load (page load). It is also triggered whenever the repeater changes, e.g. when filtes are set/removed.

    Using this "feature", you might actually be able to iterate over all repeater items. Simply add an item to your second repeater using the data of the first repeater in this "for-loop". This part I have actually done already by using a central database-repeater to fill multiple other repeaters with the same data on page load. It works, but I can't show it because it's a client project.

    You should even be able to only copy selected items through if-statements in the repeater OnLoad-loop.

    Now the trick if course is that you don't actually want all this stuff to happen every time the repeater OnLoad is triggered (e.g. on page load or on changes). My idea here would be setting a global variable and checking it in the OnLoad-loop. Like so:

    #where your copy action is triggered:
    set CopyAction to true # indicates we're now doing the copy thing
    add/remove filter on repeater1 # just do something that triggers the repeater OnLoad event
    set CopyAction to false # indicates we're now done with the copy thing

    # inside the repeater OnLoad:
    if CopyAction == true # so that this is only executed when we wanna do the copy thing
    add item to repeater2 using repeater1 values

    So I havn't tested this at all, but I know that some aspects of it work and have used them. Feel free to give this a try and post your results. I'd love to know if it works and see a demo, but I don't have the time atm.
    What's the advantage to using the OnLoad event to handle the copying?

  11. #11
    Axure Fu Master
    Join Date
    Jan 2012
    Location
    Tel Aviv, Israel
    Posts
    107
    Thanks
    36
    Thanked 30 Times in 17 Posts


    My LinkedIn
    Quote Originally Posted by nkrisc View Post
    I think indexing would be very useful. However a more practical method for controlling the location of the copied item would be to simply identify an index location in the target repeater and simply ask whether it should be before or after. Same effect, less math
    Hi nkrisc,
    I'm not sure how this can be achieved - how do you identify a location in the target repeater? For example, how can you reference the 3rd item?
    And following that - how can you now insert an item in the 4th location?

    Can you elaborate please?

  12. #12
    Apprentice Level
    Join Date
    Jul 2013
    Location
    Hamburg, Germany
    Posts
    22
    Thanks
    1
    Thanked 9 Times in 6 Posts


    Quote Originally Posted by Shiraluk View Post
    Hi nkrisc,
    I'm not sure how this can be achieved - how do you identify a location in the target repeater? For example, how can you reference the 3rd item?
    And following that - how can you now insert an item in the 4th location?

    Can you elaborate please?
    This most likely isn't achievable with the current repeater widget.

    I reckon he was suggesting in which direction the repeater widget should be developed in the future, so that this might become possible.

  13. #13
    Apprentice Level
    Join Date
    Jul 2013
    Location
    Hamburg, Germany
    Posts
    22
    Thanks
    1
    Thanked 9 Times in 6 Posts


    Quote Originally Posted by nkrisc View Post
    What's the advantage to using the OnLoad event to handle the copying?
    I think you misunderstood what I was trying to say. Today I found some time to try my idea out. And it does work. I hope this makes it a bit clearer.

    light_forger has shown how to copy/move single items from one repeater to the other. That's fairly simply using global variables to store the data. For multiple items this solution doesn't work.

    However, I have found a solution to handling multiple repeater items at the same time. I took light_forger's prototype and added a third page that supports selecting multiple items on the left repeater and copying them to the right repeater. Just one way for now, it's enough to show the principle.

    You can see the prototype here: Prototype on AxShare
    Axure file: RepeaterCopy.rp

    To understand how it works, best look at the Axure file. It follows the principles I tried to outline in my earlier post:
    The button does the following:
    - set copyInProgress variable to true
    - remove all filters from R1 (no effect, only that it triggers R1's OnLoad Events)
    - wait for 1ms (this doesn't make any sense but it doesn't work without)
    - set copyInProgress variable to false
    In the R1.OnLoad the following is done:
    - If copyInProgress is true AND the item is selected
    - Add an item to R2 using the values from R1 (e.g. [[item.Numbers]])
    Last edited by jaern; 04-16-2014 at 06:35 AM.

  14. The Following 2 Users Say Thank You to jaern For This Useful Post:

    Shiraluk (08-03-2013), Thurstanh (07-21-2014)

  15. #14
    Apprentice Level
    Join Date
    Jul 2010
    Posts
    90
    Thanks
    7
    Thanked 7 Times in 3 Posts


    Brilliant! This might be just what I was looking for to simulate my Dockable Tabs (Simulating "Dockable Tabs"). I'm going to give this a shot using onDrag events instead of on the button click .. I'll let you know how it goes ..

    :-)

    RL

  16. #15
    Sifu
    Join Date
    Jul 2013
    Location
    Chicago, IL
    Posts
    331
    Thanks
    11
    Thanked 74 Times in 68 Posts


    Ah, thanks jaern, your description cleared it up for me. I understand now. Very clever.

  17. #16
    Newbie Level
    Join Date
    Aug 2013
    Location
    Israel
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts


    My LinkedIn

    Unhappy How to draw a Repeater based on another Repeater's data?

    Quote Originally Posted by nkrisc View Post
    Ah, thanks jaern, your description cleared it up for me. I understand now. Very clever.
    Hi,

    I guess this is the purely Data/View separation that I am missing.
    I would like to have 1 single DataSet (implemented inside a repeater) and draw diferent Views accordign to it.
    Example: Have a shop inventory list and being able to draw an ItemList page and a DetailedItem page from same DataSet.

    Can it be done using Repeaters?

    Thanks,

    -ShirAloni

  18. #17
    Apprentice Level
    Join Date
    Feb 2011
    Location
    Prague
    Posts
    89
    Thanks
    1
    Thanked 40 Times in 22 Posts


    My Twitter My LinkedIn
    ShirAloni:

    0) put information you need display on list page and detail page into repeater
    1) put repeater to master
    2) on list page, display master with information you need trough the repeater function
    3) on detail page, put master to dynamic panel and hide it
    4) when go from list to detail, save row identificator to variable
    5) on detail, get information for detail from hidden repeater by indetifictor and load them into widgets in detail page

  19. #18
    Apprentice Level
    Join Date
    Feb 2011
    Location
    Prague
    Posts
    89
    Thanks
    1
    Thanked 40 Times in 22 Posts


    My Twitter My LinkedIn
    Shiraluk: You can identify position in repeater (think in source, not sorted or filtered). But add item there would be problem (maybe, i didnt try this).

    Look at this, where can you find item by order count https://dl.dropboxusercontent.com/u/.../004/home.html

    RP: order.rp

  20. The Following User Says Thank You to melibrion For This Useful Post:

    Shiraluk (08-10-2013)

  21. #19
    Axure Fu Master
    Join Date
    Jan 2012
    Location
    Tel Aviv, Israel
    Posts
    107
    Thanks
    36
    Thanked 30 Times in 17 Posts


    My LinkedIn
    Thanks melibrion, I'll definitely use this trick!

  22. #20
    Newbie Level
    Join Date
    Aug 2013
    Location
    Israel
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts


    My LinkedIn
    Thanks melibrion,

    I am still missing a link in the procedure you have suggested: How can I SetText on Widget (not inside a Repeater) using Repeater fiedls?

    Thanks,

    -Shir

  23. #21
    Apprentice Level
    Join Date
    Feb 2011
    Location
    Prague
    Posts
    89
    Thanks
    1
    Thanked 40 Times in 22 Posts


    My Twitter My LinkedIn

  24. The Following 2 Users Say Thank You to melibrion For This Useful Post:

    ShirAloni (08-11-2013), Shiraluk (08-11-2013)

  25. #22
    Newbie Level
    Join Date
    Aug 2013
    Location
    Israel
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts


    My LinkedIn
    Wow. What a trick !

    So the Master Repeater is not actually sharing his Data across Views but rather trasfer the right parameters through Global Parameters.
    Thanks !!!

    I wish Axure will enable the Repeater to be a DataSet and that other widgets could just access it without tricks

Similar Threads

  1. I want to import a data set into the repeater...
    By cdriesbach in forum Repeater Widget
    Replies: 23
    Last Post: 01-22-2014, 07:43 PM
  2. Example for Add/Remove from a repeater
    By light_forger in forum Repeater Widget
    Replies: 11
    Last Post: 11-15-2013, 09:50 AM
  3. (Implemented) Repeater is not responsive
    By DavidMorgan in forum Technical Troubleshooting
    Replies: 5
    Last Post: 10-04-2013, 12:00 PM
  4. Sort & Filtering the Repeater
    By Paul in forum Repeater Widget
    Replies: 16
    Last Post: 09-16-2013, 01:11 AM
  5. Number of item per row in repeater is max 5
    By melibrion in forum Technical Troubleshooting
    Replies: 0
    Last Post: 07-08-2013, 07:15 AM

Search Engine Optimization by vBSEO 3.6.0 PL2