Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Dynamically add Children Link Element (a standard jsf commandLink child)  RSS feed

 
Zecas Manecas
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm trying to dynamically add a children element, a link, but the action binding refuses to work ...

I've created a custom jsf component, that does nothing at all.

For example, one would use it like:


So my UI class would have the following methods:



The tld file is created, the tag class is working. All the component is working properly.

Now I want to add a link as a child component, but I wat to do it programatically, so I changed the encodeBegin method of my custom ui class:



This seems to work, but not quite ... the link appears as expected, the value references for value and style are correctly passed, but the action doesn't work at all.

For example if I change to:


And I have the following method created on my managed bean:


Is successfully calls and retrieves the value from the method. Same happens to the style property.

Now for the action, if I change to:


And I have the following method created on my managed bean:


The result is nothing ... I mean the method is not called at all. The "backup" is properly defined on my "faces-config.xml":


If I create the link manually on the web page:

It does work (the backup.jsp page is shown), so the methods are properly configured, only the action binding does not work.

Wether I use a string "backup" or a reference "#{mybean.doMyLinkAction}" I cannot make it work.

On the console I get the following results, for each value I test (string "backup" or reference "#{mybean.doMyLinkAction}"):


So the "if (CommandLinkTag.isValueReference( myLinkAction )) {" is working properly ... that just leaves me with the action method binding instructions ...

Why don't they work?

Any Help Appreciated ... Thanks in Advance!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66186
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Scary Fox",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!