Xpages edit box style different in edit mode

I have an edit box on an xPage, and I apply a style to it. when I have the document open in read mode, the style is not applied, but when I go into edit mode, you see the font change and increase in size to what is specified in the style sheet. For the computed field I have, the style is always applied regardless of mode. Is this how it’s supposed to work? What should I do to have the same style regardless of mode?

<xp:inputText id=“noonTemperature”

value=“#{DiaryForm.DiaryTempNoon}” styleClass=“datadata”

style=“width:100px”>

xp:this.converter

<xp:convertNumber

type=“number”>

</xp:convertNumber>

</xp:this.converter>

</xp:inputText>

.datadata {

background-color: #F3F3F3;

font-size: 12pt;

color: #333;

text-align: left;

font-weight: bold; 

}

Subject: Hack…

  • Put in a second field that’s xp:text and make it render in read mode, and the xp:inputText render in edit mode. See if the style is applied.

Hope this helps…

Subject: I figured that much out

one field for editing and one for reading, but I wanted to know if that’s the right way to do it.

Subject: The “right” way is the one that works…

  • In a perfect world it would work the way you coded it, because that’s how it should work. But automagic is never perfect, and Domino is no exception. I’d do that and move on to the next kludge…

Subject: Edit Box Style Solution!!

In regards to the edit box style being different in read and edit mode:

I was having the same problem and having two fields to serve the purpose of one will just not work. In my case I added a table inside of my existing table so that I could apply the different styles to the different cells. This way anything in that cell(read only or not) will maintain the formatting. It is alot better than having two fields. Panels may work but I did not try them. Hope this helps.

One other quick suggestion. Any developers working with XPages should get a free anti-stress ball.