Dynamic accordeon panel + inplace editor = no commit

UI Components for JSF
Post Reply
stevevo
Posts: 2
Joined: 02 Nov 2011, 16:13

03 Nov 2011, 12:39

Dear reader

As you can see beneath I use a template where I put a dynamic accordionPanel into. Within the tab is a inplace editor.

The problem is that i can adjust the input of the inplace editor but when i click "Save" nothing happens.

Code: Select all

...
<ui:define name="content">

    <h:form>

        <p:accordionPanel value="#{onkostenController.onkostenByGebruiker}" var="onkost" multiple="true">
            <p:tab title="#{onkost.omschrijving}">
                <h:panelGrid columns="2" columnClasses="column" cellpadding="5">
                    <h:outputText value="Omschrijving : " />
                    <p:inplace editor="true">  
                        <p:inputText value="#{onkost.omschrijving}" required="true" label="text"/>
                    </p:inplace>
...
OnkostenController:

Code: Select all

...
    public List<Onkosten> getOnkostenByGebruiker() {
        FacesContext context = FacesContext.getCurrentInstance();
        String gebruikersnaam = (String) context.getExternalContext().getRemoteUser();
        this.gebruiker = gegevensService.opvragenGebruiker(gebruikersnaam);

        return onkostenService.alleOnkostenGebruiker(gebruiker);
    }
...
Data Acess:

Code: Select all

...
    public List<Onkosten> alleOnkostenGebruiker(Gebruiker gebruiker) {
        EntityManager em = emf.createEntityManager();
        Query query = em.createQuery("select o from Onkosten o where o.gebruiker = :gebruiker");
        query.setParameter("gebruiker", gebruiker);

        return query.getResultList();
    }
...

Code: Select all

...
    private String omschrijving;
...
    public String getOmschrijving() {
        return omschrijving;
    }

    public void setOmschrijving(String omschrijving) {
        this.omschrijving = omschrijving;
    }
...
PrintScreen:
Image

Thanks in advance.
I use Java EE 6, Primefaces 3.0.M3 and Glassfish Server

Steve

User avatar
andyba
Expert Member
Posts: 2473
Joined: 31 Mar 2011, 16:27
Location: Steinfeld, near Bremen/Osnabrück, DE
Contact:

04 Nov 2011, 12:16

I may be wrong here but inplace editor Save only saves the input field value to the Bean.
If this works as expected (ie your bean field is updated correctly) then you need to add more code which causes the changes to be commited to the backend when the field is updated.
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Seo-Ul-But and 26 guests