Widget Action (Crimson 3.0)

ais

Member
Join Date
Apr 2012
Location
Bangkok
Posts
59
I have created a widget with folder binding enabled.

The widget also has an associated action.
The action is : change value, data=tag1 to write to=tag2.

Everything works the way I want it to, however on binding, the action tags do not automatically update.

I see there is an "add action" in the widget parameters.
Trying to figure how to use that.

FWIW the action is added at the tag level and not widget level.

Also this is a "building block" for inclusion in a larger widget.
Is there any other detailed info available other than the user manual which does not have enough detail for what I want to do.

TIA for any help.
 
I have created a widget with folder binding enabled.

The widget also has an associated action.
The action is : change value, data=tag1 to write to=tag2.

Everything works the way I want it to, however on binding, the action tags do not automatically update.

I see there is an "add action" in the widget parameters.
Trying to figure how to use that.

FWIW the action is added at the tag level and not widget level.

Also this is a "building block" for inclusion in a larger widget.
Is there any other detailed info available other than the user manual which does not have enough detail for what I want to do.

TIA for any help.

The Tags in the action need to be bound too. In other words, they need to be a part of your folder so they can be bound. Otherwise, they are treated as standard tags and are referenced as such.

An easy way to accomplish this is to create tags in your folder and make their source the actual tag whose data you want to change. That way when you change the tag in the folder (through the widget action), the tag that it references will change too. This is assuming that you can't just put the original tag in the folder and give it a standard name.

I assume that you understand that the tags in each folder class that you want to bind have to have the same name. In other words, the only difference between these folders is the folder name itself and all of the tag names are the same - at least for tags you want to actually bind in a widget. Then you set up the stuff in the widget using the common names. So each folder will have a Tag1, Tag2, Tag3, etc. (or any name you want to give them) and those names without the folder identifier will be used in the widget. So if you had folders named Pump1, Pump2, etc, the tags would be Pump1.Tag1, Pump1.Tag2 - etc. but in the widget you would only use Tag1, Tag2, etc and when it gets bound, the actual tag is referenced in the widget.


I realize my explanation may be a little bit confusing, but if you need me to try to clarify some part of it, I'll be glad to.

I really like the fact that you can use actions (and Complex Code) in widgets - it makes automation much easier.
 
Thanks for the response.
I understand the binding folder setup and tag naming conventions.
There are only 2 tags and they are both directly in the folder and they do bind.
The tags are (internal) bool tags (flags) and their states are used to display a primitive in 4 colours.
I have added an action to the primitive which when touched (selected), depending on the states of the flags, will write the value of Tag1 to Tag2.
In the part for the colour control, the tags bind automatically as Tag1 and Tag2, but for the change value action, the same 2 tags do not bind automatically. Instead the widget uses the full path and not just Tag1 and Tag2. So I am having to edit the path for each folder which moots the point of binding.
In the widget definition I have 2 items i.e. Tag1 and Tag2 as Integer Tags.
The action was added by selecting the primitive "inside" the widget and adding the action to the primitive.
I must be missing something ...
I have not added an action definition to the widget - could this be the problem?
 
Thanks for the response.
I understand the binding folder setup and tag naming conventions.
There are only 2 tags and they are both directly in the folder and they do bind.
The tags are (internal) bool tags (flags) and their states are used to display a primitive in 4 colours.
I have added an action to the primitive which when touched (selected), depending on the states of the flags, will write the value of Tag1 to Tag2.
In the part for the colour control, the tags bind automatically as Tag1 and Tag2, but for the change value action, the same 2 tags do not bind automatically. Instead the widget uses the full path and not just Tag1 and Tag2. So I am having to edit the path for each folder which moots the point of binding.
In the widget definition I have 2 items i.e. Tag1 and Tag2 as Integer Tags.
The action was added by selecting the primitive "inside" the widget and adding the action to the primitive.
I must be missing something ...
I have not added an action definition to the widget - could this be the problem?

If you unbind your widget, then edit the action to be Tag1 and Tag2 without the full tag name including the folder name, then rebind it, what happens?

I admit I'm not following what you are trying to do or I might be able to suggest another option.

If you want to post it I will take a look at it and see if it makes more sense to me.
 
If I undbind the widget, it does not let me put only Tag1 & Tag2.
If will only accept a full path to the tag.
I believe the problem to lie with the way in which the action was added/created. Is there any documentation available on this?

Let's try this from another perspective...
Please describe how you would add an action to the following.
Let's use a single tag i.e. Tag1.
Our widget will have 2 data boxes. Box 1 will display the label for Tag1 and box 2 will display the data for Tag1.

Now for the action part, if I touch the label i.e. box 1, I should be taken to "page1" i.e. we are adding a goto page action to the label data box.

How should this action be added?

TIA.
 
If I undbind the widget, it does not let me put only Tag1 & Tag2.
If will only accept a full path to the tag.
I believe the problem to lie with the way in which the action was added/created. Is there any documentation available on this?

Let's try this from another perspective...
Please describe how you would add an action to the following.
Let's use a single tag i.e. Tag1.
Our widget will have 2 data boxes. Box 1 will display the label for Tag1 and box 2 will display the data for Tag1.

Now for the action part, if I touch the label i.e. box 1, I should be taken to "page1" i.e. we are adding a goto page action to the label data box.

How should this action be added?

TIA.

Just add the action to the Data Box and Select Goto Page and choose the page you want to go to in the target page.

If you are trying to automate which page you want to go to, you can't do that directly. The way I do it is create a Page Data Type in the widget Definition (I called mine POPUP) and then use GotoPage(POPUP) in the action. Then you have to manually choose the page you want to go to after you bind the widget. That way you can have a different page for every instance of the widget, you just can't bind this, you have to add the page you want to go to manually.

See the attached images as an example.

Snip1.JPG Snip2.JPG
 
Could I not have the name of the page I want to go to in a Tag?
I would then want the page holder tag to bind automatically. Each folder will have a Tag with the destination page.
Possible?

What is the "add action" option when defining the widget?
 
Could I not have the name of the page I want to go to in a Tag?
I would then want the page holder tag to bind automatically. Each folder will have a Tag with the destination page.
Possible?


No, this isn't *currently* possible. My guess is that some day Redlion may add this feature, but for now the solution is the one I gave you. It is fairly easy to do, it just adds a step to select the properties of the widget after it is bound and select the page you want to go to from the drop-down list.

Granted, there is some danger if you copy the widget and bind it to another folder but forget to change the page.
 
Ok so what my original widget was about is, imagine we had 2 tags and not one.

The action is then when touching label box 1, The value of Tag1 is to be written to Tag2.

When adding this "change value" action, I cannot get the Tags to bind.
I have to drag the tags with full path to the "write to" and "data" boxes for the action.

So are u saying that currently automatic binding for this action is not possible?
 
Ok so what my original widget was about is, imagine we had 2 tags and not one.

The action is then when touching label box 1, The value of Tag1 is to be written to Tag2.

When adding this "change value" action, I cannot get the Tags to bind.
I have to drag the tags with full path to the "write to" and "data" boxes for the action.

So are u saying that currently automatic binding for this action is not possible?

I don't understand why you are doing this, but it works fine.

Just make sure that you select Writable and Tag when you set up Tag1 and Tag2 Properties in the Definitions part of the Widget Data Definitions.

See Attached... This one is already bound, by the way (my folder name is Group1).

Snip3.JPG Snip4.jpg
 
Last edited:
Weird...
I was editing an existing widget and having the problem.
I created a new one from scratch and it works - I don't have the same problem.
Thanks for perservering...
 
Weird...
I was editing an existing widget and having the problem.
I created a new one from scratch and it works - I don't have the same problem.
Thanks for perservering...

Amazing what a reboot or start from scratch can do. Sometimes those bits get so tangled up with each other that you just have to throw them away and get a new batch.
 

Similar Topics

Hi everyone, I am using Crimson 3.0 to edit a project file created by a vendor. I have created a widget, and spent some time figuring out that...
Replies
4
Views
1,867
Does anyone know how to link an element of an array tag to a widget? My current widget needs to use the array element tag's .AsText property and...
Replies
2
Views
1,327
Ok, so i mostly have this widget thing figured out, but i am having some trouble getting my complex code to work properly with the folder binding...
Replies
8
Views
2,290
Good morning, I have built a widget and when I use the smart duplicate feature on that widget, it just copies the previous widget and does not...
Replies
1
Views
1,907
Happy New Year to everyone!! Since it is slow this time of year for me I decided to learn Widgets. I have a couple of screens that I build and...
Replies
13
Views
6,410
Back
Top Bottom