myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernd Bohmann <bernd.bohm...@atanion.com>
Subject Re: [tobago] can we create a UIMenu structure on the fly (from the server side)?
Date Tue, 17 Jul 2007 10:07:11 GMT
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 <javahamdi@gmail.com>:
>>
>> 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
>>
>>
> 
> 
> 

Mime
View raw message