You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by prashantak <pr...@gmail.com> on 2008/01/13 11:07:56 UTC
[Trinidad] CoreCommandLink dynamic creation
Hi All,
I am creation new component in which I am creating a trinidad link
CoreCommandLink dynamically , All's working but the actionListener is not
working . I am writing all code in the encodeBegin() method of my component.
Code that I am using is as below..
Code in - trinidad jar 1.0.4 and jsf 1.1
public void encodeBegin(FacesContext context , UIComponent comp) throws
IOException
{
CorePanelGroupLayout grlayout = new CorePanelGroupLayout();
CoreCommandLink hlink = new CoreCommandLink();
String[] paneltriggers = {"table"}; // "table" is id of the table
grlayout.setLayout("vertical");
grlayout.setPartialTriggers(paneltriggers);
grlayout.setValueBinding("binding",
app.createValueBinding("#{scrollerList.rolodexcompLay}"));
Application app = context.getApplication();
MethodBinding actionListenerMethod =
app.createMethodBinding("#{scrollerList.onAction}", new
Class[]{ActionEvent.class});
hlink.setText("A");
hlink.setActionListener(actionListenerMethod);
hlink.setPartialSubmit(true);
hlink.setId("rolA");
grlayout.getChildren().add(hlink);
}
In the above code I have used setActionListener but the method is not being
called if I add this action listener in jsp code that works. Have i written
wrong code to generate method binding.
Plz help me I am stuck in my work.
Waiting for you reply,
-Prashantak
--
View this message in context: http://www.nabble.com/-Trinidad--CoreCommandLink-dynamic-creation-tp14784046p14784046.html
Sent from the My Faces - Dev mailing list archive at Nabble.com.