Tagify Remove

I can’t figure out how to pass the value of the item I’m removing from a tagify field to the server connect so I can delete it from the database.

I added the message so I could see what was coming out but get an error in the console.

bootstrap-modbox.min.js:30 Uncaught (in promise) Error: The “body” or “message” configuration option is required (string).
at new modbox (bootstrap-modbox.min.js:30:1251)
at bootstrap-modbox.min.js:12:1859
at new Promise ()
at #buildPromiseModal (bootstrap-modbox.min.js:12:1831)
at modbox.alert (bootstrap-modbox.min.js:41:620)
at bootbox.alert (dmxBootbox5.js:7:3611)
at n._execStep (dmxAppConnect.js:7:46750)
at dmxAppConnect.js:7:46179

Any pointers would be most appreciated!
Thanks.

Can anyone help on this? It appears that Tagify dmx-on:remove doesn’t work.

My process is slightly different. I don’t remove anything when a tag is removed, I process the array when the form is submitted and my SC script updates the field which is a JSON field so it just has the new, remaining tags in it.

If you store each one in a separate m2m record then I would delete them all when the form is submitted and then add the ones left again. Hope that makes sense!

Thanks @sitestreet. My tags are actually quite complex (multi levels) so I have a modal that opens up when the field gets focus to select/deselect as needed. That does as you suggest with deleting all the tags and add the ones left selected.

With this, however, I want the user to be able to just click the x on the tag to delete it quickly without opening up the modal. As I can’t get anything to happen when the x is clicked there’s no way to submit a form or run a server connect.

Aah, in that case it sounds like a bug needs squashing. I would submit a bug report.

1 Like

Yup. Changed to bug report.

I see no issue with passing the removed item value. Tested this and it works perfectly fine.
Are you sure you pass the removed item value when calling the dynamic event:

Hey Teodor. I don’t have that Remove Event in my data bindings.

Can you please send a screenshot of what exactly are you doing?

I have a tagify input field that is in a repeat.

                <input is="dmx-tagify" id="tagify_tags" name="tagify_tags" dmx-bind:data="sc_tags_select.data.query_all_tags" tag-text="tag" tag-value="tag_id" no-fuzzy-search="true" dmx-bind:value="tag_array" dmx-on:remove="run({'bootbox.alert':{message:`selectedValue`}})">

In the remove I want to delete the removed item from the database. Right now I’m just trying to get the value of the removed item into the message to confirm it’s working. I don’t have that Remove Event listed in the data bindings.

Also. I’m getting this first error on page load, and the second when I click on an item to delete it…

I still don’t see what exactly have you selected as a value for your remove dynamic event. Please provide some more detailed screenshots as it’s not really clear for me what are you doing exactly.

Where did this come from?? I don’t have this.

And FYI - the link to using the tagify component in the docs doesn’t work…

https://docs.wappler.io/t/using-the-tagify-component/40507

Well … it’s the event data you see when you select the dynamic event.

I still don’t understand what your issue is, actually.

Can you circle on my images where Remove Event is? Or give me some instructions on where I would find it?

Like I said, I don’t have Remove Event as an option in my data bindings.

Here’s what I’m doing. I have a tagify input field for which I have a remove dynamic event.

I’m using a Flow to show an Alert.

I’m trying to bind the removed items id to the message but there is no Remove Event option as you showed in your image.

I tried using Selected Value of the Tagify input field…

But that gives me this error in the console.

Let’s start from the beginning.
Why do you even use an inline flow here? Why not call your action directly?

I did it that way originally because I have a few things I need to do with that ID, including running some custom javascript. I just changed that to a simple action and the Remove Event is there. Phew.

I can probably work around my other things by using the success from a server action but shouldn’t that Remove Event be in the data bindings in a flow just like it is in the simple actions?

Ok i see what you mean, seems in the flows the $event data is not available in the data picker.
You can still access it like: $event.value in the data picker (code view):

We will fix this in the upcoming update(s).

1 Like