viewparams

JSF: reloading page via p:button using “?includeViewParams=true” results in %2C for integer GET param in new URL

我与影子孤独终老i 提交于 2020-03-25 13:51:36
问题 I have a page that has two GET params: round = [some integer] group = [some string] See URL above. These are the two components of the group's PK, an INT + a VARCHAR. Facelet code: <f:metadata> <f:viewParam name="round" value="#{groupHandler.roundId}"> <f:convertNumber integerOnly="true" /> </f:viewParam> <f:viewParam name="group" value="#{groupHandler.groupCode}" /> <f:viewAction action="#{groupHandler.loadEntity}" /> </f:metadata> ... <p:button widgetVar="reloadPageButton" value="Reload

JSF: reloading page via p:button using “?includeViewParams=true” results in %2C for integer GET param in new URL

懵懂的女人 提交于 2020-03-25 13:49:11
问题 I have a page that has two GET params: round = [some integer] group = [some string] See URL above. These are the two components of the group's PK, an INT + a VARCHAR. Facelet code: <f:metadata> <f:viewParam name="round" value="#{groupHandler.roundId}"> <f:convertNumber integerOnly="true" /> </f:viewParam> <f:viewParam name="group" value="#{groupHandler.groupCode}" /> <f:viewAction action="#{groupHandler.loadEntity}" /> </f:metadata> ... <p:button widgetVar="reloadPageButton" value="Reload

How to use view-params with JSP?

时光毁灭记忆、已成空白 提交于 2020-01-20 09:32:55
问题 I would like to use view parameters to get bookmarkable URLs with JSF 2, but I use JSPs and all the help and examples I can find, uses facelets. Here is want I have done so far: search.jsp (calling page): <t:commandLink action="..."> <f:param name="param1" value="foo"/> <h:outputText value="..."/> </t:commandLink> faces-config.xml: <navigation-rule> <navigation-case> <from-outcome>go_edit</from-outcome> <to-view-id>/views/edit.jsp</to-view-id> <redirect> <view-param> <name>param1</name>

f:viewParam with multiple values

左心房为你撑大大i 提交于 2019-12-30 20:02:12
问题 I have a <f:viewParam> driven search screen. I am trying to implement it to take multiple values for a single <f:viewParam> . I believe the correct URL would look something like <url>?state=COMPLETE&state=PENDING The XHTML section is as follows: <f:metadata> <f:viewParam name="state" value="#{backingBean.state}" converter="#{stateNameConverter}" /> </f:metadata> I have tried the following 2 method signatures on backingBean: public void setState(State... state) Was hopeful that JSF

f:viewParam with multiple values

百般思念 提交于 2019-12-30 20:02:07
问题 I have a <f:viewParam> driven search screen. I am trying to implement it to take multiple values for a single <f:viewParam> . I believe the correct URL would look something like <url>?state=COMPLETE&state=PENDING The XHTML section is as follows: <f:metadata> <f:viewParam name="state" value="#{backingBean.state}" converter="#{stateNameConverter}" /> </f:metadata> I have tried the following 2 method signatures on backingBean: public void setState(State... state) Was hopeful that JSF

f:viewParam with Converter and ViewScoped exception out when invoke the second ajax request

主宰稳场 提交于 2019-12-14 03:49:46
问题 I have this f:viewParam that I try to bind validate and convert a userId into Player , and I got an unexpected results. <f:metadata> <f:viewParam name="userId" value="#{myBean.selectedPlayer}" converter="pConverter" converterMessage="Bad Request. Unknown User" required="true" requiredMessage="Bad Request. Please use a link from within the system" /> </f:metadata> <h:body> <p:messages id="msgs"/> <h:form> <ul> <li><a href="index2.xhtml?userId=1">Harry</a></li> <li><a href="index2.xhtml?userId

viewParam event going wrong

旧时模样 提交于 2019-12-12 03:56:56
问题 I created a webpage, which checks the view-parameter from the URL, and calls the init-method of a bean to retrieve that user. The fields on that page are then filled with the information of that user. But something is going wrong. My Facelets page: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"

f:viewParam is not working

我的梦境 提交于 2019-12-11 13:13:54
问题 I am using JSF 2.2.4 on GlassFish 3.1.2.2. I have this backing bean: import javax.faces.bean.ManagedBean; import javax.faces.bean.RequestScoped; import java.io.Serializable; @ManagedBean(name="testMB") @RequestScoped public class TestMB implements Serializable { public long id; public long getId() { return id; } public void setId(long id) { this.id = id; } } And this view test.xhtml : <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun

Is there a way to make f:viewparam handle lists of values?

六月ゝ 毕业季﹏ 提交于 2019-12-10 17:10:44
问题 Let's say I already have a converter between a custom class Car and String . Is there a way to elegantly make this <f:viewParam name="mycars" value="#{mybean.cars}" converter="carConverter" /> work when mybean.cars is a Set<Car> or List<Car> instead of just a single Car , without having to write a custom converter between lists of cars and lists of strings? In other words, is there some feature of JSF that gets me out of having to parse "[Audi,BMW,VW]" to ["Audi","BMW","VW"] and then convert

@NotNull Bean Validation ignored for viewParam

余生颓废 提交于 2019-12-10 11:34:28
问题 Problem I'm trying to validate a mandatory GET request parameter. In the view I've added a corresponding viewParam tag. <f:metadata> <f:viewParam name="customerId" value="#{customerDetailBean.customerId}"/> </f:metadata> And my CDI bean looks like this @Model public class CustomerDetailBean { @NotNull private Integer customerId; public Integer getCustomerId() { return customerId; } public void setCustomerId(Integer customerId) { this.customerId = customerId; } } When I use the following