Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在javascript中传递jsf commandLink操作属性值_Jsf - Fatal编程技术网

如何在javascript中传递jsf commandLink操作属性值

如何在javascript中传递jsf commandLink操作属性值,jsf,Jsf,我需要传递jsf commandLink标记的action属性的字符串值 这是我的密码: <h:commandLink id='link' action="#{Bean.selectLink}" onclick="myFunction(document.getElementById('link'))"> </h:commandLink> //value is coming as null //值为空 我还尝试了onclick=“myFunction(this)

我需要传递jsf commandLink标记的action属性的字符串值

这是我的密码:

<h:commandLink id='link' action="#{Bean.selectLink}" 
 onclick="myFunction(document.getElementById('link'))">
</h:commandLink> 
//value is coming as null

//值为空
我还尝试了
onclick=“myFunction(this)”
,但由于commandLink操作,它的值在导航之前作为页面的url出现。我想传递action属性的值,即“#{Bean.selectLink}”

我尝试将其作为
onclick=“myFunction(#{Bean.selectLink})”传递
,但它显示错误PropertyNotFoundException:在Bean中找不到selectLink属性

我尝试了
oncomplete
属性来代替onclick,但是没有发生任何事情

请帮我弄清楚这件事。谢谢


提前感谢您的帮助。

您能提供任何示例代码吗?嗨,自行车手,我编辑了我的问题。你能检查一下吗。