myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Aranda <brunoara...@gmail.com>
Subject Re: [jira] Commented: (MYFACES-377) x:div suport for visibleOnUserRole
Date Wed, 03 Aug 2005 18:30:18 GMT
Great to have you here again Sylvain! :-) Yes... that would be a good
solution...
I am going to change the behaviour of the rendered attribute to not
render any children in case it is false... I will check also the white
space thing...

Bruno

2005/8/3, Sylvain Vieujot <svieujot@apache.org>:
>  Hello Bruno,
>  
>  I would say that the behavior of the rendered attribute should be
> consistent, so rendered="false" shouldn't render anything.
>  
>  I think the best approach would be to allow blank values in htmlTag (not
> sure it works with the current code).
>  So you could do :
>  <x:htmlTab value="#{myCondition ? 'b' : ''}">Bold (or not) text</x:htmlTag>
>  
>  Sylvain.
> 
>  
>  On Wed, 2005-08-03 at 20:03 +0200, Bruno Aranda wrote: 
>  Well, I don't know if you have download the last nightly, because
> yesterday i put the rendered attribute to htmlTag/div, as it is in
> other components such as outputText. The 'problem' with this is that
> now if rendered is set to false, only the tags are not rendered, but
> everything between the begin tag and the end tag it is rendered.
> 
> a) If div is rendered like inputText:
> 
> <x:div rendered="true">Div content</x:div> --- renders --> <div>Div
> content</div>
> <x:div rendered="false">Div content</x:div> --- renders ..> Div content
> 
> b) In components like inputText you do not have children, but you do
> in panelGroup for instance. If a panelGroup is not rendered, its
> children are not rendered either. If we choose this approach:
> 
> <x:div rendered="true">Div content</x:div> --- renders --> <div>Div
> content</div>
> <x:div rendered="false">Div content</x:div> --- renders ..> (nothing here)
> 
> Which may be what we would expect by intuition. But also, in this b) case:
> 
> <h:htmlTag value="b" rendered="true">Bold text</htmlTag> --- renders
> --> <b>Bold text</b>
> <h:htmlTag value="b" rendered="false">Bold text</htmlTag> --- renders
> --> (nothing here)
> 
> Would be that also desired behaviour? IMO, for some tags would be ok
> to do not render nothing, like the <div> case, but for others it would
> be better to not render the tag (the <b> case). But I would stick to
> only one of those cases, or two new ideas... ;-)
> 
> Regards,
> 
> Bruno
> 
> 2005/8/3, Grigoras Cristinel <grig77@gmail.com>:
> > Hi,
> > 
> > I want the same behavior like rendered. 
> > You need only to change HtmlTag class to extend
> > org.apache.myfaces.component.html.ext.HtmlOutputText; 
> > and off course the tag declaration
> > 
> > Thanks very much.
> > Cristi
> > 
> > 
> > Bruno Aranda (JIRA) wrote: 
> > [
> >
> http://issues.apache.org/jira/browse/MYFACES-377?page=comments#action_12317480
> > ] 
> > 
> > Bruno Aranda commented on MYFACES-377:
> > --------------------------------------
> > 
> > What behaviour do we expect when visibleOnUserRole or just
> rendered="false"
> > is set. Now x:div extends from x:htmlTag, and when rendered="false" it is
> > just the tag that is not render, and not the tag and its children (this is
> > ok for a tag like <b>, but what to do with <div>). My intuitions tells
me
> > that if the div is not render, it's children should not be rendered
> > either...
> > 
> > 
> > 
> > x:div suport for visibleOnUserRole
> > ----------------------------------
> > 
> > Key: MYFACES-377
> > URL: http://issues.apache.org/jira/browse/MYFACES-377
> > Project: MyFaces
> > Type: New Feature
> > Components: Tomahawk
> > Versions: Nightly Build
> > Environment: all
> > Reporter: Grigoras Cristinel
> > Assignee: Bruno Aranda
> > 
> > 
> > 
> > the x:div tag is mising visibleOnUserRole, why ?
> > 
> > 
> > 
> >
> 
>

Mime
View raw message