Setting style for html tags in flex

I need to add display:inline style property to <p>tag in flex CSS. Is there anyway to do like the below in flex
p{ display:inline}
Thanks in advance.

Hi rizmysl,
You cannot directly set the backgroundColor to a Label control however you can do it by getting a reference to the underlying TextField control inside the Label, for that you need to write some actionscript.
Check out the below code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
     <mx:Style>
          .texfield{ width:300; height:30; background-color:red; fontWeight:bold;}
     </mx:Style>
     <mx:Script>
      <![CDATA[
       import mx.core.IUITextField;
       private function init():void
        //Getting reference to the underlying TextFiled control inside Label
        var tf:IUITextField = (myTextField.mx_internal::getTextField());
        tf.background = true;
        tf.backgroundColor = 0XFF0000;
        tf.width = 300;
        tf.height = 30;
      ]]>
     </mx:Script>
     <mx:Label x="25" y="113" text="My Sample Text Goes Here ...."  styleName="texfield" id="myTextField" />
</mx:Application>
Thanks,
Bhasker Chari    

Similar Messages

  • Set by script the tag and/or the class of a paragraph style for HTML / EPUB export?

    Is it possible to set by script the tag and/or the class of a paragraph style for HTML / EPUB export?

    I found a way
    tell application "Adobe InDesign CS6"
      tell document 1
      tell paragraph style 2
      --get count of style export tag map
      tell style export tag map 1 -- HTML  , 2 = PDF
      --get export class
      --get export tag
      set export tag to "H1"
      set export class to "blue"
      end tell
      end tell
      end tell
    end tell
    and its works
    but thanks for help to use the class "style export tag map"

  • [svn:fx-trunk] 5289: Fix for - HTML tags in span tags in ASdoc comments not being parsed correctly.

    Revision: 5289
    Author: [email protected]
    Date: 2009-03-12 21:09:58 -0700 (Thu, 12 Mar 2009)
    Log Message:
    Fix for - HTML tags in
    tags in ASdoc comments not being parsed correctly.
    QE Notes: Some baseline will require update.
    Doc Notes: None.
    Bugs: SDK-19815
    tests: checkintests, asdoc
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-19815
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/AsDocUtil.java

    Resize/re-scale & optimize all images for the web in your graphics editor before you insert them into your web pages.  Saves bandwidth and reduces page load.
    Cycle2 is a responsive slideshow.  If you want all images to remain 400px and not responsive to layout,  you'll need to modify the CSS code a little.
    Details on using Previous & Next links are in the documentation.
    http://jquery.malsup.com/cycle2/demo/prevnext.php
    Nancy O.

  • Java wrapper for html tags

    Hi,
    I need one java wrapper class for html tags. If anyone is having such pls reply.
    Thanks in advance
    Sisir

    Like java.lang.String?
    You use it like this
    String textTag = "text";
    If that isn't what you had in mind then you might want to provide a bit more detail as to what you think it should do.

  • Struts 2 validation for HTML tags

    Hi,
    I am doing Struts2 validation with validation.xml for HTML tags. Here i am doing a binding between a form (bean) and the respective field in JSP and validation.xml. The validation error messages are populated without any problem but the value entered in the respective text field for HTML tags is not persisted. This problem does not occur if you use Struts 2 tags in JSP. Here is a snippet of what i am doing:-
    JSP:-
    <input:text name="accountForm.firstName" size="12" maxlength="20" />
    Action:-
    class AccountAction {
    private AccountForm accountForm;
    public void setAccountForm (AccountForm accountForm) {
    this. accountForm = accountForm;
    public String insertAccount () throws ApplicationException {
    // To get the account details from the JSP
    String first Name = accountForm.getFirstName ();
    action-validation.xml:-
    <validators>
    <field name="accountBean.firstName">
    <field-validator type="requiredstring">
    <param name="trim">true</param>
    <message> First Name is required.</message>
    </field-validator>
    </field>
    <validators>
    Whether it is possible to persist the value with HTML tags with Struts 2 validation? or i need to go with Struts 2 tags in JSP. Please shed some light in to it.
    Thanks,
    JavaCrazyLover

    FYI
    I am using spring framework with struts2 UI
    ..pls
    do the needful..
    Thanks in advance
    -Satish

  • JAXB is not generating the setter method for my tag

    Hi,
    I am generating java classes form my .xsd file using JAXB.
    The xsd definition has defnes a Form as a sequence of FormElement, where FormElement is a choice of graphical components like text etc. Form can have 0 or unbounded elements of typeFormElement
    Example
    <xs:element ref="sswfm:FormElement" minOccurs="0" maxOccurs="unbounded"/>
    It is creating the getter method for this tag like this-
    java.util.List getFormElement();
    but does not create setter method, namely, setFormElements which I would like to use when marshalling from swing to XML.
    If i remove the maxOccurs="unbounded, it is creating the setter method for this tag.But i want to keep this tag as it it and needs the setter method also.
    What should i do? Has one tried this before. HELP if you can
    Thank you in advance.

    Hi RavindraKshirsagar,
    We have a problem like you faced. Our requirement is that, we need to generate dynamically the PERSON element in our javabean.
    <xs:element name='SERVICE_REQUESTER'>
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref='ORGANIZATION' />
                        <xs:element ref='PERSON' maxOccurs='unbounded' />
                   </xs:sequence>
              </xs:complexType>
         </xs:element>For this maxOccurs, as JAXB is not generating any Setter Method. As we need to get data dynamically from external application. If you could help us in handling this case dynamically, it will be well and good.
    Please send us the script / code asap.

  • Help needed in adding effects of certain HTML tags in Flex spark Richtext

    I want to apply the effects of the following HTML tags/ attributes, in my HTML text rendered in Flex Spark Richtext Component.
    Superscript - <sup>
    Subscript - <sub>
    Blockquotes - <blockquotes>
    Ordered Lists - <ol><li>
    Unordered List - <ul><li>
    Horizontal Rule - <hr>
    Direction Attribute for <p> - <p dir="rtl">Hello</p>
    Background Color for <font>
    I have observed that the above tags have no effect in RichText. Is this a limitation?
    Any solutions, tweaks and tricks will be appreciated...
    Thanks,
    Mangirish

    check this out . this should be able to answer you question.
    http://livedocs.adobe.com/flex/3/html/help.html?content=textcontrols_04.html
    Miguel

  • Correct way of setting styles for custom components

    Hey everyone,
                            I have a custom component which extends UIComponent and holds a image and a button. If I want to set the default style for my button where do I set it in the createChildren, stylesInitialized ,  updateDisplayList  or styleChanged ? I know styleChanged gets called first but the param is always null
    styleChanged = null
    stylesInitialized
    initialize
    createChildren
    initializationComplete
    commitProperties
    measure
    updateDisplayList
    Cheers,
    Firdosh

    Thanks for your recommendations. I have seen a lot of components (yahoo-astra e.g) call a static function or use Mixin (asfusion Rating Component)
    public class CustomComponent extends UIComponent {
              public static function initializeStyles():void
                   var styleDeclaration:CSSStyleDeclaration = StyleManager.getStyleDeclaration("BaseMultiFieldInput");
                   if(!styleDeclaration)
                        styleDeclaration = new CSSStyleDeclaration();
                   styleDeclaration.defaultFactory = function():void
                        this.backgroundColor = 0xffffff;
                        this.backgroundDisabledColor = 0xdddddd;
                        this.textAlign = TextFormatAlign.CENTER;
                        //other styles are based on the framework defaults
                   StyleManager.setStyleDeclaration("BaseMultiFieldInput", styleDeclaration, false);
              initializeStyles();
    is there a reasons why they are set in a static call?

  • Auto Addition of HTML TAG by Flex

    Hi,
    I just look at my TextArea.htmlText and see that Flex always
    put some HTML Tag in it like <TEXTFORMAT LEADING="2"><P
    ALIGN="LEFT"> in addition to mine... Is there any way to get rid
    off that ?
    Thanks :)

    anyone got some clues ?

  • Setting style  for DatagridColumn?

    My dataGrid has a style set for it in the CSS stylesheet. How
    can I change the style for one of the columns please?

    If your DataGridColumn has an id set for it, you can use the
    setStyle() method to set individual styles.
    <?xml version="1.0"?>
    <!-- dragdrop\SimpleDGToDG.mxml -->
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="initApp();">
    <mx:Script>
    <![CDATA[
    private function initApp():void {
    greg.setStyle("backgroundColor","#ff00ff");
    srcgrid.dataProvider = [
    {Artist:'Carole King', Album:'Tapestry', Price:11.99},
    {Artist:'Paul Simon', Album:'Graceland', Price:10.99},
    {Artist:'Original Cast', Album:'Camelot', Price:12.99},
    {Artist:'The Beatles', Album:'The White Album', Price:11.99}
    ]]>
    </mx:Script>
    <mx:DataGrid id="srcgrid">
    <mx:columns>
    <mx:DataGridColumn id="greg" dataField="Artist"/>
    <mx:DataGridColumn dataField="Album"/>
    <mx:DataGridColumn dataField="Price"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:Application>

  • Replace function for HTML tags

    Hie Guys,
    I would like to get rid of the HTML tags from a column/object in my report using the "Replace" function. Basically, I want to replace whatever the content is between "<" & ">" i.e. the opening and closing tags. I know I can use the "Pos" function to identify the position of "<" & ">", but I am not sure exactly how to achieve this in Webi. FYI -  "Read content as HTML" & "Read content as Hyperlink" did not resolve the issue. Can anyone please help? Thanks.

    Hi Jeewan,
    It will be very tedious to do this at Webi level.
    I have tried below example. It might help you to work around your issue; however, not completely:
    1. Created an Excel and inserted single value in first column as:
    <html><b>this is yuvraj</b></html>
    2. Used it as source and created a Webi report in Rich client.
    3. Applied SubStr recursively using Pos function and created below variables:
    test : =Substr([column_1]; Pos([column_1];">")+1;Length([column_1]))
    test1: =Substr([test]; Pos([test];">")+1;Length([test]))
    test2 : =Substr([test1]; 0;Pos([test1];"<")-1)
    The output has been attached.

  • How to have HTML tags in Flex app wrapper.

    If I put this just below the <body> tag in my Flex app
    HTML wrapper, it displays:
    <h2>Greg Lafrance</h2>
    But if I put that tag just above the ending </body>, it
    does not show up.
    I'm sure it is something simple, but can someone please
    enlighten me?

    Hi,
    overflow property will tell the browser to hide the content
    if it is overflowing the available space. Please find more details
    at the URL below.
    http://www.w3schools.com/Css/pr_pos_overflow.asp
    IE is ignoring this style property and so we have scroll
    property for the BODY tag also. As Tracy mentioned, these are set
    to make sure Flex application occupies the browser.
    Hope this helps.

  • Set style for reports

    Hello
    i need to find a way to give a format to objects inside my reports, in a way similar to css.
    Actually i export my reports in the code behind of my page, i wish to set the report sytle (font size and type, color, backgroung and so on). I've tried to use the setcssclass method in the code behind of the page that export the pdf without success :
    the page:
    <head id="Head1" runat="server">
    <title></title>
    <style type="text/css" runat="server" id="stile">
        h1
        background-color:Aqua;
        border-color:Black;
        color:Black;
        font-family:Arial;
        font-weight:bold;
        font-style:italic;
    </style>
    </head>
    the code behind
    report.SetCssClass(ObjectScope.PageHeaderSections,"h1")
    Dim oStream As System.IO.MemoryStream
    oStream = DirectCast(report.ExportToStream( _
    CrystalDecisions.Shared.ExportFormatType.PortableDocFormat), System.IO.MemoryStream)
    Response.Clear()
    Response.Buffer = True
    Response.ContentType = "application/pdf"
    Response.BinaryWrite(oStream.ToArray())
    I wish to remark i don't use crystalreportviewer and the above code print the file directly inside the browser.
    the questions are:
    1. does the above code should work and i'm doing something wrong or that approach is completly wrong and will never work? If it's a correct approach, why the stye doesn't get applied?
    2. if that's not the rigth way to do this thing what tool should i use? formatting formulas? do them allow me to format large pieces of report at the same time like css do in html ? Can you provide me links to examples or tutorial.
    i'd like to avoid to set font size,type , line thickness or colors for each item in the report, so any hint will be greatly appreciated
    thank you in advance
    Stefano

    Hello, Stefano;
    The code you are using is only formatting the HTML page and not affecting the report object.
    To do that you would need to use the Crystal Reports SDK and that would include formatting options.
    You are correct, you can use formatting formula for objects. You will want to test your results in the designer first. It will have to work the way you expect there.
    You may be able to do create some generic formula that will work on larger groups.
    e.g. @Format_Color
    You could use this formula for lines and fonts that you needed the same color and at runtime pass in the color needed:
    Report.DataDefinition.FormulaFields.Item("Format_Color").Text = crBlue
    Then use this formula when formatting all the fields you where you want blue options for Font or Underlines as an example.
    Another option is to actually add formatting at runtime using the Report Creation API properties of the Report Application Server SDK (RAS).
    You can look for more ideas in the [Developer's Library|http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/devsuite.htm]. Look at "[New APIs for enhanced report customization|http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/en/RAS_SDK/rassdk_net_doc/doc/rassdk_net_doc/html/Whats_New_RAS2.html#1022964]".
    Once the changes are made in the report object it should export to .pdf as you expect.
    Elaine

  • How to apply multiple styles for nested tags in XML?

    Say you import this XML into InDesign:
    <Root>
      <strong>
        <em>Bolded and Italicized</em>
      </strong>
    </Root>
    And you have two character styles, bold and italics, to map to strong and em tags respectively.
    You will see that the text appears italicized not bolded and italicized as expected. Generally, only the innermost tag will get the style and will overwrite its parent styles.
    Notice the XML is generated dynamically and tags order is not enforced. Also, there's an additional underline tag that can be nested with these two.
    So far I have tried to use GREP styles (with paragraph styles), but these do not have effect in the XML tags.
    Other possible options not tried yet:
    Create new tags for every formatting combination. Not what I really want because I could en up with a lot of tags each one with a corresponding styles.
    Create InDesign XML rules to apply character styles automatically based on the tags
    Use character styles in the XML with the aid namespace referencing InDesign styles. Will this really work?
    What do you suggest to go for? See any other option?
    Thank you in advance.
    Juan

    I'd say that you should create tags not for appearances, but for semantic content. Specifying formatting styles in your XML betrays your lack of familiarity with the format, because the last thing you'd want to do would be to use HTML markup in the middle of your XML. If you have content that's supposed to be both bolface and oblique - say, a warning - then it's marked up as
    <warning>Never refer directly to formatting in your XML markup, only to content types!</warning>
    If I had a document that was written in the style you suggest - one with lots of overlapping local formatting - I'd look at developing a better style guide that told the writers that doing so would be bad form. Because, you know, many of the writers I deal with are addicted to forms of emphasis that do nothing useful whatsover for their readership - they only serve to overemphasize the authorial voice of the writers.
    Maybe you could tell us why you need these overlapping forms of styling, and we could suggest other InDesign formatting tools (like line styles or nested styles) that would help you get the appearance you want without crowding styling markup into your XML - where, strictly speaking, it doesn't really belong.

  • How to set value for html:img

    i am using <html:img tag to render image and i need to set some value to that image when selected and that value need to be checked in java code.
    How i can set the value for that image.
    Thanks,

    use javascript and hidden input to do this:
    <html:img src="your_img.gif"     ononclick="document.getElementById('your_hidden_input_id').value='your_value' ">
    <input type="hidden" name="your_hidden_input_name" id = "your_hidden_input_id" value="" />Hope that Helps

Maybe you are looking for