[Tagify] No event submitted when the web block is inside a record list

Forge Component
(4)
Published on 2019-11-15 by Afonso Carvalho
4 votes
Published on 2019-11-15 by Afonso Carvalho

Hello. 

I've added the web block to a record list, but when the tag field changes, no event is triggered. 

Think this might have something to do with the web block runtimeId, but couldn't understand the problem. 

Hi Luiz,

Not a direct answer to your question, but did you consider to use the standard OutSystems UI Drop-down Tags widget

https://outsystemsui.outsystems.com/OutSystemsUIWebsite/PatternDetail?PatternId=35

Regards,

Daniel

Hi Luiz,

I'll investigate this and will let you know - the webblock RuntimeId is already being used precisely to accomodate the use case of several blocks in the same page.

Daniël, while the OutSystems provided component is a possibility, it's based on the Choices library, and it doesn't seem as flexible as Tagify. The use case of tag editing, for instance, doesn't seem available out of the box.

Ok. Thank you very much. I'm waiting. 

Afonso Carvalho wrote:

Daniël, while the OutSystems provided component is a possibility, it's based on the Choices library, and it doesn't seem as flexible as Tagify. The use case of tag editing, for instance, doesn't seem available out of the box.

Hi Afonso, thanks for explaining I wasn't aware of that.

Luiz, I've tried reproducing this but I'm not having much luck. I've placed the Tagify webblock in a RecordList and Events are being triggered and received correctly, I can see them while debugging.

Could you go over this module (in the HomePageList screen) and confirm that this is what you're attempting to implement?


Daniël Kuhlmann wrote:

Hi Afonso, thanks for explaining I wasn't aware of that.

No problem. I did some investigation to implement this for a project, and while the OutSystems component is good, it might not cover every use case. I also like Tagify because the library developer is very dedicated and will respond to just about every Github issue.


Ok. I'll try it now. Thank you.


I still can't get it to work. I think my scenario is different, and I didn't explain it well. 

I've got an entity (Publication) that should relate to multiple tags and tags that relate to multiple Publications. 

So I've created an intermediary entity (TagData), to enable this many to many relationships. 

In a web screen, I've added the record list of Publications and added a new web block that contains the Tagify element.

The list passes the Publication ID to the web block, so I can retrieve the tags already applied to it in the preparation flow and populate Tagify.  

In this case, I couldn't trigger any event. 

Afonso Carvalho , did you manage to check this? I'm stuck.

I still can't get it to work. I think my scenario is different, and I didn't explain it well. 

I've got an entity (Publication) that should relate to multiple tags and tags that relate to multiple Publications. 

So I've created an intermediary entity (TagData), to enable this many to many relationships. 

In a web screen, I've added the record list of Publications and added a new web block that contains the Tagify element.

The list passes the Publication ID to the web block, so I can retrieve the tags already applied to it in the preparation flow and populate Tagify.  

In this case, I couldn't trigger any event. 



I haven't managed to sit down and create a module like this yet - if I understand correctly, you're using a List with your Publications in a screen, and then you have a webblock of your own inside the List that implements the Tagify webblock. Right off the bat, I don't really see anything wrong with it.

Do you need the PublicationTags block between the List and the Tagify block? Have you tried implementing Tagify directly on the List?

I'll try and get a module done and I'll share it so you can compare it with your implementation.

I've tried to add the Tagify block directly but got stuck on how to save those tags added to a specific list item. Assumed that if I added the Tagify block to another block, I could isolate the list item (by passing it's ID to the block) and manage to save those tags.

Afonso Carvalho wrote:

I haven't managed to sit down and create a module like this yet - if I understand correctly, you're using a List with your Publications in a screen, and then you have a webblock of your own inside the List that implements the Tagify webblock. Right off the bat, I don't really see anything wrong with it.

Do you need the PublicationTags block between the List and the Tagify block? Have you tried implementing Tagify directly on the List?

I'll try and get a module done and I'll share it so you can compare it with your 

Sorry to insist, but anything on this?

You don't have to apologise - I just wish I could get back to you with these answers faster. I built a very simple implementation with a wrapper webblock that takes the current List line as an input and sends an Event to the screen.

I've tried debugging and both Events trigger correctly (the inner Event from Tagify to the wrapper webblock, and the wrapped Event to the main screen) - you can see them both happening in debug, just search for "Debug Node" in the Module.

Hi, Afonso. 

I was able to reproduce the behavior using Table Records, just like in your example. 

Unfortunately, my project uses List Records to handle a more user-friendly layout. In this case, couldn't get any event. 

There's even no feedback related to Ajax Wait. It seems like nothing is happening. 

Solution

I think I've narrowed down the cause, just don't know why it's causing it. It's this Advanced Bulk Selection Button: 

It was missing the TableRecordsWidgetID attribute: 

I simply added the widget ID and the event could be triggered again. Some kind of conflict.

In reality, It was all a mess... added this widget instead of the normal checkbox one. 


It's all good now. Thank you Afonso Carvalho and Daniël Kuhlmann.

Solution

Weird. Could it have been causing some javascript error? I should've asked about your browser console before all of this.


Regardless, glad you sorted it out, and thank you for your interest in the component!