Is there a way in JSF to output some text based on a boolean?
For example:
h:outputText value="Black" rendered="#{bean.isBlack}"
The bean property is called isBlack not getIsBlack...I dont want to rename this.
Thanks,
D
|
Given the following JSF fragment:
<h:outputText ... rendered="#{bean.r} />
<h:outputText ... rendered="#{bean.r} />
<h:outputText ... rendered="#{bean.r} />
How can I factorize to something that would look like:
<h:someKindOfGroupOrSomething rendered="#{bean.r}>
<h:outputText ... />
...
|
I have a context loader class which loads an XML file with info on which components to show or hide on a page. On the JSP pages, within the 'rendered' ... |
<h:form>
Do you have a driving license?
<h:selectOneMenu value="#{requestScope.license}">
<f:selectItem itemLabel="Select..." itemValue=""/>
...
|
Trying to make JSF web application multilingual. For that purpose cover all the HTML code with <f:view> tags:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<html xmlns= ... >
<f:view locale="#{actionsContainer.languageDetails.locale}">
<head>
...
|
Can I set the value for rendered attribute of h:commandLink from JavaScript?
<h:commandLink id="profileLink" rendered="#{bean.enable}">
|
How can I get rid of the empty space by components not rendered via rendered attribute?
I want to display a list of objects in a dataTable and sort them by a ... |
|
I have a panelGroup with a rendered attribute. Why is it that the component values in the panelGroup are even called if the rendered attribute is set to false? Do I ... |
I have a screen with 2 JSF Input Components: inputText and inputText with suggestionBox. They are both bound to the same field, but only one can be visible/rendered (mutual exclusion).
The ... |
I have a JSF page that contains:
<div class="tableCaption">
<h2>Batch Details</h2>
</div>
and a CSS that defines the look of .tableCaption h2
I want to wrap the above div in a JSF component that ... |
Whats the easiest way to toggle the rendering of a JSF Component based on a javascript flag?
I want to display certain things based on whether the user has HTML5 enabled...e.g. geolocation, ... |
I'm using Mojarra 2.0.3 on JBoss 6.1.0 final. I'm having a problem with the value setter method for an h:selectBooleanCheckbox not being called if conditional rendering is specified in the tag. ... |
Originally posted by Leo Budima: I know of DWR and it's great - this solution has crossed my mind, but is an overkill since I just need to show some hidden components that are allready on the page, and I think this must be possible via client-side scripting, but am to new to JSF to know exactly how Only one way ... |
|
|
|
Hello Nitin, You need to have a look at your action attribute. It should be an EL expression, that should point to some method on your managed bean. It it returns nothing or null, you will be redirected back to the page the call came from. If you have a navigation case defined in your faces config xml file, and this ... |
Consider this bit of JSF code: In the above example, the boolean method isFirstTest() is called. If it returns false, we don't want to output either of the child outputText values. If it returns true, then we want to output the first child outputText value ("Hello"), and we might or might not want ... |
Can you use a function inside of the rendered attribure? Rendered takes a true/false value. What I'm trying to do is compare to backing bean values to determine if link should be displayed. Something like this: rendered="#{!(frCodeBeingDisplayed == loggedInAs)}" The above doesn't work. What I have found is that you can set rendered to a backing bean value (True or False), ... |
|
|
|
|
|
|
|
|
|
Well, your panelGroup is inconsistent with your use of raw HTML for the table, for one thing. You'd typically use panelGroup with panelGrid and dispense with the HTML tags altogether. However, panelGroup is for putting multiple things in one column that would normally each get their own separate column, not for optional rows. I'm pretty sure, however, that if you don't ... |
|