Rational Change - Dynamic Display attributes

48 views
Skip to first unread message

Rudi

unread,
Apr 28, 2015, 2:32:24 PM4/28/15
to synergy...@googlegroups.com

Haven’t seen any more posts here .. so I thought I need to check if that group still exists ;)

I am looking for a Rational Change customization, where I want to change the display properties of “a” attribute based on the value of “another” attribute, i.e. I want to change attribute B from read-only to be modifiable when a certain value for attribute A was selected.

Has anyone experimented with something of that nature, using Change 5.3?

I can see where that might become tricky as we’d have to reload the form after changing the attribute’s display properties .. other than that, I could imagine that this is a pretty common requirement, so there might be a solution for that out there.

Thank you in advance, -Rudi.

Dan Steffen

unread,
Apr 29, 2015, 4:10:18 AM4/29/15
to synergy...@googlegroups.com
Hello Rudi,

i don't know if this is possible only with the functionality of change, but I would like to suggest you to use javascript to disable a input attribut. Of course a disadvantage of this solution is that this is very static and you have to recreate your lifecycle-package when something changes on the conditions
best regards
Dan

--
You received this message because you are subscribed to the Google Groups "Synergy CM Tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to synergy-cm-to...@googlegroups.com.
To post to this group, send email to synergy...@googlegroups.com.
Visit this group at http://groups.google.com/group/synergy-cm-tool.
For more options, visit https://groups.google.com/d/optout.

Matthias.Sc...@materna.de

unread,
Apr 29, 2015, 4:23:54 AM4/29/15
to synergy...@googlegroups.com
...as far as I know the new feature only allows to switch attributes between required and non-required based of other attribute's listbox values (it doesn't work e.g. with Boolean/CCM_TOGGLE attributes).

Switching between r/o and r/w isn't possible I think...

-----Ursprüngliche Nachricht-----
Von: synergy...@googlegroups.com [mailto:synergy...@googlegroups.com] Im Auftrag von Dan Steffen
Gesendet: Mittwoch, 29. April 2015 10:10
An: synergy...@googlegroups.com
Betreff: Re: Rational Change - Dynamic Display attributes

Hello Rudi,


i don't know if this is possible only with the functionality of change, but I would like to suggest you to use javascript to disable a input attribut. Of course a disadvantage of this solution is that this is very static and you have to recreate your lifecycle-package when something changes on the conditions

best regards

Dan

2015-04-28 20:32 GMT+02:00 Rudi <ruediger...@jci.com <mailto:ruediger...@jci.com> >:


Haven’t seen any more posts here .. so I thought I need to check if that group still exists ;)

I am looking for a Rational Change customization, where I want to change the display properties of “a” attribute based on the value of “another” attribute, i.e. I want to change attribute B from read-only to be modifiable when a certain value for attribute A was selected.

Has anyone experimented with something of that nature, using Change 5.3?

I can see where that might become tricky as we’d have to reload the form after changing the attribute’s display properties .. other than that, I could imagine that this is a pretty common requirement, so there might be a solution for that out there.

Thank you in advance, -Rudi.



--
You received this message because you are subscribed to the Google Groups "Synergy CM Tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to synergy-cm-to...@googlegroups.com.
To post to this group, send email to synergy...@googlegroups.com <mailto:synergy...@googlegroups.com> .
--
You received this message because you are subscribed to the Google Groups "Synergy CM Tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to synergy-cm-to...@googlegroups.com.
To post to this group, send email to synergy...@googlegroups.com <mailto:synergy...@googlegroups.com> .

Ed Taekema

unread,
Apr 29, 2015, 9:11:49 AM4/29/15
to synergy...@googlegroups.com
Rudy, I wrote a customization a while back that does this but it was pretty specific to a customer environment.  As I recall, we created new web types that could "listen" to values in other attributes and then change their visibility or required / non-required status based on that.  Not terribly difficult but it wold definitely involve some javascript and web type development to do.

Cheers,

Ed


To post to this group, send email to synergy...@googlegroups.com.

Rudi

unread,
May 5, 2015, 9:22:28 AM5/5/15
to synergy...@googlegroups.com
Thank you all for your responses!

@Ed, I wouldn't mind tinkering with JavaScript or Python (Jython), but I could use some initial guidance on which files would need changing for the anticipated change in behavior.
In addition, would we need to do some sort of page reload (screen refresh) after modifying the attribute value?

Thank you, -Rudi.

Matthias.Sc...@materna.de

unread,
May 5, 2015, 2:11:08 PM5/5/15
to synergy...@googlegroups.com
Hi Rudi,

we don't put this sort of customizations into the templates but define an HTML field using the Lifecycle Editor. There you can put your code without any problems and don't run into trouble when template files get replaced e.g. by updates. And you have your customization stored in the process XML file.

Because most things in Change are coded in JavaScript there is no need to do a site refresh. But in general it's a little bit tricky because you perhaps have to change several Java Script values per attribute you want to modify using your script.

So you have to jump in a little bit in how Change works in by looking into the HTML code.

For example if you want to change the value of the attribute "Resolver" using Java Script it's not only done by changing the value itself; there are some other things (I remember one was a Boolean variable "isDirty" or so) you have to care for, or Change will tell you "Nothing hast changed" when hitting the "Save" button although you see the changed value for "Resolver" with your own eyes ;-)

Regards,
Matthias

-----Ursprüngliche Nachricht-----
Von: synergy...@googlegroups.com [mailto:synergy...@googlegroups.com] Im Auftrag von Rudi
Gesendet: Dienstag, 5. Mai 2015 15:22
An: synergy...@googlegroups.com
Betreff: Re: Rational Change - Dynamic Display attributes

dsteffen

unread,
May 5, 2015, 10:21:57 PM5/5/15
to synergy...@googlegroups.com
Hello Rudi,

for the approach which Matthias describes is here a first untested draw how to use JavaScript in Change. 

<script type="text/javascript">
 dojo
.addOnLoad(function()
       
{
 dojo
.query('IDENTIFY_OF_LISTBOX').onchange(function(list_node){
 
if(dojo.attr(list_node,'value') == 'external')
 
{
 
# Disabled a input-Field when IDENTIFY_OF_LISTBOX has the value external
                                dojo
.query('IDENTIFY_OF_INPUT').each(function(input_node)
 
{
 dojo
.attr(input_node, 'disabled', 'disabled');
 
}
 
}
 
else
 
{
                                dojo
.query('IDENTIFY_OF_INPUT').each(function(input_node)
 
{
 dojo
.removeAttr("disabled");
 
}
 
}
 
}
 
}
</script>

       

this solution use the dojo framework which comes along with Rational Change. 
When I understand you wouldn't like to submit any data to the change backend and only disable a field depending of a value from another. That's why you don't need to set any further attributes because everything of this modifications only happens in the browser of the user.
I hope that's helps you a little bit to solute your problem
best regards
Dan
Reply all
Reply to author
Forward
0 new messages