15 Replies Latest reply on Jan 23, 2017 1:56 AM by ak-2 RSS
    vishp Explorer

    Input capable list using Repeater widget

    My understanding is that the Repeater is one widget that can be used to display an input capable list structure.  I have a service that returns a data shape based infotable.  How do I build an input capable list structure using this infotable?

      • Input capable list using Repeater widget
        paic Collaborator

        Absolutely, I actually did an example like this with a repeater widget. It isn't posted in Downloads.
        But how I have done it, is I have a ThingWorx DataTable. I use a service to retrieve the rows. Then I bind that to the repeater widget.
        The Mashup tied to the Repeater widget retrieves each row based on the Key but you could just as well have it display the Info table being passed in.
        To do the updates, I use a button that toggles a Session Parameter, which then fires a Service in the Parent mashup that contains the repeater widget to update the DataTable (Or any info table of data)

        I'm not sure if what I wrote makes sense, let me know if you need more information and How To.

         



        • Input capable list using Repeater widget
          vishp Explorer

          Thank you Pai, for all the help.  In your earlier reply, how would you use the button in the Mashup that is tied to the Repeater widget ?  In other words how would you detect that something changed ?   Will it fire the service in the parent for each line change ?

           



          • Input capable list using Repeater widget
            paic Collaborator

            Hi Vish, I use a button that toggles a Session Property in the parent mashup and then I use the Session Property Changed event to fire the actual table Add/Update inside the repeater mashup. This way I can trigger it outside of the repeater Mashup but have it act within it.

             



            • Input capable list using Repeater widget
              vishp Explorer

              Thank you for the reply Pai.  I do need some clarifications.  Is the button in the Mashup ?  If so, how is it fired ?  I would like capture the changes to the list as the user keys into a text box in the Mashup.   If you are using the Session Property Changed event on the parent, how are you passing the changed data to the service ?  I am using a Infotable in my example.

               



              • Input capable list using Repeater widget
                paic Collaborator

                My button triggers a service that checks the Session Property. If it is false it sets it to true and vice versa.

                 

                I have it outside of the repeater mashup. So in the mashup that is displayed in the repeater, I use the Infotable mashup parameter.
                Each line in the repeater displays a line of that Infotable that is read/updated to a corresponding input widget.
                Then on the push of the button, it will change the session property which then using the On Value Changed Event to trigger the Add/Update service.
                I can package up my example and put it up, it isn't the 'cleanest' example but it should give you a clear idea of how it is done, except it does impact your Session Properties (ThingShape GlobalSessionProperties)

                • Input capable list using Repeater widget
                  vishp Explorer

                  Please do provide me an example.  That will really help.
                  So you have a mashup parm of type Infotable.  I was using a Infotable column to pass between the repeater and the mashup.  Thank you

                   



                  • Input capable list using Repeater widget
                    paic Collaborator

                    Hi Vish, I put the example in our Downloads section. Please note that there are probably other ways to do this that might work even better. I believe I have some redundancy build into this example. It is called ThingWorx DataTable Editor using a Repeater Widget Example

                     

                    • Input capable list using Repeater widget
                      vishp Explorer

                      Appreciate your help.  Will let you know soon.

                       



                      • Input capable list using Repeater widget
                        vishp Explorer

                        Having trouble importing one of them "Data Table Thing: CGCEMTasksTable has an invalid data shape.

                         



                        • Input capable list using Repeater widget
                          vishp Explorer

                          Pai, I think I got this working.  However, it appears that I would need to use a button WITHIN the mashup to alert (using Session Updater prop) the parent (that contains the repeater) that a row was changed - and then the parent would process the "selected" row (session prop change event).   

                          Is there any other way to auto detect a change (row-col) without requiring the user to click the button ?

                           



                          • Input capable list using Repeater widget
                            paic Collaborator

                            Hi Vish, I just have the button in the Parent mashup, what happens on the Add/Update is that it will process the whole Infotable, so each row within the Repeater is Added or Updated if necessary.

                             

                            I haven't tried it this way but you can try using the Mashup Paramenter Changed event. Or the Selected Row changed from the parent.

                            • Input capable list using Repeater widget
                              vishp Explorer

                              Pai, it would help if I can look at your example.   I am getting an error when trying to import your example - "Data Table Thing: CGCEMTasksTable has an invalid data shape".  Let me know.  Thank you

                              • Input capable list using Repeater widget
                                vishp Explorer

                                Thank you for your help.  I got the repeater widget working for a long input capable list.  If the list size exceeds the repeater widget height, the scroll bar shows up.   If I scroll down and scroll back up, I am loosing any content that was keyed in before scrolling down.  How would I persist the content ?

                                • Input capable list using Repeater widget
                                  tonyc Newbie

                                  That behavior doesn't sound right - let me look into it and get back to you.

                                   

                                    • Re: Input capable list using Repeater widget
                                      ak-2 Newbie

                                      Hi Tony,

                                       

                                      I am also facing the same problem like  Viswesh Palasur.

                                      "How would I persist the content ? If the list size exceeds the repeater widget height, the scroll bar shows up.   If I scroll down and scroll back up, I am loosing any content that was keyed in before scrolling down."

                                       

                                      is there any update on this post?  Thank you.