Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what wrong with <h:commandButton value="...?userId=#{...}"

Tags:

jsf

The whole syntax is as below

<h:commandLink action="CustomerDetails?faces-redirect=true&amp;customerId=#{item.id}" value="#{item.name}"/>

This is inside a dataTable, hence explain the use if item. But the above code give me

Not a Valid Method Expression: CustomerDetails?faces-redirect=true&customerId=#{item.id}

It seems to not allow me to concatenate string and EL expression. Done that many inside value attribute, must be something with the action attribute. Any one got a solution for this?

like image 908
Thang Pham Avatar asked Jan 20 '26 08:01

Thang Pham


1 Answers

Try using an f:param in an h:link to set the customerId, which is the canonical way of setting query parameters. So:

<h:link outcome="CustomerDetails" value="#{item.name}">
    <f:param name="customerId" value="#{item.id}" />
</h:link>
like image 84
Nick Avatar answered Jan 23 '26 04:01

Nick



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!