voyent
Messages posted by: sreynolds  XML
Profile for sreynolds -> Messages posted by sreynolds [62] Go to Page: 1, 2, 3, 4, 5 Next 
Author Message
Found some info in another thread. Apparently, having both the "url" and "actionListener" attributes on a menuItem causes the actionListener to be ignored. I'm guessing that the navigation to the URL causes things to get reconstructed, so that the information needed to invoke the listener is no longer available.

Just by way of explanation, my object in this is to update a crumbBar to reflect the current navigation location after moving via the menuBar. I was hoping to use something like the logic in the crumbBar showcase demo, but with a menu driving things rather than the tree used in the demo. Seems like I may have to rethink this.
A very simple test, adapted from the icefaces showcase example...
(Files attached. I don't know if the copy here will be readable.)

Currently, I can't get the action event to fire from either the static or dynamic menu. This is the static version. I've tested this in Firefox and Chrome browsers. The app is hosted on tomcat 8.0.24.

The showcase functions as expected from my browser, so I don't understand what would cause my usage to fail.

test.xhtml
Code:
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
 <html
   xmlns="http://www.w3.org/1999/xhtml"
   xmlns:c="http://java.sun.com/jsp/jstl/core"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:h="http://java.sun.com/jsf/html"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:ace="http://www.icefaces.org/icefaces/components"
   xmlns:icecore="http://www.icefaces.org/icefaces/core"
   xmlns:sn="http://www.quantum.com/stornext/component"
   lang="en"
 >
 <h:head>
 </h:head>
 <h:body>
   <icecore:setEventPhase events="ValueChangeEvent" phase="INVOKE_APPLICATION">
   <f:view contentType="text/html">
 
     <h:form id="menuForm" style="overflow:visible;">
       <ace:menuBar id="menuBar" autoSubmenuDisplay="true">
         <ace:menuItem
           id="home"
           value="Home"
           url="/jsp/test.xhtml"
           target="_blank"
           icon="ui-icon ui-icon-home"
           actionListener="#{testBean.menuAction}">
           <ace:ajax event="activate" execute="@this" render="@all" />
         </ace:menuItem>
         <ace:submenu
           id="submenu"
           label="Submenu"
           icon="ui-icon ui-icon-document">
           <ace:menuItem
             id="submenuitem"
             value="Item"
             url="/jsp/test.xhtml"
             actionListener="#{testBean.menuAction}">
             <ace:ajax event="activate" execute="@this" render="@all" />
           </ace:menuItem>
         </ace:submenu>
       </ace:menuBar>
       
       <h:outputText value="#{testBean.lastAction}" />
     </h:form>
   </f:view>
   
   </icecore:setEventPhase>
 </h:body>
 
 </html>
 


TestBean.java
Code:
 import java.io.Serializable;
 
 import javax.faces.bean.CustomScoped;
 import javax.faces.bean.ManagedBean;
 import javax.faces.component.UIComponent;
 import javax.faces.event.ActionEvent;
 
 @ManagedBean(name = TestBean.BEAN_NAME)
 @CustomScoped(value = "#{window}")
 public class TestBean implements Serializable 
 {
     private static final long serialVersionUID = 1L;
     public static final String BEAN_NAME = "testBean";
     public String getBeanName() { return BEAN_NAME; }
     public final String MENU_BAR_ID = "menuBar";
     private String _lastAction = "None";
 
     public TestBean() {
     }
     
     public String getLastAction()
     {
         return _lastAction;
     }
     
     public void menuAction(ActionEvent event)
     {
         System.err.println("menuAction: ENTER");
                 
         UIComponent comp = event.getComponent();
         _lastAction = comp.getClientId();
         System.err.println("lastAction: " + _lastAction);
         
         System.err.println("menuBarAction: EXIT");
     }
 
 }
 

Has this old problem resurfaced in 4.1.1?
I have a menu being constructed in a bean. I've tried all of the various recommended methods of associating an actionListener method with the individual menuItems, but none of them seem to work. No matter what I do, the listener is never invoked.
Here's a fragment:
<code>
<ace:list
id="theList"
selectionMode="single"
value="#{aSessionBean.selectionList}"
>
<f:selectItems value="#{aSessionBean.itemList}" />
</ace:list>
<ace:pushButton
id="theButton"
type="button"
label="Remove"
actionListener="#{aSessionBean.removeAction}">
<ace:ajax execute="@this theList" render="@all" />
</ace:pushButton>
</code>

The itemList is dynamically constructed as an ArrayList<SelectItem> with each item having a String value.
The button action removes selected string value from its backing data -- the itemList would be reconstructed the next time it is fetched. It also currently removes the corresponding entry from selectionList.

It looks like maybe the problem arises when I remove the end item from the list, and then subsequent processing is using the now-invalid selection index to try to access data in the model.

The error that occurs is:
SEVERE: javax.faces.model.NoRowAvailableException
at javax.faces.model.ListDataModel.getRowData(ListDataModel.java:149)
at org.icefaces.impl.component.UISeriesBase.getRowData(UISeriesBase.java:111)
at org.icefaces.ace.component.list.ListDecoder.processSelections(ListDecoder.java:53)
at org.icefaces.ace.component.list.ListRenderer.decode(ListRenderer.java:74)
at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:832)
...
I have an ace:list component and a separate ace:pushButton that causes the selected item in the list to be removed. Invoking the button action sometimes, but not always, results in a NoRowAvailableException from the list component.

