Hello Zied,

just added a menu example to test

see:

http://svn.apache.org/repos/asf/myfaces/tobago/trunk/example/test/src/main/webapp/menu.jsp


and method getFileMenu in TestBean

http://svn.apache.org/repos/asf/myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/TestBean.java

Regards

Bernd

Zied Hamdi wrote:
Hello again, I forgot to tell you I'm new to JSF, It's possible I'm doingit
all bad.

I took a look in debug mode at a UIMenu instance initialized with Jsf tags,
and I've found an attribute containing the list of nested commands ids. I
suppose there's a factory for doing these routines... Does someone have the
info please?

Regards,
Zied


2007/7/13, Zied Hamdi <[EMAIL PROTECTED]>:

Hi Tobago,

I have a little problem filling a UIMenu (I took a look at the mailing
list and no one had the problem) : I've tried this:


      *public* UIMenu getPhoneMenu() {

            *return* phoneMenu ;

      }





      *public* *void* setPhoneMenu(UIMenu phoneMenu) {

            PhoneNumber number = *super* .getThroughEl ( "phone" ,
PhoneNumber.*class* );

            *this*. phoneMenu = phoneMenu ;

            phoneMenu.setId( "phoneTypes" );

phoneMenu.getAttributes().*put*( "image", "image/phone_types/"+
number.getType() + ".PNG " );

            *for* ( PhoneType type : PhoneType.*values*() ) {

                  UICommand command = *new* UICommand();

                  phoneMenu .getChildren().*add*( command );

Map<String, Object> attributes = command.getAttributes();

attributes.*put* ( "image", "image/phone_types/"+ type +
".PNG " );

attributes .*put*( "label" , type.toString().toLowerCase() );

            }

      }


It doesn't work, it seems UIMenu has in its attributes Map the list of
the Command ids it contains...
Are the factories used to interpret the jsf structure designed to be used
by third parties? Or there another solution for creating my UIMenu

Regards,

--
Zied Hamdi





Reply via email to