How can a component generate both stylesheet and HTML code?

Hi All,
I've the following problem. My team is working on several "complex" components which provide a rich client-side behavior (via javascript and css). The components are in charge of generating the following:
+ Stylesheet (linked or inline)
+ Javascript via external libraries
+ HTML code
The problem comes from the fact that the CSS must be generated between the <HEAD> and </HEAD> tags (according to the HTML spec). Obviously, the rest of the code (javascript and HTML) is generated somewhere else on the page, and this is the problem.
Any ideas on how to solve this?
I've been thinking about a pre-process phase that would call every components to render the Css, but it requires substancial changes to JSF... Any help is greatly appreciated
Thanks in advance,
Stephane
http://www.otrix.com

Thanks for the reply but in my case I absolutely need to generate an addhoc css such as:
<style type="css/....>
.name 1 {position: absolute; visibility: hidden... }
.name 1 {padding: 0 0 0 0;}
</style>
What I do is that I spit-out the css first and then generate the HTML. It works fine in IE but I really wanted to be conform to the HTML spec which says that a STYLE tag should be located in the <HEAD> tag. I guess it's probably too much work just to be compliant with the spec....
Thanks again,
Stephane

Similar Messages

  • Can I include both CSS and HTML codes in one Open HTML Editor.

    Somehow Cell phones are not properly reading css codes. Is there any way to include both CSS and HTML codes in one Open HTML Editor?

    Hammad, their code is fairly mobile friendly.  Per my other discussion with you ( http://topliners.eloqua.com/thread/8532 ), Eloqua's code is responsive for the most part.  Most of their issues lie with the styling of the email where you will get different fonts and different sized fonts throughout the email and some other minor display issues.
    What you are trying to accomplish is extremely difficult to do because you do not have the access to the HTML to better control how the responsive template works which is why the Eloqua templates (and most ESP templates) stick to the more basic side of emails.
    If you want to use Eloqua's WYSIWYG to make their responsive email you can do so, but I would recommend deleting all their body text before editing anything because of the inconsistencies in their code.  Otherwise, I think you would be better off coding the emails outside of Eloqua using a 3rd party editor whether it's something more robust like Dreamweaver or Coda, or whether you feel comfortable working in a more text environment with programs like Notepad++ or Brackets.
    At the end of the day remember you are paying Eloqua for these and if you choose to stick with the WYSIWYG and you are not getting the results you expect you need to tell Eloqua through your support channels.

  • How can I link .svg files in the .html code?

    How can I link .svg files in the .html code?

    I use the FileBrowser app by Stratospherix to do this.  I can watch / stream my movies on my iPhone / iPad from my hard drive connected to my Airport Extreme.  I can access all the files on that hard drive as well. 

  • How can a VI be both server and client?

    Hi, 
    I'm new in LabView and I'm trying to build a server and client VI using TCP/IP that runs in two computers. in my program I need both server and client VIs to communicate with each other which means I need both VIs to be server and client. I've tried using a case structure but it doesnt work. The only thing I achieved is a normal server/client system where the server sends a request and the client responses.But i need the client to send requests too.i have attached my VIs to this post.I would appriciate it if someone could help with this problem. 
    Thanks in advanced. 
    Rambaldi.
    Solved!
    Go to Solution.
    Attachments:
    Server-Client.zip ‏41 KB

    Do you really need a client and server on each PC? If you simply need that two to talk to each other they can once the client connects to the server. In most cases you only need one server.
    What Steve said about the not using the same port only applies to two servers on the same machine. A client must use the port the server is listening to and if the client and the server are on the same machine then they will both use the same port. However, only ONE of them is accepting waiting for connections on that port.
    In the code you posted you actually swapped the names. What you call the client is actually the server code and vise versa. In networking a server is an application that listens to an assigned port, accepts connections on that port and provides whatever services it has implemented. A client is an application that establishs a connection to a server. Once a connection is established the two applications can communicate in both directions. The applications themselves will define how the conversation should progress and whether it is a one way conversation or a two way conversation. You don't specify what you are trying to accomplish but I suspect you only need a single server.
    In TCP, every connection is defined by the source and destination IP addresses and the source and destination ports. The server uses a known port (FTP is port 21, HTTP is 80, telnet is 23, or some custom port in the user space beyonds the reserved ports) to listen for connections. The client will use the well known port of teh server and generally picks a random port for its port number. The LabVIEW VIs do this automatically. This is how a server and a client on the same computer can use the same port number. Two servers however cannot. The server application can spawn a child task allowing it to service multiple connections at one time though. Each connection will be unique though since the client's port number, address or both will change for each connection.
    OK, end of networking 101.
    Can you describe in a bit more detail what exactly you want to accomplish. Given that I could probably provide you with more information for your application.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • HT204408 How can I sign into both iMessages and FaceTime?

    I somehow lost connection with both iMessages and FaceTime on my iMac and now unable to sign in.  I am able to access both the App Store and iTunes Store with my Apple ID and password.  I went through the steps suggested in the help section (TS3970) and all appears fine.  I am operating on a iMac running OS X Yosemite version10.10.2  I do not experience any problems on my IOS devices (IOS 8) running iMessages and FaceTime if this means anything.

    I of course already checked and I also checked iTunes, where else can I check?

  • How can I make my XSLT processor accept html code ?

    In my applications the Oracle xslt processor wont accept simple HTML tags within an XML source while transforming the source into HTML. Both processors either will throw parser exceptions or ignore the HTML code in the XML source completely, though output-escaping is explicitly enabled.
    In detail, I want to transform an XML source like this...
    <element>
    Hello, this is a <b>XML</b> text source mingled with html<sup>TM</sup>
    </element>
    ... with an XSL Stylesheet like this...
    <xsl:stylesheet>
    <xsl:output method=html cdata-sections=element/>
    <xsl:template match=element>
    <html>
    <body>
    <xsl:value-of select=. output-escaping=yes/>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>
    ... which should result in a HTML code like this ...
    <html>
    <body>
    Hello, this is a <b>XML</b> text source mingled with html<sup>TM</sup>
    </body>
    </html>
    The result, however, is always like this:
    <html>
    <body>
    Hello, this is a XML text source mingled with htmlTM
    </body>
    </html>
    This means that the additional HTML tags inside the XML source have been completely ignored by the XSLT processor though I enabled the output-escaping.
    If anybody should think now that mingling HTML with XML text is stupid because I could also format the result with the XSL Stylesheet itself, he might be right, of course, but: I cant avoid this because in my application the XML source results from a users web form entry. The user working with the form must be able to decide whether he wants to include HTML in his text or not. In any case, any HTML code he enters should just be transported WITHOUT ANY CHANGES to the resulting HTML page, not omitted without comments! It seems quite simple to me, but the XSLT processor doesnt want to agree with me in this point :-(
    So, once again in brief: Is there any possibility to tell my XSLT processor not to parse, transform or manipulate HTML tags, but to transport them unchanged to the output ?
    After weeks of research any helping sign would be a great relief...
    Many thanks in advance.

    I don't understand the answer, can you please expand. I am trying to do a similar thing by creating an output buffer,
    assemble a mix of text and html tags and then output this buffer later. All of the html tags are skipped or re-escaped in the final html:
    In this example I want to print the IPRCROP, then add an html break (<br>).
    Example 1. Use xsl:text with escape = yes
    <xsl:variable name="buffy">
    <xsl:for-each select="documents/document">
    <xsl:value-of select="IPRCROP"/>
    <xsl:text disable-output-escaping="yes">&lt;br&gt;&lt;/br&gt;</xsl:text>
    </xsl:for-each>
    </xsl:variable>
    <xsl:value-of select="$buffy"/>
    In this case the <br> and </br> end up re-escaped in the output html as #60 etc. so they appear literally as
    ALFALFA <br> BARLEY <br>
    and in source as: ALFALFA&#60; br &gt; &#60; /br &gt;BARLEY
    Example 2, try as pure text, it just skips the <br></br> altogether
    <xsl:variable name="buffy">
    <xsl:for-each select="documents/document">
    <xsl:value-of select="IPRCROP"/>
    <xsl:text><br></br></xsl:text>
    </xsl:for-each>
    </xsl:variable>
    <xsl:value-of select="$buffy"/>
    output = ALFALFABARLEY

  • How can I package a custom block of HTML code to be inserted by clicking the insert panel

    Is there a way to package custom HTML code such as
    <figure>
    <img src="" alt="" />
    <figcaption>
    Caption
    </figcaption>
    </figure>
    so that I can click a button on the insert panel and insert this code?

    Make it a snippet. You will have to insert from the Snippets panel.

  • How can I format for both Mac and PC and keep software updated?

    I have a dilemma. I need to be able to have the iPod formatted for use with both a Macintosh and PC so I can use it as a hard disk on both Operating Systems. The dilemma? I will be "Administering" the iPod and iTunes Music Library at home on a Macintosh.
    How do I update the iPod software as new updates become available on an iPod formatted for PC? The thing to know is that I don't have the option to update it on a PC as the only PCs I have access to are at work and I'm not allowed to install iTunes.
    Any ideas?

    You cannot format the iPod for a PC outside of iTunes on a PC while retaining the capability to use the iPod as a music player. If you can't install any software on the work PCs, your best solution may be to use an USB flash drive for transferring files and leave the iPod in the Mac format.
    (25091)

  • I have 2 icloud accounts how can i see them both on my macbook and iphone

    I have 2 icloud accounts how can I see them both on my macbook and iphone?

    iCloud doesn't have anything to do with texts or phone calls. Those are both tied to your phone number and SIM, not to an iCloud account.

  • My Apple ID and rescue email are reversed. How can I change them both at the same time

    My Apple ID and rescue email are reversed. How can I change them both at the same time?

    I'd already used this standard tool (exhaustively!), but for the problem encountered it operated in Catch 22 mode - you had to do two things but neither order was permitted. I did find an answer eventually, but am not sure what it was I did that solved it! Thanks, anyway.

  • BIAPPS how can we manually set both ETL start date and end date?

    Dears experts,
    how can we manually set both ETL start date and end date while conducting incremental load IN DAC?
    Please advise me.
    thanks,
    Joe.

    You can set those dates in the DAC system parameters tab. You should see lots of $$xxxxxx parameters.
    If I may, I'd suggest you use the OBI Applications forum for questions on DAC.
    Antonio
    BExpert, Brazil

  • I've got two iTunes accounts with apps under each - how can I reconcile them both under one account and one email address?

    I've got two iTunes accounts with apps under each - how can I reconcile them both under one account and one email address?

    You cannot.
    Sorry.

  • My friends put cydia on my ipod and other stuff from it like something who slide your apps differently how can i remove the both, plz help ..???

    My friend put cydia on my ipod and other stuff from it like something who slide your apps differently. How can I remove the both, I really want, plz help ...?

    They hacked it and may have caused damage to your device. Jailbreaking also voids your warranty and support from Apple. To restore to a clean state, restore in Recovery Mode: http://support.apple.com/kb/HT1808

  • I have an iTouch and iPad. The iPad holds a lot more stuff. How can I differentially sync both so I don't have as much on the iTouch and I get to choose what goes on it?

    I have an iTouch and iPad. The iPad holds a lot more stuff. How can I differentially sync both so I don't have as much on the iTouch and I get to choose what goes on it?

    When you connect your iTouch to iTunes, open the device by clicking on the iTough button on the left of the screen (do this after you've backed it up).  Then when open, you can go into apps, music, photos, etc and check or uncheck whatever you want on your iTough.  The same applies to your iPad.  After backup, you open the device and check what you want on the iPad.

  • I recently purchased QuickTime 7 Pro to convert avi files to mov files for editing on Imovie. However, QuickTime won't play the files. How can I get them to play and how can I convert them to mov files?

    I recently purchased QuickTime 7 Pro to convert avi files to mov files for editing on Imovie. However, QuickTime won't play the files. How can I get them to play and how can I convert them to mov files?

    I recently purchased QuickTime 7 Pro to convert avi files to mov files for editing on Imovie. However, QuickTime won't play the files. How can I get them to play and how can I convert them to mov files?
    Both the AVI and the MOV file extensions refer to the file container and not the compressed data the file contains. Both are generic file containers in that each may contain any valid combination of audio and/or video data that is compatible with the codec component configuration of the system on which the file was created. On the other hand, whether a file is playback compatible, conversion compatible, and/or edit compatible depends on the data actually contained in the file container. So, you are basically dealing with two separate issues here—the container and what is inside it.
    Basically, if you want to make your files ediit compatible with iMovie, you must change your file container to one that is acceptable to iMovie and convert the data to edit compatible audio and/or video compression formats as may be necessary. The best approach is to determine what codecs were actually used to create the original AVI files and add them to your system if possible. In most cases a codec package like Perian can be added to your system's codec component configuration to may the AVI file playable. Once they are playable, in the QT 7 app then they can be chnged or converted to file types and compression formats that can be edited in iMovie. (While Perian handles most codecs commonly used to create AVI files, it does not handle all possibilities and, while the Perian codec package still works under cureent Mac OS versions, its development group has decided to drop further development/support of the package.)
    Background: AVI is a file container originally developed by Microsoft back in 1992 but for which official support was discontinued about 11 years. Despite its limitations, Windows users still tend to use this file based on its open source ease of use and generic nature, thus, making its use so popular that most users are unwilling to switch to more modern but less generic file types. Since some AVI legacy compression formats have never been transcoded for the Mac or use beyond OS 9 or OS X PPC platforms, it is often important to know what specific compression formats are contained in the AVI file to know which codecs to add to your system and which not to add in order to avoid possible codec conflicts.
    You can use many different converters to convert AVI files to iMovie edit compatible files. Most third-party apps contain their own buit-in codecs which do not relay on the Mac codec component configuration. Free ones, like HandBrake, usually have limited conversion capabilities while those that have more varied outputs are usually commercial in nature and will cost you additional cash. QT 7 Pro or the free MPEG Streamclip app allow you to access you own system's component configuration and use any available codec component like DV, AIC, MPEG-4, H.264, Photo JPEG, etc.—all of which are iMovie compatible for editing purposes—but only after making the AVI file QT 7 player compatible.
    In order to determine what compression formats wewre used in your AVI files you can
    1) Try checking the Finder "Info" window,
    2) Use the "Inspector", "Media Info", or "Properties" window of any player app that will open the file, or
    3) Use a general media utility app like "MediaInfo" to read the file characteristics.

Maybe you are looking for

  • Output to Projector / External Display

    Mac friends - I, and many many others need some serious help on this issue. I have searched the internet left and right, Apple's very own support forums and found absolutely nothing to help with the issue. I am basically a newbie when it comes to thi

  • 6120 messages problem

    When I got the phone it had the most recent messages at the top but now for the inbox and sent messages they are sort of in the middle of all my messages. I Noticed the sort option but when I select by date or any of the options nothing happens. I ha

  • Updating Flash CS5 Built-In Player, Flex SDK 4.1

    QUESTION 1: I'm trying to update the built-in player of Flash CS5 to the latest 10.1.53.64 version. I've downloaded and replaced the "Players" folder from this link:  http://www.adobe.ca/support/flashplayer/downloads.html. However, when i trace which

  • Column store errors during runtime

    Hi, I created a HANA instance in the trial landscape and directed my application to use the HANA instance schema. Over time, I get errors: SAP DBTech JDBC: [2048]: column store error: search table error: [29] attribute not defined for physical index;

  • AIR 2.6 performance on iOS devices

    When I first tried iOS packager it looked too raw and slow to use in real applications. But the technology was very promising and product was obviously far from release. A new version of AIR (2.6) was released recently and it is claimed that performa