Problem with cellEditor and textArea with complete

UI Components for JSF
Post Reply
f1l0
Posts: 18
Joined: 14 Feb 2013, 09:50
Location: Austrria

13 Sep 2014, 11:44

Hi all,

I have 2 strange behaviors of the cellEditor component if I use a inputTextArea (in the input facet) that has a complete method (with the last PF snapshot and also with 5.0 CE ).

This is the situation:

If I edit the cell in the datatable and (without pressing enter) I click a commandButton (outside the table) to refresh the datatable the cell is not updated and the value stored is the id of the inputTextArea component (ex: form:celleditor:0:j_idt35).

Image

1) This problem (value with the ID) occur only if the textArea has a complete method (a second click on the button will show the ID also in the output facet).
2) The update of the cell (pressing a button outside the table) is always present (general problem).

Test Bean:

Code: Select all

@SessionScoped
public class TestBean implements Serializable {

    private List<User> users = new LinkedList<User>();

    public TestBean() {

        users.add(new User("user1", ""));
        users.add(new User("user2", ""));
        users.add(new User("user3", ""));
    }

    public List<String> complete(String query) {
        return new LinkedList<String>(); // just an example
    }

    public List<User> getUsers() {
        return users;
    }

    public void setUsers(List<User> users) {
        this.users = users;
    }
}
User Class:

Code: Select all

public class User implements Serializable {
    private String name;
    private String pwd;

    public User(String name, String pwd) {
        this.name = name;
        this.pwd = pwd;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }
    
}
form:

Code: Select all

<h:form id="form">

    <p:commandButton value="Test" process="celleditor" update="celleditor"/>

    <p:dataTable id="celleditor" value="#{test.users}" var="user" rowIndexVar="idx" editable="true" editMode="cell">
        <p:column headerText="Rows">
            <p:cellEditor>
                <f:facet name="output">
                    <h:outputText value="#{user.name}"/>
                </f:facet>
                <f:facet name="input">
                    <p:inputTextarea value="#{user.name}" completeMethod="#{test.complete}" minQueryLength="1" maxlength="40000"/>
                </f:facet>
            </p:cellEditor>            
        </p:column>
    </p:dataTable>

</h:form>
ps.
the problem 2) (I think) occur because the event cellEdit is not fired when clicking a button outside the table (I also tried to verify it with a p:ajax cellEdit event: not fired...).

Any advice?

Thank you,

Roberto
PrimeFaces 8 | PrimeVue 1.3.2 | Weblogic Server | NetBeans 8.1 | Mageia 7

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

13 Sep 2014, 13:03

As it is a snaphot version file an issue.
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

f1l0
Posts: 18
Joined: 14 Feb 2013, 09:50
Location: Austrria

13 Sep 2014, 14:55

Hi Andy,

it also happen on PF 5.0 CE.

Should i hope an issue for it ?

Thank you,

R.
PrimeFaces 8 | PrimeVue 1.3.2 | Weblogic Server | NetBeans 8.1 | Mageia 7

f1l0
Posts: 18
Joined: 14 Feb 2013, 09:50
Location: Austrria

14 Sep 2014, 10:32

Hi,

I found a workaround to avoid the two problems. I manually trigger the change event on the blur event:

Image

Image
PrimeFaces 8 | PrimeVue 1.3.2 | Weblogic Server | NetBeans 8.1 | Mageia 7

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 38 guests