How to access the selected text in a Flex mx:HTML control - apache-flex

I am using mx:HTML to display HTML files. I want to get selected text like text area using selectionBeginIndex,selectionEndIndex.

I got solution using html loader
html.htmlLoader.window.getSelection();

Related

How to bind display menuitem to a static text

I am trying to create a form, which can mimic the functionality of an area page, at least it should display links to other forms (if categorization cannot be done) how can i achieve it?
Can i bind a menu item to a static text?
Create Tab within form
change Style to FastTabs
change Width to Column width
change Height to Columnt height
Add TabPage to Tab
Drag MenuItem to Tab (or add MenuItemButton)
change Style to Link
XPO: AreaPageSimulation
I resolved this by using .net's link label, unfortunately did not see Matej's answer, but will give it a try when I will actually build this for client, here is what I created:

Text Input Remove Button like Tag in Flex

In Flex Application how to add Remove tag ?
Another Ex: StackoverFlow Tags Section.. when type Fx then hit Space some image will be adding..
Just i want some suggestion....
use a library "flex-autocomplete" which is much useful for tag. you can change a skin of tag because you have full source code of it. you can take a demo of this library from here
http://flex-autocomplete.com/demo/#
you can download Source code of this library from here
http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_us&extid=1721530
May this will help you..!
I think you can use a dataGroup for this purpose, add an itemRenderer in dataGroup.
and as JK Patel said add a textInput which have auto-complete functionality, add a BorderContainer for border styling around textInput. Bind a list of tags in datagroup.
here some help regarding dataGroup.
(http://help.adobe.com/en_US/flex/using/WS64909091-7042-4fb8-A243-8FD4E2990264.html)
search by yourself for more help...
here an other example.
(http://www.hufkens.net/2009/06/flex-4-datagroup-and-itemrenderers/)
Have a look in to this Auto complete component which looks same as what u want. Change the style to facebook in the drop down list
DEMO
Facebook like AutoComplete text input demo
SOURCE
Source
Developer site Hillel Coren AutoComplete

display mxml tag as text

i am new to flex,i want to disply mxml code as a text on mxml page(i dont want to evalute mxml tag it should be display as text only).something like shown in below link
http://examples.adobe.com/flex2/inproduct/sdk/explorer/explorer.html
how can i do this?
thanks
You can always compile your project with the view source option enabled, and then your project code will be visible with out any additional fiddling.
Use a TextArea control and set its text property. If this text is properly indented, if will be shown as the example you refer to.
Note that you cannot just read the MXML code at runtime since it is compiled down to ActionScript code. You'll need to copy the code into a string.

How can I display image and text within one AS3 datagrid?

The following page shows how to load external images in AS3 DataGrid: http://www.adobe.com/devnet/flash/quickstart/datagrid_pt3/ (image and text are displayed in two columns)
But I wonder how the image and text can be loaded together within the same DataGrid. Within one column: Image followed by the text.
I cannot get it work so I'd be grateful for any help with examples. Thanks
You just have to write a custom CellRenderer that does it. If you really read and understand that page you linked, they explain how to make custom CellRenderers, and you can put whatever you want in a cell. An image with text, a button, a game of tetris, whatever.

How to populate long text in dropdownlist in asp.net

In asp.net, am trying to populate a dropdownlist box with very long text. I have fixed the width of list on the page and i don't want to change its size as it would affect my page layout. On clicking the dropdownlist, the text gets truncated to the size of the dropdown. I want to see the entire text without any truncation, without changing the size of the dropdownlist box..Also if there are any third party controls which would solve this problem?Would be very helpful if there's a solution for this.
Update:
Right now am trying a dropdown box in Jquery that will wrap the text if it exceeds the size..but again the problem is it works fine on an independent solution but when i integrate it with my application, it does not read the .css file and it does not do any formatting(style, font, alignment) that it is supposed to do according to the .css file.Any idea why this is happening?
The problem that you're describing is restricted to IE (it might be fixed in the latest version, I haven't tested).
In the past, I've had success with binding javascript methods to the onClick event on the drop down to increase the width, and the onBlur event to set the width back to its original value.
You might be able to use jQuery to create a tooltip like thing that appears when you hover over each option.
something like
// this executes on page load - just like asp.net Page_load()
function pageLoad(){
// attach a mouseover event to each option in your dropdown
$("#myDropdown option").mouseover(function(){
// get the text from that option
var text = $("#"+this.id).text();
// display that text in a small tooltip
showToolTip(text);
});
}
function showToolTip(text){
// display in some way
}
there's a javascript library called wz_tooltip available at walterzorn.com
hope that helps

Resources