Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to set hidden field value in form?

843842Sep 20 2003 — edited Sep 22 2003
I've encountered a problem while developing a forum using JSF. See this code:

<h:form id="commmentForm" formName="commentForm" >
<h:input_hidden id="pageId" valueRef="CommentBean.pageId" value="${article.id}"/>
<h:input_text id="userName" valueRef="CommentBean.userName"/>
<h:input_text id="userEmail" valueRef="CommentBean.userEmail"/>
<h:input_text id="userURL" valueRef="CommentBean.userURL"/>
<h:input_textarea id="content" valueRef="CommentBean.content"/>
<h:command_button id="submit" label="Leave A Comment" commandName="submit" actionRef="CommentBean.createAction" />
</h:form>

I was trying to specify a hidden field that represents the unique ID number of the current article using <h:input_hidden> tag above. But RI complains that runtime expression is not permitted in 'value' attribute. So I set the attribute 'value' to arbitrary number such as '2', but it seems that CommentBean.pageId is still null.

So the question is:

1. Why can't I use EL in JSF tags attributes?

2. How can I resolve my problem mentioned above?

Thanks very much in advance!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 20 2003
Added on Sep 20 2003
4 comments
443 views