cancel
Showing results for 
Search instead for 
Did you mean: 

Just wondering

rdanner
Champ in-the-making
Champ in-the-making
I was digging around in the UI components this evening and i browsed passed some HTML code in the component classes.

In the faces components I have developed I have worked hard to keep things like HTML isolated to the Renderers.

Is there a good reason for the component classes to make assumptions about how they are rendered (ie getting a hold of a response writter and outputting HTML tags)?

Doesnt this kind of defeat one of the major points of JSF which is plug in support for different view technology?

Anyway I just browsed passed some code and havent made a real investigation about what I seem to be posting on.  Please take my question as a general question on JSF approach rather then some kind of critique.
6 REPLIES 6

gavinc
Champ in-the-making
Champ in-the-making
JSF does allow what are called "self rendering components", meaning that if you know your component is only ever going to be used in one particular view technology you can allow it to generate the appropriate rendering code.

Therefore those components that you have found HTML generation in are those that we felt, at the time, were only pertinent for the web. If you disagree with this choice in any of the components please feel free to raise the issue as a bug on JIRA.

rdanner
Champ in-the-making
Champ in-the-making
JSF does allow what are called "self rendering components", meaning that if you know your component is only ever going to be used in one particular view technology you can allow it to generate the appropriate rendering code.

Therefore those components that you have found HTML generation in are those that we felt, at the time, were only pertinent for the web. If you disagree with this choice in any of the components please feel free to raise the issue as a bug on JIRA.

I dont disagree with anything… i am mostly ignorant  :wink:   I just have questions.

There is so much code that to "wade" through it and figure out the intention of the developers is impossible.  Its better from my point of view to get on here and ask.

kevinr
Star Contributor
Star Contributor
Is there a good reason for the component classes to make assumptions about how they are rendered (ie getting a hold of a response writter and outputting HTML tags)?

Doesnt this kind of defeat one of the major points of JSF which is plug in support for different view technology?

Yes i think so - but in the real world the components are never going to output any other than HTML/XHTML.

Kevin

fselendic
Champ in-the-making
Champ in-the-making
Is there a good reason for the component classes to make assumptions about how they are rendered (ie getting a hold of a response writter and outputting HTML tags)?

Doesnt this kind of defeat one of the major points of JSF which is plug in support for different view technology?

Yes i think so - but in the real world the components are never going to output any other than HTML/XHTML.

Kevin

Hmmm, why are you so sure about that? I do understand near term. However, I've seen JSF XUL output, and I'm very much interested in seeing JSF Swing/SWT and especially XAML output in the future.

kevinr
Star Contributor
Star Contributor
For our web-client yes I'm sure. If someone is brave enough to extract the common Alfresco components and refactor them to use separate renders etc. then they are welcome, but in the real world with real development timescales choices had to be made that sometimes do not fit the ideal.

rdanner
Champ in-the-making
Champ in-the-making
For our web-client yes I'm sure. If someone is brave enough to extract the common Alfresco components and refactor them to use separate renders etc. then they are welcome, but in the real world with real development timescales choices had to be made that sometimes do not fit the ideal.

We understand there is a game of balance going on.  The work is great, the components are beautiful.  We are happy.   It is always a struggle to balance idealism with production time line.  I had a professor that told me once "Perfection is the ENEMY of the good."

its good advice.