cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

How to delete repeater single row ?

DT
12-Amethyst
12-Amethyst

How to delete repeater single row ?

Hi Everyone,

I have used repeater widget to show some name on selection of dropdown entry.
Now I want to delete a row from the repeater by clicking on repeater row.

I am using Thingworx 8.2 I know its too old version but I don't have option right now. I could not find any solution on it. If you guide the solution it will help me,

Please refer attachment

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaiChung
22-Sapphire I
(To:DT)

Sounds like you are making good progress, as I mentioned in my previous comment: "chain service invoke complete to a parameter change either mashup or session that goes back to the parent and there you can use mashup parameter value changed event to run the service to re-generate the repeater data."

So now within the repeater mashup as you click the x and do the delete, use that service's invoke complete to toggle some value either in mashup parameter or session to bring that back to the repeater's parent mashup to then using mashup parameter value changed event to trigger your 'add user' service

View solution in original post

13 REPLIES 13
PaiChung
22-Sapphire I
(To:DT)

The repeater itself also honors 'selected row'. Set 'Allow Selection' to true, then have a delete button outside the repeater and use the selected row to do the delete, then refresh.

Alternate would be to make sure that you pass some sort of 'index' into each repeated entry and have a delete button inside the repeated mashup that can use that to do the delete, and then you'll need to 'pass up' a refresh.

DT
12-Amethyst
12-Amethyst
(To:PaiChung)

Hi @PaiChung 

Yes I know taking delete button outside mashup it will work to delete selected row I don't want this.
I want to delete a row when I will click on X icon which is present in the repeater so that one name should be delete.

Or 

let me know if this requirement I can developed in the grid also I just want to delete a single name on the click of X icon.

Using grid or repeater is also fine but I am not sure whichever widget will run.

Appreciate your response.

PaiChung
22-Sapphire I
(To:DT)

You want to do this part then:

"Alternate would be to make sure that you pass some sort of 'index' into each repeated entry and have a delete button inside the repeated mashup that can use that to do the delete, and then you'll need to 'pass up' a refresh."

DT
12-Amethyst
12-Amethyst
(To:PaiChung)

Thanks @PaiChung 

But how the row will delete because delete button present inside repeater mashup so when I click on this button how the exact selected row will be deleted.

I have two column name which are:

name and keyvalue.

I am not aware how to delete selected row using button which present inside repeater mashup.
How it will delete ?

 

Please suggest the solution.

PaiChung
22-Sapphire I
(To:DT)

It's been a while since I've worked with a repeater, but I was thinking that x is tied to a service within the repeater child mashup that uses the keyvalue as an input parameter.

The keyvalue comes in from the mashup parameters.

DT
12-Amethyst
12-Amethyst
(To:PaiChung)

But X is the button which I have taken inside mashup and mashup parameters
is not bind or map with button then how we can pass this mashup parameter.

Also if I used button inside mashup to trigger some delete service but how
to pass selected row key value to that service so that selected row will be
delete.
Because using inside mashup how we can pass selected row key value to
delete service.
PaiChung
22-Sapphire I
(To:DT)

Inside the repeater the information is coming from the Mashup parameters, that's what you'd use vs. selected row.

DT
12-Amethyst
12-Amethyst
(To:PaiChung)

Thanks @PaiChung  

As of now I have got success to delete selected row but not getting success to refresh it when I click on X icon. It is not refreshing.

I have used auto refresh widget but did not get success.

 

Steps Followed:

  • I have bind selected row key value to delete service which are in the inside mashup
  • Mapped X icon click event to delete service
  • It is working to deleted selected row but not refresh the list after delete the row

Can you please tell me how to refresh it.

DT
12-Amethyst
12-Amethyst
(To:DT)

Hi @PaiChung 

Can you please tell me how I can refresh repeater using inside X button.
I am not getting success to refresh inside repeater mashup.

I appreciate your response.

PaiChung
22-Sapphire I
(To:DT)

The 'refresh' is basically a trigger event that reruns the service that generated the repeater data.

So if your x successfully triggers the delete, then chain service invoke complete to a parameter change either mashup or session that goes back to the parent and there you can use mashup parameter value changed event to run the service to re-generate the repeater data.

DT
12-Amethyst
12-Amethyst
(To:PaiChung)

Hi @PaiChung 

I have created a delete service which has one input and the selected row user from dropdown which having a unique key is map with this input.

Now I have connected  service invoke complete of delete service to add user service(addUser) which generate all data.

also connect the selected row change of addUser to delete service. So now whenever I have click anywhere in the row of repeater the row is deleted but I don't want this.

I want when I click on X button which is in the inside mashup the complete row should be deleted.
So I got success to delete row click on inside button but it is not refresh when I will click on the X button.

 

Can you please share some steps how to refresh the addUser service which will show all added user outside the mashup

PaiChung
22-Sapphire I
(To:DT)

Sounds like you are making good progress, as I mentioned in my previous comment: "chain service invoke complete to a parameter change either mashup or session that goes back to the parent and there you can use mashup parameter value changed event to run the service to re-generate the repeater data."

So now within the repeater mashup as you click the x and do the delete, use that service's invoke complete to toggle some value either in mashup parameter or session to bring that back to the repeater's parent mashup to then using mashup parameter value changed event to trigger your 'add user' service

DT
12-Amethyst
12-Amethyst
(To:PaiChung)

Hi @PaiChung  Thanks for your suggestions I did it. I can delete repeater row using delete button outside mashup.
Its working now,. 

Thanks

Top Tags