primefaces

How to show button in a row only on mouseover?

∥☆過路亽.° 提交于 2019-12-24 05:05:14
问题 I would like to show a close button to be display on a row in a last column (while mouse over on that row) I don't want the close button to be always visible but just on a mouse over. If anyone has an example that would be greatly appreciated. 回答1: this is very simple example css table a{ display: none; } table tr:hover a{ display: inline; } and html <table> <tr> <td>12</td> <td>asdasd</td> <td><a href="">Close</a></td> </tr> <tr> <td>12</td> <td>asdasd</td> <td><a href="">Close</a></td> </tr

How to show button in a row only on mouseover?

北城余情 提交于 2019-12-24 05:04:29
问题 I would like to show a close button to be display on a row in a last column (while mouse over on that row) I don't want the close button to be always visible but just on a mouse over. If anyone has an example that would be greatly appreciated. 回答1: this is very simple example css table a{ display: none; } table tr:hover a{ display: inline; } and html <table> <tr> <td>12</td> <td>asdasd</td> <td><a href="">Close</a></td> </tr> <tr> <td>12</td> <td>asdasd</td> <td><a href="">Close</a></td> </tr

Setting id for a dynamic menu element in primefaces does not work

送分小仙女□ 提交于 2019-12-24 04:55:11
问题 Am using primefaces 5.3. I am generating a primefaces menu dynamically. I want to set the id on the menu elements so that I can display a tooltip based on that id. My code is: DefaultMenuModel menuModel = new DefaultMenuModel(); DefaultMenuItem homeMenuItem = new DefaultMenuItem( "Hello"); homeMenuItem.setIcon("fa fa-home"); homeMenuItem.setTitle("halloo"); //Setting the id here homeMenuItem.setId("homeId"); menuModel.addElement(homeMenuItem); However when I view the page source or inspect

Unhighlight first highlighted item from AutoComplete

…衆ロ難τιáo~ 提交于 2019-12-24 04:47:08
问题 Here I am using p:autoComplete tag in PrimeFaces 5.1, but I can't remove first highlighted/selected item from the suggestions list. How I can remove this ? 回答1: Since your "problem" comes from this particular line, firstItem.addClass('ui-state-highlight'); What happens here is when the suggestions are ready to show up the script highlights the first item of the list, so in your case you would just "unhighlight" that item. I have created a small function that would do that on every

Primefaces datatable on row select javascript callback

杀马特。学长 韩版系。学妹 提交于 2019-12-24 04:44:09
问题 I'm trying to call a javascript function whenever a row of a datatable is selected .I can't use ajax because I don't need to send a request and wait for a response from the server to fade in/out a menuBar. One last remark ,the datatable is in single selection mode . Any help will be appreciated .. 回答1: PrimeFaces Extensions comes to the rescue here. Use <pe:javascript event="rowSelect" execute="alert('Datatable rowSelect event called')"/> If you need the row key for the selected row, use: <pe

How to execute javascript method from server side?

强颜欢笑 提交于 2019-12-24 04:32:17
问题 in primefaces there's the RequestContext class which add the ability to invoke javascript method from server side : RequestContext context = RequestContext.getCurrentInstance(); //execute javascript oncomplete context.execute("PrimeFaces.info('Hello from the Backing Bean');"); i was wondering if it's possible to accomplish that with jsf 2 without using primefaces, please advise. 回答1: The easiest but also hackiest way would be to set a property which represents the content of a <h:outputScript

Date format jqplot categoryaxisrenderer after ticks add

只谈情不闲聊 提交于 2019-12-24 04:21:50
问题 I use jQplot with primeFaces. I would like a date formatter for the CategoryAxis (dates are in millis). I found different solutions on Stack but the problem seems to be my ticks : they are adds "after" the creation and options/format are not taking into consideration. ticks: this.cfg.categories, I tested with datetickformatter, a custom datetickformatter, CanvasAxisTickRenderer, and edition of CanvasAxisTickRenderer. In vain. this.cfg.axes = { xaxis: { renderer: $.jqplot.CategoryAxisRenderer,

Date format jqplot categoryaxisrenderer after ticks add

独自空忆成欢 提交于 2019-12-24 04:21:31
问题 I use jQplot with primeFaces. I would like a date formatter for the CategoryAxis (dates are in millis). I found different solutions on Stack but the problem seems to be my ticks : they are adds "after" the creation and options/format are not taking into consideration. ticks: this.cfg.categories, I tested with datetickformatter, a custom datetickformatter, CanvasAxisTickRenderer, and edition of CanvasAxisTickRenderer. In vain. this.cfg.axes = { xaxis: { renderer: $.jqplot.CategoryAxisRenderer,

Submitting form by hitting ENTER event in primefaces p:autoComplete

吃可爱长大的小学妹 提交于 2019-12-24 03:54:10
问题 Below is my code: <h:form> <p:autoComplete id="autoCompleteID" value="#{myBean.item}" completeMethod="#{myBean.completeMethod}" </p:autoComplete> <h:commandButton action="#{myBean.searchRelatedItems}"/> </h:form> Here my scenario is like standard Google search, I can see related Items in suggestion and also redirect another page based on text typed in p:autoComplete text field. Its works fine by click on Button, but I also want to achieve by hitting ENTER in p:autoComplete text field. 回答1: A

PrimeFaces: export chart as picture

谁说胖子不能爱 提交于 2019-12-24 03:47:06
问题 I'm trying to export my PF chart as picture following the showcase: enter link description here <h:form id="form1"> <p:chart type="line" value="#{chartView.lineModel1}" style="width:500px;height:300px" widgetVar="chart"/> <p:commandButton type="button" value="Export" icon="ui-icon-extlink" onclick="exportChart()"/> <p:dialog widgetVar="dlg" showEffect="fade" modal="true" header="Chart as an Image" resizable="false"> <p:outputPanel id="output" layout="block" style="width:500px;height:300px"/>