Clipboard is adding '\n' instead of a line break

Community Driven Extensions Project
Post Reply
amit.ismartrecruit
Posts: 31
Joined: 17 Jun 2020, 15:03

16 Jul 2021, 12:31

Having issue with the clipboard copmonant where it is unable to convert \n into new line.

Here is the code in Xhtml:

Code: Select all

<p:commandButton id="cmdCopyQueAns" action="#{pc_inprocessBean.copyQueAns()}" immediate="true" 
 ajax="true" value="#{candidateLbl['scrQueAns.copy']}" styleClass="btn btn-primary" update=":frm:messages"/>
 
<pe:clipboard id="clipCopy" trigger="cmdCopyQueAns" action="copy" text="#{pc_inprocessBean.selectedCandVO.cndJobQueAns}"/>
Expected output:
Add your Email:abc@abc.com
Add your name:Abc
What i am getting:
Add your Email:abc@abc.com\n\nAdd your name:Abc
Any Idea on how to resolve this?

Melloware
Posts: 3716
Joined: 22 Apr 2013, 15:48

16 Jul 2021, 13:25

PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

amit.ismartrecruit
Posts: 31
Joined: 17 Jun 2020, 15:03

16 Jul 2021, 13:58

Okay i'm having same thing but still not working. Do i have to upgrade extension version? I'm using Primefaces Extensions 6.2.11
Last edited by amit.ismartrecruit on 16 Jul 2021, 14:17, edited 1 time in total.

Melloware
Posts: 3716
Joined: 22 Apr 2013, 15:48

16 Jul 2021, 14:00

Yep most likely this was fixed somewhere along the lines because I could not reproduce in PFE 8.0.4 so maybe ClipboardJS fixed the issue under the covers?

If you can create a reproducible test case using PrimeFaces Test I can investigate the issue but I was not able to reproduce it.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

amit.ismartrecruit
Posts: 31
Joined: 17 Jun 2020, 15:03

19 Jul 2021, 07:23

I saw on the tags that test is available for 8.0 and 10.0 but we are using PrimeFaces 6.2.8.

Melloware
Posts: 3716
Joined: 22 Apr 2013, 15:48

19 Jul 2021, 14:00

Yeah for PF 6.2 the last release of PFE was 6.2.10. When I tested that bug I was using 8.0.4 and could not reproduce. We don't release old versions of PFE so there will be no 6.2.11. We only keep up to date on the latest PF version.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests