Show/hide issue for a field contained within a custom widget on a web page

251 views
Skip to first unread message

somesh.m...@gmail.com

unread,
Aug 15, 2013, 10:56:31 PM8/15/13
to suppor...@runmyprocess.com, somesh. mukherjee
I have 2 fields - degree(id: id_degree) and degree_other(id: id_degree_other) in a custom widget edu_item(id: id_edu_item) located in a web interface.

I have tried to place JS listener within the custom widget to listen to degree and of the value of degree is set to "Other", display the text field degree_other. But it does not seem to work and the listener never seem to get fired. Also, tried including the JS snippet "[[degree]]"=="Other" within the visible rule for the degree_other, but that does not seem to work either.

As these fields are located in the custom widget, I tried putting a JS listener within the parent web interface. This time the JS listener seem to get fired alright the id_edu_item.id_degree_other.setVisible(true) does not render the degree_other field visible.

Any ideas where I am going wrong?

Thanks!

Dimitri MELCHIOR Pro

unread,
Aug 16, 2013, 5:50:28 AM8/16/13
to RunMyProcess Support Forum, somesh. mukherjee
Somesh,

Using custom widgets need some rules to deal with. Inside, your custome widget, you are not supposed to know what will be the ID of ti in the Main web interface BUT, you have to be able to call widgets with their ID. That's why, we call widgets with RMP_this.widgetID.... where RMP_this. will be replaced by the custom widget ID fianlly.

To fix your problem, create a JS widget listening to degree and inject that code in :

RMP_this.id_degree_other.setVisible(RMP_this.id_degree.getValue()=="Other")

Best regards.

--

Dimitri MELCHIOR

PreSales Consultant

     

Fujitsu RunMyProcess user? Please add a review on GoogleApps Marketplace

Afin de contribuer au respect de l'environnement, merci de n'imprimer ce message qu'en cas de nécessité.
Be environmentally friendly: do not print this email unless it is entirely necessary.



--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/1a14cfd5-4fd9-41bd-b31c-419e09945938%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/groups/opt_out.

somesh.m...@gmail.com

unread,
Aug 16, 2013, 10:11:07 AM8/16/13
to suppor...@runmyprocess.com, somesh. mukherjee
Thanks Dimitri!

I tried putting the JS listener snippet back in the Custom Widget - but it appears that RMP_this.id_degree.getValue() is not able to pull the value of the degree field and returns null.

This was the issue I faced yesterday either, which made me try to have the listener JS in the parent Web Interface, which contained the Custom Widget, defined with ID: id_edu_item. I was able to grab the value of the degree field using the id_edu_item.id_degree, but the setVisible on the id_edu_item.id_degree_other would not render the degree_other field visible!

Thanks!

Gareth Thiveux

unread,
Aug 19, 2013, 6:48:49 AM8/19/13
to suppor...@runmyprocess.com, somesh. mukherjee
Hi Somesh,

If you have a JS in a custom widget, and you want to listen to a variable within this custom widget, you shouldn't prefix the variable in the Listen to field of your javascript widget. In your case, you should just listen to degree. But once in a script (script within JS widget or any rule or prelaunch script ...), you'll have to prefix the variable coming from the CW with the CW variable.
Based on your example, what you should have put in the visibility rule of your degree_other widget is :
"[[RMP_this.variable.degree]]" == "Other" ('dynamic' version, RMP_this.variable for variable and only RMP_this for ids, as mentionned by Dimitri)
OR "[[edu_item.degree]]" == "Other" ('static' version)


Regards,

Pre-Sales Consultant / Consultant Avant-Vente
 Fujitsu RunMyProcess
22 rue Chauchat, 75009 Paris - France (GMT+1)

     


Fujitsu RunMyProcess user? Please add a review on GoogleApps Marketplace

Afin de contribuer au respect de l'environnement, merci de n'imprimer ce message qu'en cas de nécessité.
Be environmentally friendly: do not print this email unless it is entirely necessary.

Thanks!

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.
Reply all
Reply to author
Forward
0 new messages