What’s wrong: <h: commandButton value = "...? UserId = # {...}"

The whole syntax is below

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

It is inside a dataTable, so explain the use if item. But the above code gives me

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

I can't seem to concatenate a string and an EL expression. It is made that many inside the attribute valueshould be something with the attribute action. Has anyone got a solution for this?

+3
source share
1 answer

Try using the f: param parameter in h: link to set customerId, which is the canonical way to set request parameters. So:

<h:link outcome="CustomerDetails" value="#{item.name}">
    <f:param name="customerId" value="#{item.id}" />
</h:link>
+5
source

Source: https://habr.com/ru/post/1773110/


All Articles