jsf-2

Copy text to clipboard from jsf / primefaces

旧巷老猫 提交于 2019-12-24 17:54:53
问题 I am using https://github.com/patricklodder/jquery-zclip to implement copy to clipboard function. it should copy some text, but for now i want it to be anything really... but its not working at all. I included in head: <h:outputScript name="js/jquery.zclip.min.js" library="test" /> <script> $(document).ready(function(){ $('a#copy').zclip({ path:'#{resource['/test/js/ZeroClipboard.swf']}', copy:$('div#content').text() }); }); </script> and in JSF page i have an ordinary : <a href="#" id="copy"

Preventing multiple getter invoke in a session managed bean?

╄→尐↘猪︶ㄣ 提交于 2019-12-24 17:27:26
问题 i'm using jsf 2.0.2 + richfaces 3.3.3. what can i do so my getter won't be invoked multiple time ?? i have this: @ManagedBean(name = "mybean") @SessionScoped public class mybean implements Serializable { public MyClass getMyClass() { if (FacesContext.getCurrentInstance().getRenderResponse()) { myClass = get_it_from_database(); } return myClass; } i also used this: @ManagedBean(name = "mybean") @SessionScoped public class mybean implements Serializable { public MyClass getMyClass() { if

preRenderView not firing with ui:include

非 Y 不嫁゛ 提交于 2019-12-24 17:20:29
问题 I have a typical JSF templated menu structure and page. Below is the code of my main page <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui" xmlns:c="http://java.sun.com/jsp/jstl/core"> <ui:composition template="/templates/internal3section.xhtml"> <ui:define name="events"> <f:event listener="#{mainBean.entryGate}" type="preRenderView" /> </ui

JSF update primefaces tree children

北慕城南 提交于 2019-12-24 17:12:10
问题 i want to update the children of the primefaces tree without pulling the whole tree from the server. I can update the whole tree but not only the children of a specific node ... Edit: This is an example of my code: <p:tree value="#{cc.tree}" var="wrapper" id="tree" widgetVar="tree" styleClass="commentTree-#{cc.id}"> <p:treeNode id="treeNode" styleClass="treenode-#{wrapper.id}"> Hallo: #{wrapper.text} </p:treeNode> </p:tree> Now i want to update a specific treenode. function findIDbySelector

p:selectBooleanButton doesn't render preselected value

天大地大妈咪最大 提交于 2019-12-24 16:38:57
问题 I been reading / trying examples for hours, and I can't make it work. I'm using Primefaces 4.0 I just need a way to select/unselect and assign those values to a Map The xhtml looks like this. <p:selectBooleanButton value="#{presupuestoBean.itemsCambiar[itemPresupuesto.id]}" onLabel="Yes" offLabel="No" onIcon="ui-icon-check" offIcon="ui-icon-close"> <p:ajax listener="#{presupuestoBean.updateItemPresupuestoAsignado(itemPresupuesto.id,0)}"/> </p:selectBooleanButton> Init Method (reset to False

Primefaces datatable colspan column width - Not Working

拟墨画扇 提交于 2019-12-24 16:37:51
问题 i try to create a primefaces datatable with fixed column width for some(not all) columns. The tableheader got 3 rows with colspan and rowspan. I want now to fix the width of the first column under "a". The second column should be dynamic. Without Colspan i could use the width attribute of the Header Column element. But now i cant use the header column because it is for two columns. The width for the normal Column is ignored. (width="30" and style="width:30px;") I added a screenshot of my

How to trigger JSF render from jQuery

隐身守侯 提交于 2019-12-24 16:18:03
问题 Is it possible to trigger jsf <f:ajax render> inside an jQuery? For example something like this: /* if component Y changes trigger render event on component Y */ $("#source_compoment").bind("change", function(e) { $("#target_component").trigger("render"); }); Or with other words is there an equivalent for "f:ajax render" within jQuery? 回答1: Yes , make a hidden button <h:commandButton id="myHiddenButtonID" value="RenderSomething" style="display:none"> <f:ajax render="target_component"></f:ajax

No ViewState is sent

佐手、 提交于 2019-12-24 16:14:55
问题 I have a JSF 2.2.0-m12 application with primefaces 3.5. Since I ported the application from JBoss 7.1.1 to Tomcat 7.0.39, the first change of an inputfield (inputtext, slider, button,...) after reloading a page works fine, but the second change does nothing. I searched for the differences between the first and the second request: 1st request: JSF phases: Phases from 1 till 6 are executed In Firebug 'network -> all -> POST zinsrechner.xhtml -> post' is a viewstate: contentForm contentForm

Primefaces dataTable inside tabView the row selection not working correctly

元气小坏坏 提交于 2019-12-24 16:09:26
问题 I have a tabView with a dynamic number of tabs which displays search results (in a class SearchInstance). Inside a tab there is also a tabView which displays a search result in different ways. One tab of this inner tabView shows the search results in a dataTable (as List). The rows are selectable. I propagate the selected search results in the table to the current SearchInstance object. Unfortunately the selected search results are only set correctly on the last tab. If I select a search

ui:include value is evaluated before preRenderView

ぐ巨炮叔叔 提交于 2019-12-24 15:55:19
问题 page1.xhtml <h:body> <h:link outcome="page2.xhtml> <f:param name="id" value="1"/> </hlink> </h:body> page2.xhtml <h:body> <f:metadata> <f:event type="preRenderView" listener="#{myBean.init}"/> </f:metadata> <ui:include src="#{myBean.myString}"/> </h:body> MyBean.java public void init(ComponentsystemEvent e){ Map<String,String> params = FacesContext.getExternalContext().getRequestParameterMap(); String myId = params.get("id"); int id = Integer.parseInteger(myId); if(id==1) setMyString =