programtical commandlink

Hello -

I need to acheive following in programatically:

<h:commandLink action="#{clientAlerts.init}">

<f:param name="clientKey" value="#client.clientRow.clientKey}"/> <f:param name="clientId" value="#{client.clientRow.clientID}"/>

<h:outputText value="set Client Alerts">

</h:outputText>

</h:commandLink>

Here is what I plan to do:

HtmlPanelGrid grid = new HtmlPanelGrid();

HtmlCommandLink link = new HtmlCommandLink ();

MethodExpression mex=context.getApplication().getExpressionFactory().createMethodExpression(context.getELContext(),"clientAlerts.init", null, params);

link.setActionExpression(mex);

tmpGrid.getChildren().add(link);

Then binding this grid in the JSP page. Is it right way?

[813 byte] By [benzhang0001a] at [2007-11-26 15:09:07]
# 1
> Is it right way?No.
BalusCa at 2007-7-8 8:59:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Please advice!!
benzhang0001a at 2007-7-8 8:59:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
You're forgotten the two f:param components (UIParameter) and the outputText component (HtmlOutputText). The declared grid is not the same as the used tmpGrid. Also I don't see how params is instantiated.
BalusCa at 2007-7-8 8:59:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Thanks!You are right, I was woundering how to pass param. One more question for you: how to create a UICommponent, that will be rendered as "div" tag?Thanks!Ben
benzhang0001a at 2007-7-8 8:59:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
JSF doesn't have. [url= http://www.jsftutorials.net/components/step1.html]Create your own[/url], or use [url= http://jsftutorials.net/htmLib/]HTMLib[/url], or use h:panelGroup with style="display: block;", this will behave the same as a div.
BalusCa at 2007-7-8 8:59:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...