Just give me a paragraph!
The more I try to work with JSF (I'm trying to do things the JSF way, really, I am!), the more JSF doesn't want to work with me for simple things.
Let's just say I want to show the equivalent of the following HTML, but only if the user isn't logged in:
<p class="info"><a href="login.html">Log in</a> to see more data.</p>Simple, huh? Now, how do I do that in JSF? About the best I can do in JSF is this atrocious verbosity:
<html:panelGroup rendered="#{!user.loggedIn}">
<jsf:verbatim><p class="info"></jsf:verbatim>
<html:commandLink action="login">
<jsf:verbatim>Log in</jsf:verbatim>
</html:commandLink>
<html:outputText value=" to see more data."/>
<jsf:verbatim></p></jsf:verbatim>
</html:panelGroup>I have to create a <html:panelGroup> because there's no JSF <p> component (to my knowledge).
I have to use the nested verbatim because I want to conditionally show the <p> tags along with the content. But in my XML source file, <jsf:verbatim> won't allow a nested beginning tags without ending tags, so I have to XML-escape my beginning <p> tag.
The nested <jsf:verbatim> inside <html:commandLink> certainly makes all this hard to internationalize, but I can live with that---it gets worse, though.
Outside <html:commandLink>, I have to use <html:outputText> because <jsf:verbatim>, because the latter trims off the beginning whitespace. However, I can't put the ending </p> tag literally here because the attribute can't have the less-than character ('<'). If I XML-escape the character, it comes out in the resulting file as escaped, and my XML is well-formed. So I have to put the extra <jsf:verbatim>.
Who knew a simple paragraph would take up so much of my time just to research how to do it in JSF? Now I'm taking more time researching whether it can be done better. Any suggestions? (I know, I can write a JSF <p> component...)
Why on earth didn't JSF provide this [HTML] functionality
with the reference implementation? I know Sun can't
provide everything, HTML equivalents are really
basic, and aren't rocket science.After more thinking and jumping into hard-core custom component development, I'm having some new thoughts---I'm understanding more the JSF architecural principles. This leads me to think that something like Sergey's very useful htmLib should not be included in the JSF API. Here's why.
First, I'm beginning to see where Hans Bergsten is coming from, when he recommends "Improving JSF by Dumping JSP" ( http://www.onjava.com/pub/a/onjava/2004/06/09/jsf.html ). I'm not quite ready to dump JSP, but the tight integration of JSF with JSP obscures the "JSF way" and makes it difficult for newcomers to adjust to its different paradigm.
Let me make an analogy with the Resource Description Framework (RDF) ( http://www.w3.org/RDF/ )---many newcomers have an extremely hard time understanding why RDF is useful or even different, because almost every discussion assumes that RDF is going to be serialized in XML. This in itself isn't so bad, but it leads newcomers to think of RDF as just another XML vocabulary. It's not. RDF is really an abstract framework for describing resources, resource properties, and the values of those properties (which can be other resources)---a framework for creating ontologies that, as some AI pundits would assert, can describe the world itself. XML provides a convenient syntax for serializing a directed graph of an RDF data model, but it produces no different semantics than limitless other syntaxes that could be invented and used to serialize RDF. (A Java properties file is one possible example that could produce a semantically identical RDF data model as could an XML serialization.)
Similarly, JSF is not just a way to write out HTML tags. It's actually a hierarchy of components that replicate the semantics of various data models and their interaction with a user. JSP is just one vehicle to do that; maybe it's not even the best. Maybe JSF is too closely tied to JSP, obscuring this revelation from users.
In this light, Sergey's HTML components have no place in the standard JSF API, because they function merely as a way for new users to quickly get a JSP page to write out a <p>, or a <ul>, or even a <table>. Sergey acknowledges as much: "The library allows you to use old-fashioned HTML layout tags ...., easing the transition to JSF for newbies." ( http://jsftutorials.net/htmLib/ )But the "JSF way" is to think in terms of JSF components implementing data models---whether they spit out XHTML or WAP or SGML is the responsibility of a plugable renderer, and should be distinct from the way the data is stored. htmLib is handy for newcomers and helpful when stuck in a bind and need to get a JSP generated, but designers creating large-scale, elegant JSF application architectures should be weaned away from thinking in terms of brute-force HTML tag writing.
My modification of viewpoint doesn't let JSF off the hook---indeed JSF should provide functionality out-of-the-box that, some way or another, can generate all desirable HTML tags. Instead of shallow wrapping classes, however, they should be robust, capable data model components with comprehensive default HTML renderers. Currently the dataTable component is about the only JSF component that provides a shadow of this concept, and in my opinion dataTable only allows about 70%-85% of needed functionality.
Take HTML <dl> (definition list) for an example. htmLib provides a great way for newcomers to write out an HTML definition list, and provides a teaching tool for learning component creation. The JSF standard component library, however, should provide a definitionList component that descends from UIData, allowing the component to be data-aware. A user should think in terms of an actual list model containing definitions. The definitionList should provide UIColumn descendants for "term" and "definition", and maybe even other columns. The default renderer for HTML would render a <dl> element, with <dt> for each term column child and a <dd> for each definition column child. (After a day of exploring custom component creation, I've just implemented such an animal as I've described.)
In the end, the functionality of such a definitionList with its default renderer is equivalent to htmLib:dl, but the semantics are different: an actual data model is described, and different renderers can be plugged in for other markup types.
Similarly, there should be some sort of text block data model with nestable children. There should either be a different UIComponent class for <p>, <blockquote>, and the like, or the component should indicate its semantics with, say, a semantics="paragraph" or semantics="blockquote" attribute.
In summary, Sergey's components are wonderful and very useful. I'm slowly coming around to the "JSF way," however, which leads me to conclude that, although JSF may need a paragraph data model component with a default HTML renderer, it doesn't need and shouldn't have a pass-through HTML <p> tag-writer such as htmLib provides. The difference is subtle, but paradigmatic.
Cheers,
Garret
Similar Messages
-
Is there another way of getting apps from the appstore without putting your credit card number in, ive heard about the itunes gift card thing can anybody just give me more info about that and how i can buy free things free things from the appstore...pls help as im only a teenager and have no credit credit and my parents dont trust me with theres and they dont care about the fact that you can set up a password/.... PLEASE SOMEONE HELP I WILL BE SO GRATEFUL... And i would really like to get the iphone 4 but if there is no way of etting apps without your credit number then i would have to get a samsung galaxy s3 maybe ...
You can set up an Apple ID without a credit card.
Create iTunes Store account without credit card - Support - Apple - http://support.apple.com/kb/ht2534 -
my iPhone is fully charged and just gives me a blank screen and will not turn off, what do I do?
Reset the phone like the manual says: hold the on/off switch and the home button simultaneously until the Apple logo appears. May take up to 30 sec
-
My iPhone 3GS keeps showing I have app updates but when I go to
App Store It tells me all apps are up to date. Also when I select
purchased apps It just gives me a blank page.Launch iTunes. From the menu bar click Store / View My Account
Click: Edit Payment Information
Make sure you have the correct Security Code.
Then click: Done
And try resetting your Apple ID password. https://iforgot.apple.com/cgi-bin/WebObjects/DSiForgot.woa/wa -
Updated to new version 3.6.6 now browswer doesn't work. Just gives me a untitled tab. Bookmarks nor google button work either.
== This happened ==
Every time Firefox opened
== User Agent ==
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; StarBand Version 4.0.0.2; SearchToolbar 1.1; .NET CLR 2.0.50727; StarBand Version 4.0.0.2; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; StarBand Version 4.0.0.2)On my previous post I said:
"When upgraded to FF 3.6.6, due to Norton 360 v.4, everything froze.
My solution was to downgrade to FF 3.6.4, because with that version i had no problems, and now again everything works fine.
Not the best solution but it is better than downgrading to FF 3.5.x as I saw many users did."
Now I want to add that, after running FF 3.6.4 for 3 days, i got again the security warning to upgrade to FF 3.6.6, so I did.
Now am running FF 3.6.6, and even with Norton, everything works fine, no bugging, freezing, refreshing, blank pages...
I can't figure out why the problem still persist for other users. Now maybe it is not due to Norton any more? -
I use iphone5, I see an app update on the app store. but when App store and click on the update tab, it doesn't show me which application to update.. just gives me a blank page.!!!! I wouldn't able to know what app has to be updated, untill and unless i get check for each every app on the app store installed on my iphone... what is the solution for this.!!!! can any1 one help me out.!!!!
Cc2528 wrote:
The iTunes Store on my iPad is set up with all my music already. And at the very bottom it shows my apple Id username. The only place it shows the previous owners id is in the App Store...
You can probably change the ID in the "iTunes and App stores" settings on the iPad....click on the wrong account ID , select sign out, then log in with your own ID, I have not done this but I think it works.....
but I would be more inclined to to the factory reset and start afresh. -
It will play in iTunes but just gives a black screen when I try o email. I get an error message when I try to upload. Any Ideas?? I've already reinstalled OS X
Not sure if this Term is Relevant towards an iPhone but, my iPhone won't Post unless if it's plugged into a Charger.
-
i Ave been to apple tody and got my iPhone 5 replaced only to find I can't activate it? I have tried turning it on and off and plugging into iTunes still nothing ..it just gives me can't activate server unavailable? Anyone help me please
Did you check the security software on your computer?
Resolve issues between iTunes and security software - Apple Support
You can also go back to the Apple Store and let them activate the phone. -
After I did the newest update ios7 on my iPhone 4 now it just gives the iTunes screen
Since I updated my iPhone 4 there has been a terrible lag in the voicemail especially when deleting voicemail. So as soon as I saw there was a new update I downloaded it. Now my phone won't do anything it just gives me the iTunes picture on the phone.
Your phone is in recovery mode. You must restore it on your computer via USB
-
Since the last update my i tunes wont launch it just give error message Error 7 (Windows error 127) how do i fix it please?
Like many others I have been reading about online I am having the same error. I tried the fix listed above and simply wasted 30 minutes of my time. I scheduled a time for Apple to call and help me through this and their solution was for me to call Microsoft for some reason?!! iTunes made me upgrade then stopped working - I really don't see how this is a Microsoft problem??
Like Darren if a solution is not found quickly I will also have to sell my phone as the only way to get videos and music on my phone is through the software that you made me upgrade, broke and won't help me fix. -
My macbookpro is not opening pdf sites from safari or firefox, it goes to the address but just gives me a black screen. I can however open a pdf file that I have saved on my HD, it opens on preview. any thoughts? osx 10.6.8
Back up all data.
Triple-click the line of text below to select it, the copy the selected text to the Clipboard (command-C):
/Library/Internet Plug-ins
In the Finder, select
Go ▹ Go to Folder
from the menu bar, or press the key combination shift-command-G. Paste (command-V) into the text box that opens, then press return.
From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
I've seen an unconfirmed report that the "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you might need to remove it as well, if applicable.
If you still have the issue, repeat with this line:
~/Library/Internet Plug-ins
If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again. -
I have iphoto 6 and my pictures are no longer showing. I have tried importing them but it just give me an error msg. (file format not recognized) I have tried rebuilding the iphoto library but that doesn't work either. Any suggestions?
How did you rebuild?
Try these in order - from best option on down...
1. Do you have an up-to-date back up? If so, try copy the library6.iphoto file from the back up to the iPhoto Library allowing it to overwrite the damaged file.
2. Download <a href="http://www.fatcatsoftware.com/iplm/"><b><u>iPhoto Library Manager</b></u></a> and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.
3. If neither of these work then you'll need to create and populate a new library.
To create and populate a new *iPhoto 6* library:
Note this will give you a working library with the same Rolls and pictures as before, however, you will lose your albums, keywords, modified versions, books, calendars etc.
Move the iPhoto Library to the desktop
Launch iPhoto. It will ask if you wish to create a new Library. Say Yes.
Go into the iPhoto Library on your desktop and find the Originals folder. From the Originals folder drag the individual Roll Folders to the iPhoto Window and it will recreate them in the new library.
When you're sure all is well you can delete the iPhoto Library on your desktop.
In the future, in addition to your usual back up routine, you might like to make a copy of the library6.iPhoto file whenever you have made changes to the library as protection against database corruption. -
I have received 3 friend requests via email but I cannot accept them. When I select view request, it just gives me directions on downloading the app and there are no requests in my app. How do I accept the request?
Which "app" are you talking about?
-
The install wizard stops and "rolls Back" the install and just gives the attached notice of the install error...how can this be corrected?
The notice is inserted first and the stopping point is second.Da ich gar kein Englisch kann kann ich auch nicht sagen was sie mir
geschrieben haben ich kann nur Vermuten was das sein soll es tut mir leid
aber ich kann ihnen keine Konkreter Antwort geben alle Sprechen Englisch
nur ich nicht mehr kann ich dazu nicht sagen
Constantin Preda
2015-02-12 21:45 GMT+01:00 Claudio González <[email protected]>:
The install wizard stops and "rolls Back" the install and just gives
the attached notice of the install error...how can this be corrected?
created by Claudio González
<https://forums.adobe.com/people/Claudio+Gonz%C3%A1lez> in Adobe Reader
- View the full discussion
<https://forums.adobe.com/message/7189357#7189357> -
I am trying to get photos off of my airport time capsule back up onto my new macbook pro. I followed the above instructions and after I choose the library I want to upgrade and hit continue it wants to open my iPhoto to convert, when I click yes it just gives me the original message and sends me back to this page. Am I missing something?
Is your Time Capsule being used for your TimeMachine back up? Or is it simply being used as an external hard drive?
To use a TimeMachine back up you must first restore it
LN
Maybe you are looking for
-
Satellite L670 - Hard Disk Dead after 8 months only
Hi, this morning I had to retunr my laptop due to bad hard disk problem. After 8 months, it's dead already. The positive points are: I am still under warranty and second the toshiba software hilighted me on time, allowing me to back up my data before
-
Getting error while importing the Sequence
All, I created a sequence in DB and using in ODI for row_wid col in DIM1. I used seqname.NEXTVAL for the col in DIM, interfacing running fine, data also loading. Dim, sequence is under Dev SCHEMA1. But when i export the scenario and run in the test r
-
Hi, Current Interface Flow - File (xml) to Idoc (single Idoc type) Thirdparty sends a File for Goods Receipt. This file may have multiple orders. Orders are sorted in an xslt by ORDNUM. Each record has a delivery type (Deliver Type PO or Delivery Typ
-
I am trying to obtain an App for a 4s and I cannot find the correct store.
I cannot find the app store for a Iphone 4S. I also do not know how to determine the difference. I keep getting an error that the I cannot check for OS update. My IPhone model is: MC608LL/A My IPhone SN is 80*****A4S I use ATT <Personal Information E
-
Tried to download Facebook app update to iPhone 4s last night. It would not complete. This a.m., I have a fb icon on the screen -- dark-grayed out. It will not delete. I tried downloading the app again, and it will not download. I have also turned