question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DataTable: Onfocus event fired three times with cellEdit/rowEdit

See original GitHub issue

Describe the defect onfocus fired three times on inputtext with cellEdit DataTable

Environment:

  • PF Version: 8.0
  • JSF + version: 2.2.12-jbossorg-2
  • Affected browsers: ALL

To Reproduce Steps to reproduce the behavior: 2. Click on cell Year 3. Show browser console 4. See same log three times for focus

Example XHTML

        <p:column headerText="Year">
            <p:cellEditor>
                <f:facet name="output"><h:outputText value="#{car.year}" /></f:facet>
                <f:facet name="input"><p:inputText value="#{car.year}" style="width:96%" label="Year" onfocus="console.log('focus row'+#{index})"/></f:facet>
            </p:cellEditor>
        </p:column>

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:21 (13 by maintainers)

github_iconTop GitHub Comments

3reactions
mirmalagcommented, Aug 19, 2020

Hi there, office is closed for summer holidays. I’ll test it as soon as I can and give feedback.

Thank you to get on it, Mirco

1reaction
mellowarecommented, Aug 3, 2020

I can see 3 focus events are registered to the input thus that is why 3 are being called. image

Trying to figure out how to handle this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

focus event is firing multiple times - javascript - Stack Overflow
Basically, your event is added several times. A simple way to fix this is to set the event via the property of the...
Read more >
Button click fired multiple times when performing filtering
Hello, I've a datatable with 2 button as first row. The data are retrieved via ajax and there're footer input to filter on...
Read more >
Element: focus event - Web APIs | MDN
The focus event fires when an element has received focus. The event does not bubble, but the related focusin event that follows does...
Read more >
onfocus Event - W3Schools
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found