Set_attribute problem
-
I'm getting an attribute from a component this way:
@myid = e.definition.get_attribute("A", "Id")If I do a:
puts @myidI get the correct value.
Something like this: 0481e69d-cbc0-4e4c-2c32-e2d2f7932bdfAnd setting it this way:
e.definition.set_attribute("A", "Id", @myid)or
e.definition.set_attribute("A", "Id", @myid.to_s)But all I get is nil.
What am I doing wrong?
-
If you use this code in your script, then what do you see in the Ruby Console when it runs ?
puts"{@myid}"; e.definition.set_attribute("A", "Id", @myid)Remember that @myid will probably not be accessible in the Console, as I suspect that it's being set within your own method ??
-
~~Then I get:
{@myid}I'm doing it inside a:
sel.each {|e| puts"{@myid}"; e.definition.set_attribute("A", "Id", @myid) }~~
Edit:
Doh!
It was all a small typo with a D instead of a d.
Works as it should now.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement