RadToastNotification (Chat Template) - Add hidden input

2 Answers 52 Views
ToastNotificationManager
Alessandro
Top achievements
Rank 1
Iron
Iron
Iron
Alessandro asked on 18 Jan 2024, 11:48 AM

Hi,

is it possible to add a hidden input in a toast notification xml, like the one in html?

something like:  "<input id=\"AnswerTo\" title=\"Rispondi a...\" defaultInput=\"" + _sender + "\" type=\"text OR hidden\" visible=\"none OR false\">"

The goal I want to achieve is to pass text variables within the ToastNotification preventing editation from the user...

Thank you

2 Answers, 1 is accepted

Sort by
0
Accepted
Alessandro
Top achievements
Rank 1
Iron
Iron
Iron
answered on 19 Jan 2024, 04:05 PM

Ok, finally I got a solution:

the "hidden" field can be inside the arguments of the "actions" of the xml as this:


    xml += "<action content=\"Send\" hint-inputId=\"AnswerBox\" activationType=\"background\" arguments=\"argSendPress&amp;originalMsgFrom=" + _sender + "\" />";
Now I am able to send unmodificable data within the notification in a format like the _GET of html.
0
Dinko | Tech Support Engineer
Telerik team
answered on 19 Jan 2024, 12:52 PM

Hi Alessandro,

I am not sure what you mean by hidden input. If you want to remove a textbox depending on some condition, you can create several templates and show the one that is currently needed. This is demonstrated in the Adding Toast Notifications Programmatically help article. You can add as many templates as you want and show the one with the required collection index.

If this is not what you are looking for, may I ask you to share some mode details, regarding your requirement?

Regards,
Dinko | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Alessandro
Top achievements
Rank 1
Iron
Iron
Iron
commented on 19 Jan 2024, 03:40 PM

Hi Dinko,

well, no, I don't want to remove a tasxtobox depending on condition.
What I wanto is a beavior like the <iput type="hidden" value="something"/> of html, I'll try to explain:

I need to store text data inside a chat notification, so the user when prompted can add text to the "visible" field to send as answer, but also a "hidden" field that can store the (e.g.) user id that sent the original message...

In html i can do something:

<form action="someAction">
<input type="text" id="myanswer">
<input type="hidden" id="answerTo" value="theIdOfAnotherPerson">
<input type="submit">
</form>

But in a toast xml I can "emulate" only the <input type="text ...>.

What I wanto to achieve is transmit invisible and unmodificable data within the notification.

Thank you

Tags
ToastNotificationManager
Asked by
Alessandro
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Alessandro
Top achievements
Rank 1
Iron
Iron
Iron
Dinko | Tech Support Engineer
Telerik team
Share this question
or