Any ideas as to what causes this or how to get around it?
I have a simple ICEfaces 4.0 app.
When I have an ace:dialog on the page and refresh the browser (Chrome or IE 11), the content of the dialog is duplicated and a JasperException is thrown complaining about the first duplicate ID encountered as a result. Happens even when the dialog is the only thing on the page and regardless of what the actual dialog content is.

Anyone recognize this as a bug or know of something silly I might be doing to cause it?

Update: I think I figured this out. I had a binding on the dialog (leftover code ported from an old app and no longer needed). Removing the binding fixes the duplication issue.

ken.fyten wrote:

sreynolds wrote:
I've been having a similar issue with the ICEfaces 4 beta and menuitems used with ace:breadcrumbMenu. I find that I can assign either a URL or an actionListener to a menuItem and it works as expected. But if I try to assign both, the actionListener is ignored. 


This is a distinctly separate issue from the one originating the thread. Please create a new thread for it.

Regards,
Ken
 


Done. Thanks, Ken.
I've been having an issue with the ICEfaces 4 beta and menuitems used with ace:breadcrumbMenu. I find that I can assign either a URL or an actionListener to a menuItem and it works as expected. But if I try to assign both, the actionListener is ignored.

Some poking around suggests that this behavior is inherited from primeFaces, not something that ICEfaces created intentionally.

My intent in trying to use both the URL and the actionListener was to allow the breadcrumb handler to notify other components that navigation is happening. I think I have a valid workaround using setActionListener and setAction where the action method returns the URL to be navigated to. That just seemed a bit clumsy and it isn't clear to me why setUrl should cause the actionListener to be ignored. Perhaps I'm just going about this the wrong way and there is a better approach.
I've been having a similar issue with the ICEfaces 4 beta and menuitems used with ace:breadcrumbMenu. I find that I can assign either a URL or an actionListener to a menuItem and it works as expected. But if I try to assign both, the actionListener is ignored.
In ICE4, I'm trying to use a tree as a navigation mechanism. It mostly works -- click a node and appropriate associated content gets displayed.

The issue is that clicking on the selected node then deselects it. What I want is basically radio button type behavior so that there is always exactly one node selected. Any suggestions as to how best to do this with the tree widget?
I'm trying to get this to work with the 4.0 beta release.
I display a panel with closable set to true.
Click the close button and the panel disappears.
So far, so good.

Now I want to be able to bring the panel back -- AND have it be closable again. The showcase suggests that the panel be made to reappear by setting its closable to false. That works, but then the close button is gone and there is no obvious way to get it back.

Any suggestions?
Ran into an issue with ace:linkButton
When I set value="#{myBean.someInteger}"
I get an error complaining that the integer cannot be converted to a string.
ace:pushButton doesn't seem to have a problem rendering a numeric value as its text label, but linkButton does.
Workaround seems to be to stringify the value by setting into a variable with <c:set>, then reference the variable as the linkButton value.
I'm migrating a site from ICEfaces 1.8 to 4.0
Is there an obvious replacement for the old ice:panelStack component?
I've looked at the guide for converting 1.8 to 3, but it's pretty sketchy and doesn't seem to go into detail about specific components. Is there some place I can look for guidance on converting obsolete 1.8 components into whatever the appropriate replacement might be?

Edit: Playing around, looks like maybe the panelStack could be simulated by using ace:tabSet and hiding the tabs with CSS.
ICE-9859 addresses issues with row state (selection, etc.) across pages of a lazy loaded table. That's nice. However, as far as I can tell, it has nothing to do with sortBy and filterBy EL expressions not being evaluated.

Currently, when the LazyDataModel.load() method is called, it receives incorrect information. When an ace:column uses a dynamic expression such as filterBy="#{rowObject[colModelItem.propName]}", the load method receives the string "propName]" instead of the resolved name of the property. That makes it impossible to to use c:forEach to generate ace:column elements from a model and have the sorting or filtering work.

A number of people have tracked this down in the ICEfaces source code and verified that your code simply extracts the variable name from the EL expression and passes it to load() as-is rather than resolving it. We understand that you may have inherited this code from primefaces and just haven't gotten around to fixing it. The question here is: When do you plan to fix it? The built in sorting and filtering is a significant part of the appeal of the new ace:dataTable. Finding that those features simply do not work in combination with dynamic columns greatly reduces the attractiveness.
Is there any anticipated release in which the problems with expressions in dynamic column attributes will be resolved?
Presently, when the load method of the LazyDataModel is called, EL expressions used to specify sortBy and filterBy for dynamic columns are not properly resolved before being passed in. This makes it impossible to use sortBy or filterBy in combination with dynamic columns.

ICEfaces responses I've seen to other queries about this seem to suggest that the ICEfaces team does not view this as a significant problem. One response even stated that users should submit an "enhancement" request if the issue is important to them. I would have to say that this is not an enhancement situation. It is a bug and should be addressed as such without the need for users to beg for a fix.
 
Profile for sreynolds -> Messages posted by sreynolds [62] Go to Page: 1, 2, 3, 4, 5 Next 
Go to:   
Powered by JForum 2.1.7ice © JForum Team