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



Mar 8, 2011, 12:26 PM
38 Posts

Re: Special notation for Style2ID

  • Category: Styles and Themes
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: CSS
  • Replies: 7
 The Id is dynamically rendered at runtime, so it will be hard to predict the exact ID.

Mar 8, 2011, 12:59 PM
67 Posts
Re: Special notation for Style2ID
 Yes Frank, that is what i see. 
 
But it should'nt be automatically rendered, when i can set it as a data value (here 'Name:') in the Design Pane.
The Designer seems not to render it automatically for itself, because it works correct in this place.  
 
I think, this is a bug. 
Mar 8, 2011, 1:24 PM
122 Posts
Re: Special notation for Style2ID
Think about it from the point of view of an edit box in a repeat control. XML requires all elements to have a unique ID. So if XPages (or any technology for that matter) used the ID you specify, you can no longer have repeats. And that includes view panels, which are repeats, as well. You would be forced to create not just one template row for your repeat, but duplicate and change the IDs for all elements in as many rows as you want. This is the pain we've had with Notes Client development for so long, that if we want to allow users to update multiple documents we need to create e.g. 10 duplicate copies of fields, each with its own unique field name. If we need to change a formula for one field, we need to change it ten times.
 
To ensure uniqueness required by XML, the IDs are generated sequentially, so if you have a custom control with an edit box with id "test", if it's the first custom control on the XPage it may be view:_id1:_id2:test. If it's a custom control further down your XPage it may be view:_id1:_id57:test. If it's within several custom controls, it may be as complex as view:_id1:_id3:_id40:_id76:test.
 
So that's why the ID is automatically generated and why it's not a bug.
 
If you really want to use IDs to manage your classes, you can always create HTML fields or elements on your XPage instead. But if you're using them to store data, you'll need to handle the back-end saving of the data yourself. So while you're gaining CSS by IDs, you're losing core XPages functionality.
Mar 8, 2011, 3:18 PM
22 Posts
Re: Special notation for Style2ID
The 'trick' is to NOT use <xp:div> and use <div> tags themselves. So your tag will be:
 
 
<div id="objectname1" class="Content">
Content ....
</div>
 
This structure is very common in the OneUI pages and controls.

Newbs
Mar 9, 2011, 7:18 AM
67 Posts
Re: Special notation for Style2ID
 HTML-div, that's it ! 
  
That works great, as expected  ..........
 
Thank you all posters .... 
 
 Uwe 
 
Paul@: 
Thank you for that very detailed description. It helps to understand the underlying philosophy, which is absolut correct from developers standpoint.

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