Polymer 1.0: Data binding variable to <iron-meta> element (value attribute) - data-binding

In Polymer 1.0, I am trying to data bind a string variable {{str}} to an <iron-meta> element (tag in parent element) as follows.
This fails:
<iron-meta id="meta" key="info" value="{{str}}"></iron-meta>
The above code breaks. But the following code works (without the binding).
This works:
<iron-meta id="meta" key="info" value="foo/bar"></iron-meta>
The difference is the variable version {{str}} fails and the constant version "foo/bar" works.
Does anyone have a clue what is what is breaking the binding and how to fix it?
Edits in response to comment questions:
How does it fail? This fails silently. The values I have printed out simply do not update when I press the Login and Register buttons.
Here is a link to the code in a Github repository. See lines

You need to use an attribute binding and not a property binding
<input type="text" value$="{{str}}" />

Related

Watir: Problems trying to get the value of a field that's contained within an iframe

I'm trying to verify the text within a field that's held in an iframe using the shown in the image below.
When I run it I get this syntax error:
/opt/homebrew/lib/ruby/gems/3.0.0/gems/watir-6.19.1/lib/watir/elements/element.rb:857:in method_missing': undefined method value' for #<Watir::HTMLElement: located: false; {:width=>"100%", :tag_name=>"iframe"} --> {:id=>"P5533_COMPANY"}> (NoMethodError)
from temporary_exp.rb:83:in `'
If I use the code for performing a 'click' e.g. browser.iframe(:width =>"100%").element(id: "P5533_COMPANY").click then it works fine but for some reason it doesn't like 'value'. Any ideas?
This is the code I'm running
#value is not a method in Watir::HTMLElement object, which is what you get an instance of when you use #element method. Is the HTML element you are working with a Checkbox? (then use #checkbox instead of #element)

Ignition 7.8 – Get Component Text From Text Area Within Container Via Scripting

A Button with scripting is saving Component values to parameters for a SQL update. The calling button is one level above the Container that holds the Text Area. However, the set for the Text Area value using the recommended User Manual method is throwing the error “AttributeError: 'NoneType' object has no attribute 'text' “
Standard form not working:
Comments = event.source.parent.getComponent('textArea1).text
Also tried different attributes at the end of the call:
… .string , … .value , … .stringvalue
event.source.parent.parent.getComponent('textArea1).text
When looking at the Property Binding path on the Component, I am able to return “Root Container. ContainerName.textArea1.text”. When I modified to be a GetProperty pull like below, I received a similar error mixed with an add on of Selected Property Not Found. I tried similar alternatives to those listed above.
Comments = event.source.parent.ContainerName.getComponent('textArea1).text
Any suggestions?
The solution is to call the Container component by name using the ‘.getComponent’ method and then call the Text Area using the standard method. The combined code is below for setting to the Parameter Comments.
Comments = event.source.parent.parent.getComponent('ContainerName').getComponent('TextArea1').text
Retrieving a Component value from within a Container does not appear to be covered in the Ignition Manual.

Get Element Attribute in robot framework

hi how to use Get Element Attribute in Robot framework? in instruction I have
Return value of element attribute.
attribute_locator consists of element locator followed by an # sign and attribute name, for example element_id#class.
I have this xpath=${check_radio_xpath}#class is this right way?
where ${check_radio_xpath} = md-radio-11
I get this error:
${ischecked} = Selenium2Library . Get Element Attribute xpath=${check_radio_xpath}#class
Documentation:
Return value of element attribute.
TRACE Arguments: [ 'xpath=md-radio-11#class' ]
DEBUG Finished Request
FAIL ValueError: Element 'xpath=md-radio-11' not found.
I think you're pretty close. Please try to format your question better, I took a quick shot because your question is difficult to read. The result will be more and better help from the community
${RADIO_XPATH} //*[#id="${check_radio_xpath}"]
${CLASS}= Selenium2Library.Get Element Attribute ${check_radio_xpath}#class
sample for this <div><label for="foo"></label></div>
${for_value}= Get Element Attribute xpath=//div/label for
Log To Console ${for_value}
console result is:
foo
This snippet works for me :
Get Line Numbers And Verify
${line_number1}= Get Element Attribute //*[#id="file-keywords-txt-L1"] data-line-number
Log To Console ${line_number1}
${line_number2}= Get Element Attribute //*[#id="file-keywords-txt-L2"] data-line-number
Log To Console ${line_number2}
Verify in order of ${line_number1} and ${line_number2} is true
What was important is that the spaces/tabs between the keywords are correct, otherwise it does not get recognised as a so called keyword.
Thanks a lot, i wanted to check meta noindex content in page source.
i used this.
${content} Get Element Attribute xpath=//meta[#name="robots"]#content
should be equal as strings ${content} noindex,follow
You can use both XPath and CSS selector if you have selenium library
${title}= Get Element Attribute ${xpath} attribute=title

Adding fields dynamically to Share form

I want to add a text field for each file that is added to the attached package items in alfresco to write notes regarding each file, is it possible to do?
I have implemented something that could be reused for your use case.
You can define a property with multiple values that will contain the list of notes associated with each attachment.
There is a simple trick to post a property with multiple values: add "[]" to the name of the property. For example:
<input id="template_x002e_edit-metadata_x002e_edit-metadata_x0023_default_prop_someco_notes_0"
name="prop_someco_notes[]"
tabindex="0"
type="text"
value="Meeting minutes"
title="Notes"
noderef="workflow://...."
>
<input id="template_x002e_edit-metadata_x002e_edit-metadata_x0023_default_prop_someco_notes_1"
name="prop_someco_notes[]"
tabindex="1"
type="text"
value="Meeting minutes"
title="Notes"
noderef="workflow://...."
>
As you can see, the name of the input ends with []. Both input textfields have the same name.
The Alfresco Form Engine will consider these two inputs as the value for the property with multiple values: "someco:notes".
The bigger problem is that you need to generate this html with some smart javascript and free marker template.
You can write a custom free marker template to render the initial html: if a user opens a task on which documents have been already attached, you will need to generate the list of inputs using a custom control (you can of course start from textfield.ftl).
It won't be easy to generate the initial list because unfortunately Alfresco returns the list of values as a single comma separated value.
You can customise the webscript that injects the model in the free marker template "org.alfresco.web.scripts.forms.FormUIGet" to pass an array instead of a csv.
A quicker and dirtier solution is to split the csv value. In share-config-custom.xml, you can specify what textfield.ftl show use as a separator instead of the comma.
When a user adds/remove elements from the package, you can intercept the update and add/remove the correspondent note. Notice that I have added the filed "noderef" to each input so it is possible to know the relation between the notes and the nodes in the package.
UPDATE:
For the associations (used for example to define the package in a workflow task), Share uses a javascript library called "object finder" (or "object picker"). This library fires an event called "formValueChanged" that you can intercept:
YAHOO.Bubbling.fire("formValueChanged",
{
eventGroup: this,
addedItems: addedItems,
removedItems: removedItems,
selectedItems: selectedItems,
selectedItemsMetaData: Alfresco.util.deepCopy(this.selectedItems)
});

How do I escape ${} in my Tridion Component Template that is consumed by multiple templates?

I am running into a situation where I have a fied with the value ${test}, in my component template that renders this the value comes out ok the problem comes in when another template calls this component and templates using ##RenderComponentPresentation(Component.ID, MyFirstTemplate)## at this point the ${test} is evaluated and because there is no such item on the component or in the package it evaluates to nothing.
I have Component Template One that reads the value of a Component field (which contains: ${test})
This template renders fine, I get back "${test}"
Now I have Component Template Two that calls ##RenderComponentPresentation(Component.ID, ComponentTemplateOne.ID)##
This is where the ${test} now gets evaluated instead of retained so it goes from ${test} to "" because it doesn't find a variable or component field name with that name.
Component Template Two then gets called by Component Template Three in the same way ##RenderComponentPresentation(Component2.ID, ComponentTemplateTwo.ID)##
Since the ${test} has already been evaluated and lost in Component Template Two I no longer end up with ${test} I am still left with "".
I have tried:
##RenderComponentField('myField', 0, False, False)##
##RenderComponentField('myField', 0, True, False)##
##RenderComponentField('myField', 0, False, True)##
no luck.
The following was my work around and it seems to work:
Placing the "\" in front of both the open and close curly brace $\{test\}
I need to make sure I remove the "\" after the last Template (Page or Component) executes.
I have in place now a C# TBB that takes the "${test}" and does the following to it:
Converts the ${test} to $\{test\} in the initial template and a C# TBB on the Page Template that then returns it to the initial value of ${test}.
Is there a way to prevent this from happening or a way to avoid doing what i am doing to make this work?
Have you tried this link , you should be able to this with this link
##"$" + "{" + "test" + "}"##

Resources