You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Alessandro Polverini (JIRA)" <in...@incubator.apache.org> on 2005/01/24 16:42:22 UTC

[jira] Created: (MYFACES-87) x:updateActionListener inside x:navigationMenuItem

x:updateActionListener inside x:navigationMenuItem
--------------------------------------------------

         Key: MYFACES-87
         URL: http://issues.apache.org/jira/browse/MYFACES-87
     Project: MyFaces
        Type: New Feature
    Versions: 1.0.8 beta    
 Environment: Tomcat5
    Reporter: Alessandro Polverini
    Priority: Minor


Hello,
it would be nice if x:navigationMenuItem would be an ActionSource so that a x:updateActionListener could be nested inside one of its elements.

Thanks,
Alex

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Updated: (MYFACES-87) x:updateActionListener inside x:navigationMenuItem

Posted by "Galen Dunkleberger (JIRA)" <in...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-87?page=history ]

Galen Dunkleberger updated MYFACES-87:
--------------------------------------

    Attachment: classes_patch.txt
                tld_patch.txt

This is an attempt at making individual navigationMenuItems action sources for the jscookmenu. Hope I made the pathces correctly.

> x:updateActionListener inside x:navigationMenuItem
> --------------------------------------------------
>
>          Key: MYFACES-87
>          URL: http://issues.apache.org/jira/browse/MYFACES-87
>      Project: MyFaces
>         Type: New Feature
>     Versions: 1.0.8 beta
>  Environment: Tomcat5
>     Reporter: Alessandro Polverini
>     Priority: Minor
>  Attachments: classes_patch.txt, tld_patch.txt
>
> Hello,
> it would be nice if x:navigationMenuItem would be an ActionSource so that a x:updateActionListener could be nested inside one of its elements.
> Thanks,
> Alex

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-87) x:updateActionListener inside x:navigationMenuItem

Posted by "Galen Dunkleberger (JIRA)" <in...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-87?page=comments#action_62205 ]
     
Galen Dunkleberger commented on MYFACES-87:
-------------------------------------------

After some furthur use I see how you can pretty much get the same functionality out of the current jscookmenu as I had in my patch. One thing I was confused on was that I was under the assumption an action method binding had to return a string for the navigation but that doesn't seem to be the case. Still part of me feels like anything the user can interact with (ie click on and fire off a request) should be able to have action listeners attached to it.

> x:updateActionListener inside x:navigationMenuItem
> --------------------------------------------------
>
>          Key: MYFACES-87
>          URL: http://issues.apache.org/jira/browse/MYFACES-87
>      Project: MyFaces
>         Type: New Feature
>     Versions: 1.0.8 beta
>  Environment: Tomcat5
>     Reporter: Alessandro Polverini
>     Priority: Minor
>  Attachments: classes_patch.txt, tld_patch.txt
>
> Hello,
> it would be nice if x:navigationMenuItem would be an ActionSource so that a x:updateActionListener could be nested inside one of its elements.
> Thanks,
> Alex

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-87) x:updateActionListener inside x:navigationMenuItem

Posted by "Kito D. Mann (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-87?page=comments#action_62312 ]
     
Kito D. Mann commented on MYFACES-87:
-------------------------------------

Galen,

NavigatorMenuItem is just a special version of SelectItems, and you can't attach an ActionListener to an individual SelectItem instance either. Essentially, the selected item specifies the current action for the entire component -- that's why JSCookMenu itself is the ActionSource.

I used a similar technique for a navigation component in my book.

> x:updateActionListener inside x:navigationMenuItem
> --------------------------------------------------
>
>          Key: MYFACES-87
>          URL: http://issues.apache.org/jira/browse/MYFACES-87
>      Project: MyFaces
>         Type: New Feature
>     Versions: 1.0.8 beta
>  Environment: Tomcat5
>     Reporter: Alessandro Polverini
>     Priority: Minor
>  Attachments: classes_patch.txt, tld_patch.txt
>
> Hello,
> it would be nice if x:navigationMenuItem would be an ActionSource so that a x:updateActionListener could be nested inside one of its elements.
> Thanks,
> Alex

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-87) x:updateActionListener inside x:navigationMenuItem

Posted by "Galen Dunkleberger (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-87?page=comments#action_62319 ]
     
Galen Dunkleberger commented on MYFACES-87:
-------------------------------------------

Kito,

<trivial-background>
I had toyed with modifying NavigationMenuItem and including string parameters of action and actionListener and also a collection of strings for actionlisteners. Also I added an id attribute to my modified NavigationMenuItem so that I could retrieve it later. Then (taking a hint from your book) I create an extension of arraylist to hold all the NavigationMenuItems. HtmlJSCookMenu was then modified to contain an instance of NavigationMenuItemList. UINavigationMenuItem was made to implement ActionSource...likewise it's tag class was modified to accommodate the new attributes The JsCookMenuRenderer then wrote the id of each NavigationMenuItem to the view. You could then attach an action, actionListener method, and multiple actionListener classes to each individual item. When an item was selected the id would be passed back in the jscook_action parameter, this parameter value could be used to look up the NavigationMenuItem from the NavigationMenuItemList...the action, actionListener method binding, and the actionlistener classes (all held as strings in the NavigationMenuItem could be used to create new method and value binding which could then be set in the JsCookMenu and fired off. It seemed to work for me.
</trivial-background>

Ok so why did I write all that? I was able to get it to work but I wondered at what cost to the whole MVC pattern? It is wrong to put things like action, actionListener and actionListeners (as string representations) in the model for use in the view? I decided not to use my modified jscookmenu b/c I found a way I could accomplish what I needed to do without it. Still like I said before, I feel like anything that user can click on should be an action source. Isn't it that way in swing? 

Thanks for the comment.


> x:updateActionListener inside x:navigationMenuItem
> --------------------------------------------------
>
>          Key: MYFACES-87
>          URL: http://issues.apache.org/jira/browse/MYFACES-87
>      Project: MyFaces
>         Type: New Feature
>     Versions: 1.0.8 beta
>  Environment: Tomcat5
>     Reporter: Alessandro Polverini
>     Priority: Minor
>  Attachments: classes_patch.txt, tld_patch.txt
>
> Hello,
> it would be nice if x:navigationMenuItem would be an ActionSource so that a x:updateActionListener could be nested inside one of its elements.
> Thanks,
> Alex

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira