Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Zhou Shuai
5
Views
2
Comments
how to use JS in outsystems
Question
As subject, I don't known how to get the "id" or "class" of one widget
Hélio Dolores
Staff
Hi Zhou,
Welcome to the OutSystems community!
When you name an UI object (e.g. Container) you can reference it on the javascript (jquery) by doing something like this (on an unexcaped expression):
"<script> alert($('#"+ObjectName.Id+"').text());</script>"
- ObjectName.Id will represent the generated runtime id for that object.
You can also add a class in the "Style" attribute of the object and do something like:
"<script> alert($('.MyClassName').text());</script>"
If you are coding the javascript on the block/page javascript you have to pass this Id to the method, or use the class.
I hope it helps.
regards,
HD
1 reply
15 Aug 2014
Show thread
Hide thread
Zhou Shuai
Hélio Dolores
wrote:
Hi Zhou,
Welcome to the OutSystems community!
When you name an UI object (e.g. Container) you can reference it on the javascript (jquery) by doing something like this (on an unexcaped expression):
"<script> alert($('#"+ObjectName.Id+"').text());</script>"
- ObjectName.Id will represent the generated runtime id for that object.
You can also add a class in the "Style" attribute of the object and do something like:
"<script> alert($('.MyClassName').text());</script>"
If you are coding the javascript on the block/page javascript you have to pass this Id to the method, or use the class.
I hope it helps.
regards,
HD
Thanks for your reply,it is very helpful to me.
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...