0
onclick="window.open('/pages/PDocPreview.jsf?nid=#{pBeanDetail.id}&loadfirst=1&edit=true&fromPage=true&currentName=#{pBeanDetail.dName}&pId=#{pBeanDetail.user.id}', 'popupWindowName', 'dependent=yes, menubar=no, scrollbars=yes, resizable=1,toolbar=no,left =5, top=5, width=1100, height=800');"

Here, In currentName=#{pBeanDetail.dName} part I am facing issue when value contains '.

I have checked many possibilities but received error while page open.

  1. with use of inner output text
  2. With JSTL fn tag lib
  3. combination of 1 & 2

Code Examples:(Not Working)

currentName=<h:outputText value="#{fn:replace(pBeanDetail.dName,'\'', '\\'')}"></h:outputText>


currentName=#{fn:replace(pBeanDetail.dName,'\'', '\\'')}


*This question is different from similar question as I need to use EL expression with fn functionality in Javascript event

Jubin Patel
  • 1,959
  • 19
  • 38
  • @BalusC: so Custom component is Solution for same. I have already same though BUT when you look at my question `"` and `'` are already used with `onclick` and with `window.open`. Now I am not able to use any quotes again. Please give solution of same if you have. Thanks in advance – Jubin Patel Nov 24 '15 at 07:06
  • I have no idea what you're talking about. There are nowhere custom components. How exactly is the answer in abovelinked duplicate unclear? It precisely explains you how to escape JavaScript in Expression Language. – BalusC Nov 24 '15 at 07:09
  • ohhh, not component its taglib, Now question is have you tried to use quotes inside the quotes? I am facing that kind of error here. Let me know if need more explanation. Mean you can not write quotes like:`"window.open('page.jsp?doc='v1'`')" here At v1 we will face issue. – Jubin Patel Nov 24 '15 at 07:23
  • Huh? So you haven't tried the answer at all? First do so and let me know if you still get the same error message. – BalusC Nov 24 '15 at 07:25
  • let me try on that way – Jubin Patel Nov 24 '15 at 07:27
  • @Baluc: Thanks. It's silly mistake wile implementing – Jubin Patel Nov 24 '15 at 09:08

0 Answers0