IceFaces: inputRichText save on submit not working in IE? - jsf

I'm having problems with an ice:inputRichText component and saveOnsubmit in IE. When the form containing the input is submitted, I only get the original text and not any of the changes the user has made.
This is the code I use for displaying the input component:
<ice:inputRichText height="250" toolbar="Transfer" customConfigPath="/FCKconfig.js" id="messageBody" value="#{InvitationPageBean.messageBody}" language="sv" saveOnSubmit="true" />
I'm using IceFaces 1.8.2.
In other browsers, for example Firefox 3.6 and Safari 5, it all works as expected.
Any ideas?
Thanks!

the save, should do it in a .java
and in the xhtml is:
<ice:inputRichText
customConfigPath="/js/Config.js"
toolbar="Mail"
height="275"
width="600px"
value="#inputRichTextBean.value}"
skin="silver"
language="#inputRichTextBean.lang}"
valueChangeListener="#{inputRichTextBean.changeSave}"
/>

Related

HREF target='_blank' does not work in Chrome 79

Using simple HTML code, no JavaScript, nothing fancy, I use this HREF
Click here
Clicking on the link in IE, FireFox, Edge does open a new tab for https://www.example.com on click. In Chrome (version 79), the click just redisplays the current page.
This happens on Chrome desktop and phone (Android). There are no add-ins to my installation of Chrome; no popup or ad blocking installed.
Why doesn't Chrome open a new tab when target="_blank" is used? Thanks.
Added
The issue seems to be with an HREF being inside a FORM element. The FORM element is as follows:
<form action='' method='post'>
An HREF with target="_blank" outside the FORM element works properly. Just not inside the FORM element.
But still puzzled as to why that would be the case...and for a workaround or solution.
Added more - plus code
There's a button inside the form, and the button contains an image, and the link in the button will not open up a new tab.
Simple form with the button
<form action='' method='post'>
<p>inside the form</p>
<p><button><img src="https://via.placeholder.com/150 " width="24" height="24" class='button_img' alt='delete' /> that's a button</button></p>
<p><button>that's a button </button></p>
</form>
So, with even further testing, the click to open a new tab won't work in Chrome when the HREF is wrapped around an button with an image inside a form. But works in FireFox and Edge.
Why?
There are four image/buttons inside the form. The fourth one is the HREF/blank. Items 1-2-3 are form submittals; values need to be passed to the form processing page. The 4th item doesn't need to be processed by the form, but it is inside the form so that all four items will be on the same line. If I place the 4th (HREF/blank) outside of the form, then the 4th item is wrapped around to the next line.
a
The <button> tag cannot be opened in a new tab the same way an <a> does.
You can use this instead:
<p>
<button onClick="window.open('https://www.bklnk.com/B004RVZRL0');">
<img src="https://via.placeholder.com/150 " width="24" height="24" class='button_img' alt='delete' />
that's a button
</button>
</p>

Is there a inbuilt tag in JSF 2.0 that can support Application/PDF content Type

I'm performing a F:AJAX call where I receive a byte Stream output whose content type is application PDF. I want this bytestream to be loaded in a JSF equivalent tag which should make me specify the content type as "Application/PDF" during tag declaration. Also, f:View fails saying content type not supported. Any JSF specific tags to cater this. Thanks.
Use iframe tag. This line shows how to use it:
<iframe src="foo.pdf" width="600" height="400" scrolling="no"></iframe>
If you also want to hide the (default) border, add frameBorder="0".
There is also pdf.js library that allows to browse pdf in browser. https://blog.oio.de/2014/04/11/integrating-pdf-js-pdf-viewer-web-application/
The answer is no there isn't such a tag.
To be honest there's no need to change it, since using HTML for this is fine and really the simplest way. You can use IFRAME (like Jay Smith shows you) or OBJECT.
The same way is presented on PrimeFaces's showcase:
<h3>PDF</h3>
<object type="application/pdf"
data="/showcase/resources/demo/media/guide.pdf?pfdrid_c=true"
height="300px" width="100%" internalinstanceid="3">
Your browser can't display pdf,
click
to download pdf instead.
</object>

How to show bar only with barcode of Primefaces?

I want to show a barcode code39 without the code at the bottom.
I'm using the component barcode of PrimeFaces 6.0. This is the code I'm using:
<p:barcode id="codigoBarras" type="code39" value="#{bienControl.bienSelected.idBien}" format="svg" alt="Codigo de Barras" height="30" width="300" />
Thanks in advance.
I debug this issue. It might be bug of primefaces6.0
Used Below code:
<p:barcode value="code39" type="code39"/>
Output:
The above image looking for http://localhost:8080/LoginExample/faces/javax.faces.resource/dynamicconten…d=TpWw%2Bzz7eLk%3D&pfdrt=barcode&gen=code39&fmt=code39&pfdrid_c=true&ori=0 this src, so its not avalible.
Then i changed src by inspecting the browser then it worked.

Displaying PDF , Richfaces

How can I display a PDF document on a rich:popupPanel. I am trying to display PDF document in a popup from a view scoped JSF page.
Issue faced : Parent page stops working when I click on the h:commandLink which fires a new view to display the PDF
The simplest way I know is to use HTML directly. You can use IFRAME or OBJECT.
So just put something like this in your rich:popupPanel:
<rich:panel>
<iframe src="path_to_your_file/sample.pdf"
class="pdfFrame" width="800" height="1000" scrolling="no" />
</rich:panel>
I don't think there's a way to do this with pure JSF tags. The same way is presented on PrimeFaces's showcase:
<h3>PDF</h3>
<object type="application/pdf"
data="/showcase/resources/demo/media/guide.pdf?pfdrid_c=true"
height="300px" width="100%" internalinstanceid="3">
Your browser can't display pdf,
click
to download pdf instead.
</object>

object pdf type is not render in mozilla and chrome

Im doing a document searching system, that shows a list of pdf like response, I´m working with primefaces 5
this is my code
<h:outputLink value="file/#{document.pdfPath}" target="_blank" >view document</h:outputLink>
<div id="pdf2">
<object data='file/#{document.pdfPath}'
type='application/pdf'
width='700px'
height='400px'>
<p>It appears your Web browser is not configured to display PDF files.
No worries, just <a href='file/#{document.pdfPath}'>click here to download the PDF file.</a></p>
</object>
<div id="pdf">
<object data="http://www.gnu.org/software/hello/manual/hello.pdf" type="application/pdf" width="450" height="375"></object>
</div>
But this is the problem in eclipse and IE browser runs perfect,but in chorme and mozilla only show the pdf that doesn´t come from a managed bean.
it is what I´m watching
With chrome
With mozilla
and finally Internet explorer (works perfect here)
Here, from your response headers:
Content-Disposition: attachment; filename="contratotest.pdf"
Your /file servlet is serving the PDF as an attachment. This is intented for the "Save As" dialogue thing. If you intend to display the content inline in the web page instead of as an attachment of the web page, then you need to set it to inline.
response.setHeader("Content-Disposition", "inline");
Or just remove it entirely. It's the default already. You may only need to add an extra parameter to the fallback link to force attachment anyway when clicked.

Resources