Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7530093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:49:02+00:00 2026-05-30T04:49:02+00:00

I am using a s:TextInput in Flex 4.5. It shows it’s prompt text if

  • 0

I am using a s:TextInput in Flex 4.5. It shows it’s prompt text if the underlying text value is null or empty String. Does anybody know if I can make either don’t show the prompt on empty String or even show a different prompt?
I already found a way by extending the TextInput class and overriding some of the methods but I am still hoping anyone here knows an easier way 😉

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T04:49:04+00:00Added an answer on May 30, 2026 at 4:49 am

    Ok, so based on the comments, here it is:
    You store the current prompt value in a private variable, like so:

    private var _inputPrompt:String = "";
    

    Then you create a getter, so the value is accessible from outside of this class:

    public function get inputPrompt():String
    {
        return _inputPrompt;
    }
    

    Now you can bind inputPrompt anywhere you need it, however, the problem is the getter won’t be recalled once the private value changes. You can fix this very easily: Create an update method, for example like so:

    public function updateInputPrompt(value:String):void
    {
        _inputPrompt = value;
    }
    

    Ok, nothing fancy so far. I’m guessing this is the point where you are right now. In order to “force” the getter to be recalled, you have to bind it to an event, like so:

    [Bindable(event="inputPromptUpdated")]
    public function get inputPrompt():String
    {
        return _inputPrompt;
    }
    

    Finally, you can simply dispatch this event when the value is update (i.e. in the updateInputPrompt method):

    public function updateInputPrompt(value:String):void
    {
        _inputPrompt = value;
        dispatchEvent("inputPromptUpdated"); // For binding
    }
    

    This way, the getter will be recalled every time you dispatch that event.

    Hope this helps. Have a great day, and a great weekend!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In flex, I am using the following: mx:TextInput mouseOver=tester(event) It works fine. My pointer
my html is like this <td> <input type=text class=textinput id=file_descr_0 name=file_descr[0] value='' /> <div
I have some rich text created using the flex (flash builder 4) rich text
I've created a custom textInput componenet that handles it's own validation using a private
I am using the jQuery datepicker on a text input field and I don't
I have text input boxes. There is validation for each of the boxes using
I'm trying to set the focus on a text input element using document.getElementById( 'id'
am sending one user object from java to flex using remote object,now i want
Is there any way to create a textInput box for flex mobile with inline
I'm working on a simple flex / AIR application with just a mx.TextInput control

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.