<question-chrome question="{{question}}">
<paper-input label="{{question.Description}}" id="answer" name="answer" type="number">
{{question.Description}}
</paper-input>
</question-chrome>
Where question-chrome.html has the followign code:
<template>
<div class="questioncontainer {{question.Type }}" style="padding-top:10px;">
<div class="questiontext">
<span class="questiontitle">{{question.Title}}</span>
</div>
<div class="questionanswers">
<content select=".questionanswers"></content>
</div>
</div>
</template>
I am using the above paper input, when I am trying to get the values from this, I cannot find the value anywhere. the question element/object, I can get and see every other item's value of the question object. How would I get the value of what is put into the input field? in this case, the value was 3323.
this:
The code to retrieve it I have tried all of these:
this.$.answer.value;
And the results through developer tools in chrome result in:
Object
AdditionalProperties:null
Answers:Array[0]
Code:720061
Description:"Monetary marks ...."
ExtensionData:null
HasAnswers:false
HasChildren:false
Id:"9999dcc3-d3eb-40cf-8414-05ae385e11cf"
IsDefault:true
IsDeleted:false
.....so on and so forth
I went through all of these and did not find it. It is a numeric type of field, so not sure if that has anything to do with it.
Related
I am trying to click a button that has these details when I F12
<a data-codecept="searchGo" id="9" class="a-button a-button--white clearfix block showall" suggestrow"="" alt="/s/lundhags/?searchparam=lundhags" onmouseover="suggest.handleMouseOver(9);" onmouseout="suggest.handleMouseOut(9)" onclick="suggest.handleSubmit();" xpath="1">Show all results for 'lundhags'<span class="a-icon a-button__icon a-button__icon--double-arrow"></span></a>
I have copied xpath and I had a code like this=>
I.click('//*[#id="9"]');
and I got this error
Clickable //*[#id="9"] was not found by text|CSS|XPath
What am I doing wrong?
It works now! I used the specific Identifier
I.click('[data-codecept="searchGo"]');
I am having ng-init defined in my input tag. I would like to have this input in the specified format with line breaks.
I tried using <pre> tags and white-space:pre-line property too. But this seems not to get sorted.
<div style="font-family: Poppins !important;-webkit-font-smoothing: antialiased;top:35%; position:absolute; width: 100%; background:transparent !important; margin-bottom:0rem !important">
<input class="form-control"
id="volunteerCallTextId" type="text" placeholder="Volunteer Call Text"
ng-model="volunteerCallText"
ng-init="volunteerCallText ='Hello, may I speak to (Insured). Hi (Mr., Mrs. Etc), my name is _________.
I am with xxx Insurance and am calling you about the recent fire/flood/weather event in_____.
We are calling to check and see if your family is safe and let you know that xxx is here for you.
I want to let you know that we have emergency claims locations set up at: (use locations below).
Or you can call our Claims center at 888....Please be aware that.....'"
style="width: 75em; height:25em; white-space:pre-line" />
</div>
Format expected:
Hello, may I speak to (Insured). Hi (Mr., Mrs. Etc), my name is
_________.
I am with xxx Insurance and am calling you about the recent fire/flood/weather event in_____. We are calling to check and
see if your family is safe and let you know that xxx is here for you.
I want to let you know that we have emergency claims locations set up
at: (use locations below). Or you can call our Claims center at
888....Please be aware that.....
Can someone suggest what could be done?
I am not sure it can be done in input box or not but it works like this in textarea please try and let me know if t helps you
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body>
<div ng-app="" >
<div style="font-family: Poppins !important;-webkit-font-smoothing: antialiased;top:35%; position:absolute; width: 100%; background:transparent !important; margin-bottom:0rem !important">
<textarea class="form-control"
id="volunteerCallTextId" style="width:75em; height:25em; white-space: pre-wrap;" type="text" placeholder="Volunteer Call Text"
ng-model="volunteerCallText"
ng-init="volunteerCallText ='Hello, may I speak to (Insured). Hi (Mr., Mrs. Etc), my name is _________ \n\
I am with xxx Insurance and am calling you about the recent fire/flood/weather event in_____.\n\
We are calling to check and see if your family is safe and let you know that xxx is here for you.I want to let you know that we have emergency claims locations set up at: (use locations below).Or you can call our Claims center at 888....Please be aware that.....'"
></textarea>
</div>
</div>
</body>
</html>
I have an autocomplete control (Angular Material version 1.1.2) with md-require-match=true and a validation message
<md-autocomplete required
md-no-cache="true"
md-select-on-match = "true"
md-selected-item="vm.selectedItem"
md-search-text="vm.searchText"
md-items="country in vm.querySearch(vm.searchText)"
md-item-text="country.nm"
md-min-length="2"
md-selected-item-change="vm.updateOrgCountry(country.cd)"
md-require-match = "true"
md-input-name="countryField"
md-match-case-insensitive = "true"
md-floating-label="Country">
<md-item-template>
<span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{country.nm}}</span>
</md-item-template>
<md-not-found>
No Countries matching "{{vm.searchText}}" were found.
</md-not-found>
<div ng-messages="orgForm.countryField.$error">
<div ng-message="required"></div>
<div ng-message="md-require-match">Country not found.</div>
</div>
</md-autocomplete>
When I first enter the control and start typing everything works as expected. If I don't select an item from the list and then move away from the control I get the "Country not found" error message.
However if I go back to the control and start typing again I get the "Country not found" error message after every key press until I select something from the list. I don't want this behaviour as the user should be seeing an error while still entering data.
Is there a way to configure the autocomplete control to only validate for a match as the control loses focus?
Could anyone suggest how I can locate the element "ToBeSelected" that has the below html code:
<div id="Locate-17-tab-info" class="tab active" data-tab-name="tobeselected"> ToBeSelected </div>
The XPath
driver.findElement(By.xpath("input[contains(#id, '-tab-info')]")).click();
I did not have success with finding by XPath - starts-with and ends-with.
You May try
driver.findElement(By.xpath(//input[contains(#id,'Locate') and text()='ToBeSelected'])).click();
I enabled inline editing on SitEdit 2009 SP2 using the answer given here
How do I enable inline field editing in SiteEdit when using an XSLT TBB?
but I keep getting this error when loading the resulting page in SiteEdit:
Sys.FormatException: Could not get the type info from component xml schema.
Field: cf_tcm:20-33457-64_content_header
XPath: [1]
My XSLT TBB fragment:
<xsl:if test="//*[local-name()='content_header'] != ''">
<h1>
<div>
<tcdl:ComponentField name="content_header" index="0">
<xsl:value-of select="//*[local-name()='content_header']">
</tcdl:ComponentField>
</div>
</h1>
</xsl:if>
The output in the published file:
<h1>
<div>
<span>
<!-- Start SiteEdit Component Field: {"ID" : "cf_tcm:20-33457-64_content_header", "XPath" : "[1]", "IsMultiValued" : false} -->
<tcdl:ComponentField name="content_header" index="0" SiteEditProcessed="true">
Test
</tcdl:ComponentField>
</span>
</div>
</h1>
What is wrong with my code?
That error message means that the XPath in your <!-- Start SiteEdit Component Field: { ...} --> command does not point to a field in the current Component. Given that your XPath shows up as [1], that sounds pretty accurate.
You'll need to find the cause of the empty XPath being output. In your XSLT you mark the field with a <tcdl:ComponentField> wrapper. This wrapper is later processed by the "Enable Inline Editing" TBB to generate a corresponding <!-- Start SiteEdit Component Field ... --> command. Since the SiteEdit front-end needs an XPath to the field and the tcdl:ComponentField only contains the field name, the TBB will need to look up the XPath based on the field name.
The "Enable Inline Editing" TBB from SiteEdit 2009 looks up the current Component when processing tcdl:ComponentField by looking at the current resolved item (engine.PublishingContext.ResolvedItem.Item.Id). It then looks up the field in that Component to determine its XPath.
If you look at the package in the Template Builder, what is the Component at the bottom of the Package list? Does that Component contain a content_header field?