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
2
votes
1 answer

Why are validations from my JSF composite facet being done when the facet is not rendered

I have a problem that validations from a composite's facet are being fired even when I do not render the composite. I stripped the problem down to the following barebones code. Here is the composite entityDetailPanel:
2
votes
1 answer

How not to set an attribute of a component inside a composite component if it is empty?

I have a h:graphicImage in a composite component like this:
2
votes
1 answer

Conditionally render depend on p:selectOneMenu value

I'm trying to build a custom component from existing Primefaces components and I need some help here. I have a selectOneMenu and I want it to render or not (and disable or enable) other components according to which option is selected in the menu.…
Denis Klein
  • 101
  • 1
  • 11
2
votes
1 answer

Why is not evaluated on and

I have a JSF 2 master template as follows:
Buhake Sindi
  • 87,898
  • 29
  • 167
  • 228
2
votes
1 answer

Does JSF prevent calls to unrendered managed bean actions by tampered requests

A method in a managed bean is protected by JSF? See the code: Managed Bean @ManagedBean public class My { public void test() { System.out.println("called"); } } XHTML
2
votes
1 answer

How can I hide a togglable p:panel before the page loads?

I have a JSF page with 2 components, a button and panel. The button calls jQuery toggle to hide and show the panel. I would like that when the page loads, the panel is initially hidden, so that when I press the button for the first time, the panel…
TuGordoBello
  • 4,350
  • 9
  • 52
  • 78
2
votes
1 answer

JSF render dir="rtl" when language is arabic

I want to render the text direction rtl (Right-To-Left) in an inputText when the browser's Accept-Language is arabic in my JSF application. When Accept-Language is english the text introduced by the user would be dir="ltr" (Left-To-Right). How can I…
jose
  • 303
  • 4
  • 17
2
votes
1 answer

Conditionally render components with ajax conditionally only if validation passes

I am using JSF 2.2 and I was wondering if there is a way to render components with ajax conditionally only if the validation passes. By using the render attribute of ajax the components will be rendered regardless of the validation passing or not.…
Gabriel
  • 67
  • 2
  • 6
2
votes
1 answer

Conditional render in tagfile depending on whether the attribute is specified or not

I have a Facelet tagfile and need to render different components depending on whether the attribute is specified or not. I tried it as below,
2
votes
1 answer

Conditionally render other component when radiobutton is changed

I am trying to display a menu if a radiobutton is selected. I'm using the rendered attribute for this purpose. Model: private int type; // +getter+setter View:
2
votes
1 answer

in JSF page does not work, seems to always evaluate false

In my JSF page I use tag to conditionally display content. However, it does not work as it seems to always evaluate false. E.g.
Rasoul Taheri
  • 802
  • 3
  • 16
  • 32
2
votes
1 answer

Form submit in conditionally rendered component is not processed

I have a custom tagfile with a form: I'm conditionally rendering it by ajax as below:
user2775499
  • 23
  • 1
  • 3
2
votes
1 answer

Conditionally render a component based on selectOneMenu value

Is there a way to render a component based on the current value the user has selected from a selectOneMenu component? My selectOneMenu component is populated with an enum consisting of two values, smoker and non-smoker. If the user has smoker…
Alan Smith
  • 1,069
  • 4
  • 19
  • 23
2
votes
2 answers

Conditionally toggle value of component attribute based on a boolean

I'm having a JSF datatable with one column containing a list of artists together with a commandLink for each that I'd like to either show or hide the albums that specific artist has made when you click the link. I've just started to learn about JSF…
nivis
  • 913
  • 3
  • 17
  • 34
1
vote
2 answers

Issue with Conditional Rendering in React Custom Component

I'm facing an issue with conditional rendering in a custom component in my React application. I've been working on creating a custom component for conditional rendering that renders content only when a specific condition is met. Here's the code I…
sanbinary
  • 81
  • 1
  • 8