component « Bean « JSF Q&A

1. JSF 1.2 Custom Component - Body Content From Backing Bean

I am developing a custom component using JSF 1.2 . My tag class extends UIComponentELTag and has variables of data type ValueExpression. The values for these are getting set from the ...

2. cannot use values from beans in facelets custom component

i cannot use any bean value in my custom control.: for instance: this is my foo.taglib.xml file.


3. JBoss Seam: components injected into POJOs, but not Session Beans

I have a Seam component that handles login, with the name "authenticator":

public class AuthenticatorAction implements Authenticator
    private EntityManager em;

    @In(required=false) ...

4. Can we have a component-scoped bean in a JSF2 composite component?

I was wondering how I could create "component-scoped" beans, or so-to-say, "local variables inside a composite component" that are private to the instance of the composite component, and live as long ...

5. JSF: how to rendered=#{bean.isRendered} multiple components at one time

I tried this but does not work:

<f:verbatim rendered="#{bean.isRendered}">

6. Sink JSF 2.0 Composite Component Event in Parent Page Backing Bean

I have a conceptual mind-block around the use of a JSF 2.0 composite component within a parent page. I understand how to implement an ActionListener (and others) for a composite component's ...

7. Adding JSF 2 composite component at runtime from backing bean

Edited question... Hello, I would like to load a .xhtml file of my composite component from a backing bean, and add it to the page dynamically. The name of the .xhtml file comes ...

8. JSF 2.0: Why does a JSF bean get created when it's used in a component that is not rendered?

Let's have an extremely simple composite component:

Bean for it:
public class TestBean {

    private boolean someField = false;
    public boolean getSomeField() { ...

9. Unable to update value of component which is bound to bean

I am trying to create a socket client with a web UI by JSF. In this application, the client is connecting to the server, sends the message to the server, receives ...

10. ManagedBean for a composite component

I'm developing a composite component that has to do some calculations for the layout to work properly. Calculations that are to complex for the EL (not actually complex but I can't ...

11. JSF 2.0: h:inputText inside composite component fails with non-String objects when validation is set

In a backing bean:

Integer foo;
If I have form like:
    <h:commandButton value="Submit" />
    <h:inputText value="#{}" />
This works ok. However, if I do something like

12. Custom component and access to backing bean

Is it possible in JSF2 from a custom component (in method encodeBegin) to access to the FacesContext and managed beans? Thanks you.

13. JSF composite component with backing bean

I'm trying to get a composite component working with it's own backing bean, using the example on p375 from the Core JSF 3 book, but just get an NPE. The problem seems ...

14. jsf - assign id to a component from a backing bean

I have to work with some ids of some components in my backing bean so I've declared them as constants and I want to use them also in jsf (instead of ...

15. JSF component assign value couldn't set in Backing Bean

JSF page component like

<h:selectOneMenu id="noteSectionForDateText" value="#{historyQuestBean.selectedNoteSection}" accesskey="Y">
   <f:selectItems value="#{historyQuestBean.noteSection}" />
now in Backing Bean historyQuestBean :
private SelectItem[] noteSection;
    { ".getNoteSection ...

16. JSF composite button reinitiliazes view scoped managed bean

As soon as a composite which encapsulates a commandButton is included in my .xhtml, the viewscoped bean is reinitialized no matter which commandButton is used. Is my composite wrong? Please let ...

17. Binding a managed bean instance to composite component

I have a composite component (collapsiblePanel). The component uses the "collapsible" bean to provide the toggle function. When I use the same component multiple times on a page, each instance of ...

18. Basic question about backing beans for Composite Components

I can't find any guidance on this question. I am writing a composite component that needs its own backing bean because it interacts with a data base. The new ...

19. How does a composite component set a property in it's client's backing bean?

I have a composite component with an interface that contains this:

<cc:attribute name="model"
                  shortDescription="Bean that ...

20. Can not invoke managed bean Action method from DojoFaces button component

I am trying to use DojoFaces in my next JSF based portlet. I am using JSF 1.1 with JSR 286 portlets to be deployed on WPS 6.1. Problem is, I am using ...

21. Composite component backing bean location

I'm trying to split my JSF2 pages into composite components. So I decided to put the composite components in a logical file tree. For example:

The associated bean is in

22. use jsf managed bean in facelet custom component as in jsf within jsp

I have jsf application in which I have to use a facelet custom component (defined in a custom tag library). In order to achieve this I have done the following: - created ...

23. Set Managed Bean as parameter in Composite Component

Is there a way of setting a managed bean parameter in a composite component and then leaving the using classes to decide which actual managed bean to use? something along the ...

24. JSF component binding without bean property

How does exactly the following code work:

<h:inputText id="txt1" binding="#{aaa}"/>
I mean, usually the component binding works, by specifying a property (of type UIComponent) in a bean. Here, there's no bean nor property ...

25. Backing bean properties set by component binding are still null before RENDER_RESPONSE phase. Why?

I implemented a PhaseListener for the RENDER_RESPONSE phase, which calls an init() method of a certain backing bean using the following code (simplified) in beforePhase():

FacesContext ctx = FacesContext.getCurrentInstance();
ValueBinding vb = ctx.getApplication().createValueBinding("#{myBackingBean}");
BackingBean ...

26. JSF component bindings and EJB session bean valueChange

I would like to inject an Event scoped component (POJO) into a Conversation scoped EJB session bean, where the Event scoped bean has JSF components bound to it.Then, in the EJB session bean I would like to respond to valueChange events from the UI, where the valueChange event changes the JSF components bound to the event scoped (injected) bean.

28. Backing bean vs custom component

I wonder what the general opinions are on implementing GUI behaviour in backing beans instead of custom components. As a small example, I have a panelgrid with a few commandlinks and images of flags in them that I would like to show some marker for the selected language. One aproach would be to let a backing bean discover the currently selected ...

30. backing bean retrieval from component

31. Accessing UI Components within Managed (Backing) Beans

Hello Richard, I see what you're saying work fine but this was not exactly what I was looking for. I think that I found now what it is but I'm not completely sure if this is a good approach. I found something like this: ... // Component declaration private HtmlOutputText myOutputText; ... // Getters and setters ...

33. Modify components in backing bean

37. How to force a value in a component from the backing bean

Hi! I have three SelectOneMenu components, A B and C. At first only A is rendered, after option choice B comes up, and after B's choice, C comes up. I have a value change listener in my A component, which if the value of A is changed, it should trigger the C component to hide, and set it's value to an ...