jsf commandLink在第一次单击时不调用backing bean方法

时间:2014-09-13 07:54:40

标签: jsf primefaces

我的表单中有一个按钮,代码如下:

<p:commandButton value="#{msgs['message.report.button.search.show']}"
     icon="ui-icon-image" id="searchBtn"
     process="@this"
     actionListener="#{sixteenFormController.search()}"
     update=":assetListForm">
</p:commandButton>

当我第一次点击按钮时,它不会调用支持bean方法。但在下一次它正常工作。我每次检查请求标题。首次点击的请求标题是:

assetListForm_SUBMIT=1
javax.faces.partial.ajax=true
javax.faces.partial.execute=searchBtn
javax.faces.partial.render=assetListForm
javax.faces.source=searchBtn
searchBtn=searchBtn  

并点击第二次:

assetListForm_SUBMIT=1
javax.faces.ViewState=5LLh2g4iknGg3jt6KJ36nXF8zkcaHWvjQA7VyP8TZwTyqsEL3FtbchUbjpDpGamapf1UcXd7boDtNqJEmCRczCh95LNnr7zECPAaf7kdL3HVm04Il8TLlPrMfwhN8qVUQ7dpUuNFJN8douQpHAmi3p2hyfX1+yA8pAbzIvcKXU8fTqLwlZkFBjcDJVCG5AbDYsa0UIeckLkq9CdxrhUjUu5di/iwcSFhZmHYXVEUD3I8LyBLYPi7CNNjF9A1MBUAP8+eOy7EfkRi4HqQQcifnG61b04jANvzSmRbwwZhlBv6POOENqd9MQ+QVXbt7glrR8sv+A4L4DeFE49VGcRYkmt6f2AsbHg9hkVUnT2yewSFahrdbZ+jHQ92s9dqKCu54hMEma8gQ1rKjdl/0OZGH+sIvrhOBgoCShS5b7yILe0SzOpL1lYLRY331kvhpn/dz1wbZp1QgI3Ti6WpELABYHHt+3hz2qI21Hd1ivtQHuAtTqssTQt8Ne/9b0NPyXcdzuGkLnDdtbdnjURUQmP2UwJSQXPjyQrAwTlGGEEEG46v1U0/O+vOz4rpyIGlhyYi+ep9AqEKlIdDdMPPGerV8XTbtnYeKvSqht3m9M3Q1bzKjdl/0OZGH+sIvrhOBgoCShS5b7yILe3h5m76UOP4/3MimmxBWV7T7e/U8IjMZFuw0OnmGT9a72t/TxydgtiFX4mH+P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yn3jBrIj72CT/Uh0RqoIFnzyEHDKBCFZvkUxeBiQafUfiGb3yXZY5+cEH4T4KtoZYUdYyDxJLl2hlQUzSTH9Qcyx7Mq6P3SI2hEbr1YKXZdNTvx/Ay93PSlBqU9t9PzV+x75uUWq8bVfvXdYoAi11v2RddzU//Wwnj01nx6YoFrUUGs/Z0Va7NJuNEsKwQ==
javax.faces.partial.ajax=true
javax.faces.partial.execute=searchBtn
javax.faces.partial.render=assetListForm
javax.faces.source=searchBtn
searchBtn=searchBtn
你知道这种行为的原因吗?
感谢。

1 个答案:

答案 0 :(得分:1)

它可能与问题https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-790有关。了解如何解决此问题,例如,在链接中how to fixe twice needed click inside JSF page?