I have added PrimeFaces p:editor component on my form and defined controls for it like this:
<p:editor id="editorId" value="#{someBean.SomeText}"
controls="bold italic paste pastetext" width="800" height="150" rows="6"
disabled="#{not someBean.editorEnabled}"
autoResize="false" onchange="submitSomething()" />
And as you can see in the attached image the paste button is disabled. So i wonder how can you enable this button?
I'm running PrimeFaces 6.0 on WebSphere Application Server 8.5.
I get the same issue on primefaces showcase:
http://www.primefaces.org/showcase/ui/input/editor.xhtml
using
Firefox 49.0.1 and Chrome 53.0.2785.143.
Related
I am migrating my application UI which is written in richfaces into primefaces.
We have a commandlink in a code which opens up a panel directly using rich:toggleControl inside a rich tab in rich tabPanel.
<a4j:commandLink style="color:blue; text-decoration: underline; font-size:8pt;font-style: italic;" value="Yearly calculation link (click here)" >
<rich:toggleControl targetItem="#next" targetPanel="yearlyCalculationPanel" />
</a4j:commandLink>
This command link opens the particular panel in an another tab directly.
Does primefaces have an alternate to this particular functionality?
I am developing a project with Primefaces 5.1 and JSF 2.2.
In my project, I used dialog component to show some details to the user's.
When I drag the dialog into the top of the browser screen when browser scroll is down, its getting hide behind the browser screen after that can not close the dialog box.
Here, I added a sample code.
Please, help me to control the behind screen hiding.
Sample Code:
<h:body>
<h:form>
<p:panel header="Test" style="height:1500px;">
<p:commandButton value="Click" oncomplete="PF('dialogBoxId').show();"/>
</p:panel>
</h:form>
<p:dialog header="Alert" id="dialogBoxId" widgetVar="dialogBoxId"/>
</h:body>
I have upgraded my primefaces application from primefaces version 3.3 to 6.0 (latest). Most of the components and pages are working fine except the pages where p:datatable is shown inside p:dialog. It stretches the dialog to the full width of the browser. If I resize the browser all the columns stacked on each other. What is the solution for this issue?
Set the width attribute of the primefaces dialog to a specific value like below:
<p:dialog id="myDlg" widgetVar="myDialog" modal="true" width="1000" resizable="false" appendTo="#(body)" header="Header" closeOnEscape="true">
//your table here
</p:dialog>
If in the dialog you also have a form the you can put the entries of the form on a gridPanel.
The newest version of PrimeFaces has a "responsive" dialog attribute. So your dialog code should be something like this:
<p:dialog> id = "someDialog" widgetVar = "someDialog" modal = "true" responsive = "true">
//dialog code
</p:dialog>
It was put into version 6.0 https://github.com/primefaces/primefaces/issues/327
I have a Primefaces editor on my page and I want to submit the content to the server when the user focuses on a different component on the page.
<p:editor value="#{}">
<p:ajax />
</p:editor>
This works find for example with p:inputText, but with the editor I get this error:
Unable to attach <p:ajax> to non-ClientBehaviorHolder parent
I also tried adding the onchange attribute to the p:editor and calling a remoteCommand to submit the content, like this:
<p:editor widgetVar="documentation" onchange="submitDocumentation" />
<p:remoteCommand name="submitDocumentation" process="#parent" update="#none" />
That works, but on every single keystroke. I only want to submit the content of the editor when the focus is lost.
Is it possible to use Ajax to submit the content of a Primefaces Editor when focus is lost?
Using Tomcat 7, Mojarra and Primefaces 4.0
You can do it in the next way.
$(document).ready(function() {
//documentation is the editor widgetVar
PF('documentation').jq.find("iframe").contents().find('body').blur(function(){
submitDocumentation();//remoteCommand
});
});
I'm having a problem with an Openface TabbedPane in a JSF application so I created a new application to test the TabbedPane. I have the following code in my page:
<h:form>
<o:tabbedPane>
<o:subPanel caption="Tab 1">
<h:outputText value="Hello from tab 1"/>
</o:subPanel>
<o:subPanel caption="Tab 2">
<h:outputText value="Hello from tab 2"/>
</o:subPanel>
<o:subPanel caption="Tab 3">
<h:outputText value="Hello from tab 3"/>
</o:subPanel>
<o:subPanel caption="Tab 4">
<h:outputText value="Hello from tab 4"/>
</o:subPanel>
</o:tabbedPane>
</h:form>
Initially tab 1 is shown. The next tab I click works (no matter which is the next) but no other tab when clicked works. For example when I click tab 2 I can see its contents but when I then click tab 3 I its contents are not shown and I still see previous tab's contents. I checked Mojarra's version on my Glassfish and it is 2.1.6. When I force the loading mode to be "client" everything is working but when I force it to be "server" I get the following error when I try to click a third tab:
[Ljava.lang.Object; cannot be cast to com.sun.faces.application.view.StateHolderSaver
There are some state-related issues with Mojarra 2.1.6, which are known to prevent OpenFaces from working correctly.
Officially, only Mojarra 2.0.3 is currently supported, but according to the preliminary testing Mojarra 2.1.8 appears to work as well (it still has to undergo additional testing before we declare compatibility with this version officially, but you can try see if it's acceptable for you).