jsf-2

Can I add/remove Primefaces components dynamically?

安稳与你 提交于 2020-01-13 13:14:12
问题 How can I add/ remove the primefaces inputText dynamically? 回答1: To add/remove textboxes, try the following snippets. <h:panelGrid columns="1" cellpadding="10"> <h:commandButton value="+" action="#{contactBean.addPhone}" image="../images/addbtn.png" /> <p:dataTable border="0" value="#{contactBean.phoneNos}" var="p" rowIndexVar="rowIndex" emptyMessage="No phone numbers entered"> <p:column> <h:selectOneMenu id="extraTask1" value="#{p.phoneType}"> <f:selectItem itemLabel="Select" itemValue="" />

Can I add/remove Primefaces components dynamically?

最后都变了- 提交于 2020-01-13 13:13:45
问题 How can I add/ remove the primefaces inputText dynamically? 回答1: To add/remove textboxes, try the following snippets. <h:panelGrid columns="1" cellpadding="10"> <h:commandButton value="+" action="#{contactBean.addPhone}" image="../images/addbtn.png" /> <p:dataTable border="0" value="#{contactBean.phoneNos}" var="p" rowIndexVar="rowIndex" emptyMessage="No phone numbers entered"> <p:column> <h:selectOneMenu id="extraTask1" value="#{p.phoneType}"> <f:selectItem itemLabel="Select" itemValue="" />

Declaration of beans in applicationContext.xml

僤鯓⒐⒋嵵緔 提交于 2020-01-13 11:28:47
问题 I have a question regarding declaration of classes in applicationContext.xml In applicationContext.xml do we need to specify all the classes from the application? E.g. In my small web application I have a Entity class, Service class and DAO class. So currently it is defined as <!-- Beans Declaration --> <bean id="Employees" class="net.test.model.Employees" /> <!-- User Service Declaration --> <bean id=" EmployeeService" class="net.test.employees.service.EmployeeService"> <property name=

Integrating jquery datepicker into jsf

寵の児 提交于 2020-01-13 11:02:33
问题 I was following the examples here and here but I cann't bring it to work. Could you help me please? Here is where I define the script and below where I (suppose to) use it... <script> $(function() { $( "#createDate" ).datepicker({ showOn: "button", buttonImage: "images/calendar.gif", buttonImageOnly: true }); }); </script> <ui:define name="columnFilters"> <th> <h:inputText value="#{listModel.creationDate}" id="creationDate" valueChangeListener="#{listController.filterFieldChanged}"> <f

JSF 2.0 implicit navigation, different views

浪子不回头ぞ 提交于 2020-01-13 10:58:23
问题 I'm looking for a good explanation to JSF 2.0 implicit navigation and how it works with views. To be more precise, I understand that from an action method I can return a string which is the outcome of the action. If there's a JSF view whose file name matches the outcome, then this is implicit navigation. Now... my question, what if the action is invoked from a view that's inside a folder but the view that I want to navigate to next is in a different folder? I.e., from /manager/edit.xhtml an

Absolute path name in my template to get resources

依然范特西╮ 提交于 2020-01-13 10:38:07
问题 In my JSF 2.0 Facelets application I have one glorious template that I want all the pages to use. It is in the root directory of the web-app disguised with the name template.xhtml. So it is referenced as you would expect: <ui:composition template="./template.xhtml"> However I do navigate now and then to client files in sub-directories. It is useful to organize them this way because of different privilege levels. The facelets in those subdirectories would have a reference to the same template

Command buttons invokes actions on second push (jsf)

核能气质少年 提交于 2020-01-13 09:23:13
问题 I came to strange behaviour of my application. Command buttons start to invoke actions on second hit. On first - nothing happens. It takes effect on firefox and chromium, but in epiphany works as usual. My environment: - ubuntu 11.04 - glassfish 3.1.1 - jsf 2.X - primefaces 3.2 - firefox 12.0 - epiphany 2.30.6 Code example: <ui:define name="content"> <h:form id="form"> <h:panelGrid id="panelGrid" columns="3"> <h:outputText value="#{msg.fieUserName}:"/> <h:inputText id="name" value="#{userBb

How to position a p:dialog in Prime Faces after its resizing

为君一笑 提交于 2020-01-13 08:35:51
问题 I have a Prime Faces p:dialog that has been resized while new components are inserted when opened ('show' state). However its position doesn't change and it's size is increasing from the down left corner until the page bottom. I need to reposition it every time I render new components dynamically. Is there any JavaScript function I can call to its widget to reposition? I'm using PrimeFaces 3.5 with Mojarra 2.1.13. 回答1: This is a method that should work in your case : Bean code : @ManagedBean

p:commandButton does not perform the operation with a single click

寵の児 提交于 2020-01-13 06:50:07
问题 p:commandButton does not perform the operation with a single click I have the following table <p:dataTable id="firmasTabla" var="car" editable="true" editMode="cell" value="#{clientesMB.itemsPersonaFirmanUtil}" widgetVar="carsTable"> <p:ajax event="cellEdit" listener="#{clientesMB.modiCellPersonaFirma}" update=":form2:growl" /> <p:column headerText="Nro CI" style="width:30%"> <p:cellEditor> <f:facet name="output"><h:outputText value="#{car.ci}" /></f:facet> <f:facet name="input"><p:inputText

Event dateSelect on primefaces ajax in calendar not working

荒凉一梦 提交于 2020-01-13 04:32:59
问题 I have a calendar: <p:calendar id="fechaInicio" mode="inline" value="#{informesBean.fechaInicio.fecha}" pattern="#{informesBean.fechaInicio.pattern}"> <p:ajax event="dateSelect" listener="#{informesBean.limpiaLink}" update="link" /> </p:calendar> And this is my limpiaLink in informesBean : public void limpiaLink(SelectEvent event) { Date date = (Date) event.getObject(); extraido = false; System.out.print(date.toString()); } And I have a breakpoint in line Date date = (Date) event.getObject();