How to combine linkable and non-linkable text in flex3? - flex3

I need to combine the text "Register your phone number" and the linkable text "Register Now". How do I do it?
The result needs to look like Register your phone number Register Now

Use htmlText property.
1.Setting htmlText at AS3.
linkable.htmlText = "Register your phone number <a href='http://www.adobe.com'>Register Now</a>";
<mx:Label id="linkable" selectable="true"/>
2.Setting htmlText at MXML.
<mx:Label id="linkable" selectable="true">
<mx:htmlText>
<![CDATA[Register your phone number <a href='http://www.adobe.com'>Register Now</a>]]>
</mx:htmlText>
</mx:Label>
If you want to open the link in a new window, use linkHandler like below.
public function linkHandler(event:TextEvent):void {
// Open the link in a new window.
navigateToURL(new URLRequest(event.text), '_blank')
}
<mx:Label id="linkable" selectable="true" link="linkHandler(event)">
<mx:htmlText>
<![CDATA[Register your phone number <a href='event:http://www.adobe.com'>Register Now</a>]]>
</mx:htmlText>
</mx:Label>

Related

How to replace some text with URL in vue?

I want to replace some text from the string with link. I dont know how can I display it. SO far below code displays string with href link.
<span class="text">{{ $t(myText) }}</span>
myText() {
var text = "You can click text.";
var href = "<a href='https://www.google.com'>Click Here</a>";
var replaced = text.replace("click", href);
return replaced;
},
To elaborate on my comment: the handlebars/moustache syntax is used to insert plain text into your template. That means that any string that contains HTML will be inserted as-is without parsing it as DOM.
In order to insert HTML into your template, you will need to use the v-html directive, i.e.:
<span class="text" v-html="$t(myText)"></span>
However, note that this presents a security risk if you're allowing users to insert their own content into the element.

Selenium Web Driver , How to enter text in text in Selenium texbox and hit Enter

Once i login to the main application. I want it to enter state name and hit enter function.It is ideally a dropdown but i would like to achieve this by entering text "Colorado" in texbox and hit enter. The text box is located under a dropdown.My question is about how to enter text in Slenium textbox and hit Enter.
The HTML for textbox is as follows,
<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input" role="combobox" aria-expanded="true" aria-autocomplete="list" aria-owns="select2-results-1" id="s2id_autogen1_search" placeholder="" aria-activedescendant="select2-result-label-11">
My current code is as follows:-
driver.findElement(By.cssSelector("#s2id_regionSelect > a > span.select2-arrow")).click();
driver.findElement(By.cssSelector("#s2id_autogen1_search")).sendKeys("Colorado");
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
WebElement textbox = driver.findElement(By.cssSelector("#s2id_autogen1_search"));
textbox.sendKeys(Keys.ENTER);
It is able to enter text in textbox but does not hit enter. I just need to select the Colorado state and click on different tab.
One way to do this is to just send a newline character (\n) with the text, e.g.
driver.findElement(...).sendKeys("Colorado\n");
In my C# automation code, I'm using the Actions(OpenQA.Selenium.Interactions) to hit enter in a input field.
new Actions(driver).SendKeys(Keys.Enter).Perform();
you can try to use TAB key:
WebElement textBox =driver.findElement(By.cssSelector("#s2id_autogen1_search")).sendKeys("Colorado");
textbox.sendKeys(Keys.TAB);// it will change focus to next element
//locate the elements in the page using their properties like``id, name or path etc.
WebElement email = driver.findElement(By.id("abc"));
email.sendKeys("abc#gmail.com");

want to display information with link to marker on map using gmaps4jsf

I am using gmaps4jsf jar file and getting dynamic marker on google map. marker having some information and once i click on marker then get the popup and i wrote there "Click me!" i want to provide link on marker data
jsf code:
<m:map id="map" width="650px" height="450px" latitude="#{map.latitude}" longitude="#{map.longitude}" enableScrollWheelZoom="true" zoom="9">
<m:marker latitude="#{point2.latitude}" longitude="#{point2.longitude}" >
<m:htmlInformationWindow htmlText="Click me!" />
</m:marker>
</m:map>
<p:column>
<p:commandButton value="Display" action="#{map.display}" update="form"/>
</p:column>
you want to write somthing like this,
<m:htmlInformationWindow htmlText="Click <a href='info.xhtml' target='_blank'>me!</a>" />
target='_blank' means you link will be open in new tab if you want to open same tab then you can remove the target.
but in jsf you can't acheive symbol without & operater so you need to like this where < means "<" and &gt means ">"
<m:htmlInformationWindow htmlText="Click <a href='info.xhtml' target='_blank'>me!</a>" />

I want a 'Text Field' in a folder that is within a document library - Sharepoint 2010

I am rather new to sharepoint and have been lucky enough to find the answer to all my questions with research. I have no found the answer to this question yet.... How do I add a text field WITHIN a folder that is WITHIN a document library. Example: I want to put instructions for upload within a specific folder. I tried to to the 'edit page' --> add text, but the text shows up at the top of ALL folders within that library and I just want it in one. Thank you for your assistance!
Kind regards,
Lanie
You can manage visibility of your message using JavaScript as below.
Don't directly add your message in text field; instead click of the text field you have added, and click "Edit HTML Source" in ribbon bar as highlighted in below image.
Then paste below code in newly opened window:
(Don't forget to replace "Your Message" and "FolderNameInWhichMessageToBeShown" in below code)
<div id="MyCustomMessage">
Your Message
</div>
<script type="text/javascript">
if(decodeURIComponent(document.URL).indexOf('FolderNameInWhichMessageToBeShown') == -1)
{
document.getElementById('MyCustomMessage').style.display = 'none'
}
else
{
document.getElementById('MyCustomMessage').style.display = 'block'
}
</script>
Click "OK" and Save your page.

choose file box by clicking on image ? (not with browse button)

is it possible to show "choose file" window, when i click on some image ? i want to hide that input and browse button, which shows when i type
thanks
Long answer: Yes, you absolutely can. Get ready for some Javascript/CSS haxx that I cooked up. First the Javascript:
function getFilePathFromDialog() {
document.getElementById('fileBrowser').click();
document.getElementById('filePath').value = document.getElementById('fileBrowser').value;
}
Now the HTML:
<img src="path/to/image.jpg" onlick="getFilePathFromDialog();">
<input type="text" id="filePath" name="filePath" /><br />
<input type="file" id="fileBrowser" name="fileBrowser" style="visibility:hidden; display:none;" />
Basically all this does is hide the actual file dialog input field from view. When you click on your image it will fire the file dialog's click event. When the user chooses a file and clicks "Open", it will put the file path selected in the textbox called "filePath".
No, because of security restrictions in the browser. You have to go with Flash or Java to achieve that.