I have a context like this and its working:
Do you know what is necessary to when a user clicks in a word in the input text open a popup to edit that specific word? For example if the user clicks hover the word "Lorem" it should open a popup and the user can change to "Lorem2", like:
Hey,
I can think of 2 ways of achieving this:
1) Splitting the entire text by " " and displaying a list of single words. Each single word then has its own click event, allowing you to change it
2) With JS you can determine the clicked word using a script such as this one. From there you'll be able to edit your word with some additional logic.
Cheers,
David
Hi! Can you explain better the first approach? Thanks!
Hey Jake, check my example here. Also attached the OML.
Thanks! In the case where I have a text stored in the database do you know how to in the save action update the text with the new word? That is, the text stored in database should be equal only with the updated word different.
Maybe is easier to explain with a image the context I have now with your solution:
In the save action you can update the list with the new value and then:
1) use the String_Join action from the Text extension to join all the list elements again OR
2) concatenate all the list elements in a for each cycle with " "
Afterwards you can update the record in the DB.
Hi Jake B,
I have made one smaple oml for you based on requirment.
You can change it accordingly.
like clik on edit button it will open one pop up for descriptio and double click on words it will create a input box and you can chnage it from new words
Sample app- Change Word
Hope this will help you.
Regards
Rahul
Hi, can you explain better how it works? It seems that the example is not working.
Hi Jake,
is there a reason why you can´ t let the user just edit the text, why the clicking and the separate input to change a single word ?
This is awkward for the user and a lot of extra coding and testing work.
If it is an attempt at controlling what sections of a text are up for change, it will probably only work in simple case, as words of a sentence influence other parts of it.
You also risk re-inventing functionality that already exists in word processing software.
Dorine