Hi,
I am building my first application using tapestry 4 and I am trying to use
the component JSCookMenu but I run into some issues.
1) When I build up my sub-menues I need 3 attributes in my directLink (Name,
ItemType, IdValue). I tried this code:
if (currentArticle != null) {
BasicJSCookMenuItem currentSubMenu = new
BasicJSCookMenuItem(new Object[]
{currentArticle.getName(),
ItemType.TYPE_ARTICLE,
currentArticle.getArticleId()});
currentMenu.addItem(currentSubMenu);
}
from this I get a org.apache.tapestry.BindingException like this:
Exception invoking listener method onNavigate of component defaultHome: No
listener method named 'onNavigate' suitable for 3 listener parameters found
in [EMAIL PROTECTED]
and the following org.apache.hivemind.ApplicationRuntimeException :
No listener method named 'onNavigate' suitable for 3 listener parameters
found in [EMAIL PROTECTED]
And my listener method look like this now:
/**
* This is called when one of the menu items is clicked
*/
public void onNavigate(IRequestCycle cycle, Object[] value){
System.out.println("HomeAction: MenuItem value = " + value[0] +
" : " +
value[1] + " : " + value[2]);
setDisplayedArticleId((Long) value[2]);
}
My html page with the component look like this:
...
<body jwcid="@Body" class="branch" >
<span jwcid="@menu:JSCookMenu" source="ognl:menuModel"
value="ognl:menuItem" theme="SmartGreen" position="hbr">
<!-- I had to add the 'b' in the a href posting so the text could be
displayed, so please ignore the 'b' -->
<ab href="#" jwcid="[EMAIL PROTECTED]"
listener="listener:onNavigate" parameters="ognl:menuItem.value" >
<span jwcid="@Insert" value="ognl:menuItem.value"/>
</ab>
</span>
...
2) My subMenu display the address to the object instead of the menuItem
name: [LJava.lang.object;@46007 instad of ex. "Mutual Funds"
How do I solve this?
3) What is the best way of handling what content that will be displayed in
my website area 3? Do I store the ItemType and idValue as a parameter in the
.class file as private members or can I work with public abstract Long
getIdvalue() and public void setIdValue(Long idValue)? After I set the
values... do how do I reload the page so I can read in the new article?
4) I want to display the content in area C (region). I will be able to
display two different kind of content (article, articleList) therefor I need
the ItemType, I need the idValue for accessing the right article or
articleList, and ofcourse I need the menuItem name displayed right. Is it
possible to submit my 3 attributes? It look like it is doable becouse it is
a object[] where I can add the attributes... so where is the error?
________________
| |
| A |
-----------------------------
| | |
| | |
| B | C |
| | |
| | |
-----------------------------
5) What happens if javascript is turned of in the browser? I guess that
nothing will be shown where the menu would be, so my question is Are there
any backup plan to handle this case?
Really thankful for your answers
Jacob
--
View this message in context:
http://www.nabble.com/Trouble-with-JSCookMenu-tf2234887.html#a6196107
Sent from the Tapestry - User forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]