I have been trying with little success to design a rather complex (at least for
me as it is my first D2W project) application using D2W and ERModernLook. I am
able to create a list page and inspect or edit an entity with all the
formatting and restrictions on the attributes and relationships as I need. With
this part of D2W I am very satisfied, really glad with the easy of working with
D2W.
But then I tried to insert a menu with subitems for each menu item and then D2W
stopped working properly. The NavigationMenu.plist seems to be well formed and
the application correctly shows the first layer of menu items. But the
application will not show any children nor highlight the currently selected
menu item. So here we have two problems: 1) the second level of menu items not
being shown and 2) the currently selected menu not being highlighted.
I followed the instructions given in the WOWODC HelloD2W project and have:
1. Added to my properties file:
er.extensions.ERXNavigationManager.localizeDisplayKeys=true
2. When the app finishes initializing, call:
ERXNavigationManager.manager().configureNavigation();
3. Created a NavigationMenu.plist file
4. Set the navigation context in MenuHeader
5. Set the navigationState on the navigation context in the rules file
An excerpt of the NavigationMenu.plist follows:
(
{
name = Root;
children =
(Principal,Produtos,Clientes,Fornecedores,Financeiro,Pessoal,Documentos,Sistema,Visionar);
},
{
name = Principal;
action = "session.navController.homeAction";
},
{
name = Produtos;
action = "session.navController.pacotesAction";
children = (Pacotes,Passagens,Relatorios);
},
{
name = Pacotes;
action = "session.navController.pacotesAction";
},
{
name = Passagens;
action = "session.navController.homeAction"; /* dummy action */
},
{
name = Relatorios;
displayName = "Relatórios";
action = "session.navController.homeAction"; /* dummy action */
},
{
name = Clientes;
action = "session.navController.homeAction"; /* dummy action */
children =
(Cadastro,Orcamentos,MalaDireta,Captacao,Campanhas,PosVenda,Incidentes,Relatorios);
}
}
The menu is rather lengthy, and yes, I am willing to use UTF-8 as I am a
Portuguese speaker and am producing this software for the Brazilian market,
what leads us to the third problem: the system will not parse names with
accents, like the ó in Relatórios and forces me to name all the menu items
without accents and to use the alias displayName for them. By the way, I have
localized the menu in the Localizable.strings resource and my application and
database correctly handle UTF-8.
Finally, here follows two of the rules I set up in RuleModeler trying to make
the menu system work (as formatted by RuleModeler):
{
"author" = "50";
"class" = "com.webobjects.directtoweb.Rule";
"documentation" = "Default tab state for products pages";
"lhs" = {
"class" = "com.webobjects.eocontrol.EOKeyValueQualifier";
"key" = "pageConfiguration";
"selectorName" = "isEqualTo";
"value" = "Produtos";
};
"rhs" = {
"class" = "com.webobjects.directtoweb.Assignment";
"keyPath" = "navigationState";
"value" = "Produtos";
};
},
{
"author" = "50";
"class" = "com.webobjects.directtoweb.Rule";
"lhs" = {
"class" = "com.webobjects.eocontrol.EOKeyValueQualifier";
"key" = "pageConfiguration";
"selectorName" = "isLike";
"value" = "*Pessoal*";
};
"rhs" = {
"class" = "com.webobjects.directtoweb.Assignment";
"keyPath" = "navigationState";
"value" = "Pessoal";
};
},
So, in short, I have three problems to solve:
1. Show the submenus
2. Highlight the currently selected menu item
3. Parse the menu plist for menu names that include UTF-8 characters like
accented letters
Thank you guys for any help,
Angelo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]