Benchik
Benchik

Reputation: 2167

f:setPropertyActionListener not working when simpleModal working

I have the next code:

<h:commandLink value="#{bean.lastName}" onclick="$('#popDiv').modal(); return false;">
    <f:setPropertyActionListener target="#{personController.person}" value="#{bean}" />
</h:commandLink>

The problem is that to make the modal panel (of SimpleModal) to not open and close immediately i have to use "return false" when "onclick" occurs. But "return false" makes f:setPropertyActionListener not work. What can be done to make them both work?

Thanks in advance.

Upvotes: 2

Views: 1835

Answers (2)

german
german

Reputation: 11

you need to work with

<p:commandLink value="#{bean.lastName}" onclick="openModal(event);">
    <f:setPropertyActionListener target="#{personController.person}" value="#{bean}" />
</p:commandLink>

Upvotes: 1

Eric Martin
Eric Martin

Reputation: 2841

Can you do something like:

<h:commandLink value="#{bean.lastName}" onclick="openModal(event);">
    <f:setPropertyActionListener target="#{personController.person}" value="#{bean}" />
</h:commandLink>

function openModal(e) {
    e.preventDefault();
    $('#popDiv').modal();
}

Upvotes: 1

Related Questions