Questions tagged [conditional-rendering]

Conditionally choose which jsf tags to convert to DOM

Conditional rendering is selectively choosing which jsf( or jsp) components will be translated to the DOM elements by the javax.faces.render.Renderer in jsf framework. All jsf components have attibute rendered which evaluates to boolean. Based on this boolean Renderer chooses to create or not create the dom with this particular element.

386 questions
84
votes
3 answers

Conditionally displaying JSF components

First, I am new to Java EE, came from a strong ASP .NET development background. I have gone through the net, and I might miss this but it seems like there is no simple and straight-to-the-point tutorials on how I could connect backing bean class to…
Haikal Nashuha
  • 2,958
  • 7
  • 44
  • 67
59
votes
1 answer

Ajax update/render does not work on a component which has rendered attribute

I'm trying to ajax-update a conditionally rendered component. ...
36
votes
1 answer

Why do I need to nest a component with rendered="#{some}" in another component when I want to ajax-update it?

So I've found a few answers close to this, and I've found enough to fix the problem I had. But even so, I'm curious as to understand the workings around this. Let me illustrate with an example : I have a facelet .xhtml page that looks like this…
blo0p3r
  • 6,790
  • 8
  • 49
  • 68
35
votes
4 answers

How to conditionally render plain HTML elements like

I'm trying to implement a composite component which either displays the information details of a user in plain text or displays them through editable input texts fields if the desired details are those of the user currently connected. I know that al…
Ionut
  • 2,788
  • 6
  • 29
  • 46
21
votes
2 answers

React JS: How to animate conditionally rendered components?

Example is a functional component in which I am rendering a div conditionally. I want this div to fade-in when rendered conditionally and fade-out vice versa. For that, I have maintained two local state variables: render and fadeIn which are…
21
votes
1 answer

JSTL c:if doesn't work inside a JSF h:dataTable

I'm trying to use to conditionally put a inside a when the state is finished.
ErVeY
  • 1,524
  • 4
  • 16
  • 26
19
votes
7 answers

How to use switch cases inside JSX: ReactJS

I have four components imported in my react app. How can i render one of the component conditionally (based on props). This is what i'm trying to do ;…
Vishnu
  • 1,611
  • 1
  • 14
  • 27
13
votes
2 answers

Conditionally render ui:define

How do I conditionally render a ? The data in the template depends on a required . But if an invalid view parameter is provided, then the should not be rendered since the default content of the template should be…
djmj
  • 5,579
  • 5
  • 54
  • 92
11
votes
1 answer

Conditional rendering of non-JSF components (plain vanilla HTML and template text)

I'm trying to conditionally render a therefore I cannot use as it will render to or
My current (working) approach is the following: my tr stuff…
olsn
  • 16,644
  • 6
  • 59
  • 65
9
votes
9 answers

ReactJs - Conditional Rendering or hiding component

What's the de facto approach to choosing between conditional rendering or hiding the component with { display: 'none' }? For the sake of discussion, let's say that I have a FilterComponent that holds the title of the filter, and a list of…
fasaas
  • 592
  • 1
  • 6
  • 23
6
votes
1 answer

Preact/typeScript conditional rendering "expression expected"

Hello all i want to do is a simple conditional rendering which i have done in react before but i cant seem to do it in preact. export const InfoSection = (props: Props) => { return (
Johan Jönsson
  • 539
  • 1
  • 10
  • 23
6
votes
2 answers

Angular2: ngIf without destroying component

I have a web page with a tab control taking up a portion of the screen. The tabs are shown/hidden using *ngIf and comparing the selected tab against an enum. Thus the components are destroyed / created every time the user changes tabs. Usually…
JALLRED
  • 855
  • 1
  • 11
  • 23
6
votes
2 answers
5
votes
3 answers
4
votes
1 answer

conditional rendering of the same component with different props does not unmount the component in ReactJS

I'm working on a react web application the problem that I have is that I'm doing a conditional rendering of the same component with different props but that does not unmount it then remounts it again which means that the component did mount cycle is…
1
2 3
25 26