Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Prompts not displaying

Hi there,

Just wondering what causes subclassed editfields to not display the prompts correctly.
By not displaying correctly, I mean displaying only the first letter followed by an ellipsis.

I have places where it works and places where it doesn't.
I have not spent any time debugging this so just throwing the line out early.

Will provide a screenshot if this is unfamiliar territory.

Thanks

Comments

  • I haven't encountered this issue yet, but if I had to guess, I'd imagine that for some reason the subclass "thinks" the edit line is narrower than it really is. I'm not sure what would cause this, though, because the size of the control is queried at the very moment the prompt is rendered, and it's not cached. I'm going to need a little more to go on to narrow this down.
  • Am at that client later in the week so low priority until then and not sure if it is actually happening on their production version or just my local copy.
    However, here's what it looks like and a quick review seems to show that the problem exists only where I leave the default properties alone. In the screenshot you'll see I've changed the prompt fontcolour to red and the font to bold for some and they all work as expected. The one below them that was just left as is doesn't display correctly.

  • Mark,

    So you are saying that the improperly functioning prompt is using the same style settings as the others? So the problem extends beyond the text being clipped?

    Let's try to isolate the issue this way:
    • Order of execution. Does setting the Asset prompt first allow it to work but Property Officer will fail?
    • Content related. Does changing the prompt text to something else make a difference?
    • Resource limitation. Does disabling the setting of at least one other prompt allow this "Asset Code" prompt to work?
  • Hi Don,

    No on all counts.

    The improperly functioning prompt occurs because it was written by an improperly functioning coder.

    The red ones worked because I was setting the font to a bold font.
    The others I thought I was leaving as default but was inadvertently setting the font to a value of zero.

    Complete the if then else statement and everything works as advertised.
    Strange that I wrote that back in 2011 and not a single user has mentioned it.

    Don't worry, have given myself an uppercut. ;-)
  • On site now where the code mentioned above is in production and no-one has mentioned it because it works.
    They are using version 3.0.0 of the subclass control and with that version, setting the font value of the prompt property to zero is the same as leaving it null and relying on the default.

    So somewhere between 3.0.0 and the current version of the control, changes have occurred so that setting the font value to zero now truncates the prompt itself.

    Not a bad thing because it forces me to code more correctly but I suspect it is one of those things that just slipped in there.
Sign In or Register to comment.