This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Nov 1, 2012, 7:30 PM
31 Posts
topic has been resolvedResolved

XPiNC: Styling & Number alignment

  • Category: Styles and Themes
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: CSS Alignment
  • Replies: 2
This is my first foray into XPages for the Notes client.  I've encountered a couple of oddities, and wonder if I'm just missing the obvious.
 
I'm trying to right-align $ amounts in a <td> tag. The data is right-aligned if I preview the XPage in a web browser, but the data is left-aligned in the cell in the Notes client.  I tried adding "text-align:right" to the computed field but it makes no difference.  I also had to hard-code the "$" sign in the converter since the currency placeholder was displayed instead in the Notes client, which seems a little odd. 
 
Any ideas on how to get the data to right-align in the Notes client?
 
            <xp:td style="width:100px" align="right">
                <xp:text escape="true" id="cfAmount">
                    <xp:this.value><![CDATA[#{contentData['Amount']}]]></xp:this.value>
                    <xp:this.converter>
                        <xp:convertNumber pattern="$#,##0;($#,##0)">
                        </xp:convertNumber>
                    </xp:this.converter>
                </xp:text>
            </xp:td>
 
with the resulting markup in XPiNC:
<td align="right" style="width:100px"><span id="view:_id1:repeat1:2:cfAmount" class="xspTextComputedField">$1,364,678</span></td>
same thing in Firefox:
<td align="right" style="width:100px"><span class="xspTextComputedField" id="view:_id1:repeat1:2:cfAmount">$1,364,678</span></td> 
 
Another problem I encountered is when I tried to use a CSS class on the data in the 2nd cell of my table, it was ignored in XPiNC but adhered to in Firefox.  Only the class applied to the 1st cell "sticks" in XPiNC.  The source looks identical in both places.
In Firefox: 
<td colspan="5"><span class="bigBlueViewCol" id="view:_id1:repeat1:1:cfCorporation">Some Company LIMITED</span></td>
In XPiNC:
<td colspan="5"><span id="view:_id1:repeat1:1:cfCorporation" class="bigBlueViewCol">Some Company LIMITED</span></td>
 Any help out there?
Thanks!
Nov 2, 2012, 5:30 PM
53 Posts
Re: XPiNC: Styling & Number alignment
Why not
 
<xp:td style="width:100px; text-align: right">
 
That would be the normal way of doing it,  align="right" is deprecated isn't it?
 
Not sure about your second option, haven't seen a problem with styles in XPiNC myself
 
 
Nov 2, 2012, 7:46 PM
31 Posts
Re: XPiNC: Styling & Number alignment
Well, you learns something new everyday. 
 
I think my major mistake was not clearing the cached CSS via the Refresh option "Clear Private Data" each time I made changes.  Now that I've found that option I use it each time.
 
I've resolved the text-align problems by having to create special CSS classes to use in the <th> & <td> tags that simply do "text-align:center" or "text-align:right" -- inserting style attributes in the tags themselves or in the computed text within the tags had only marginal effect even when "!important" was added.   XPiNC is a little finicky and persnickety to be sure.
 
Adding the ExtLib Firebug Lite custom control sure helps too!
 
 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal