Messages posted by markricard
[Logo]
ICEsoft.org Forums: ICEfaces, ICEmobile, ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icesoft.org  [Login] Login 
Messages posted by: markricard  XML
Profile for markricard -> Messages posted by markricard [67] Go to Page: 1, 2, 3, 4, 5 Next 
Author Message
I have a fairly dynamic UI where the views and subviews load their information from programatically changing backing beans. For example, I am trying to use the schedule like so:

Code:
 <ice-cc:schedule bean="#{scheduleLocation.viewBean.controller}" id="scheduleController"/>
 


Unfortunately, the current implementation REQUIRES that you define it EXACTLY like so:

Code:
 <ice-cc:schedule bean="#{calendarController}" id="scheduleController"/>
 


Because if you do not, you get this error:


SEVERE: javax.faces.event.AbortProcessingException: /file:/apache-tomcat-6.0.26/webapps/Pipeline3/WEB-INF/lib/icefaces-composite-comps.jar!/META-INF/facelet/schedule/navigation.xhtml @72,62 valueChangeListener="#{calendarController.viewableHoursValueChangeListener}": Target Unreachable, identifier 'calendarController' resolved to null
javax.faces.event.AbortProcessingException: /file:/apache-tomcat-6.0.26/webapps/Pipeline3/WEB-INF/lib/icefaces-composite-comps.jar!/META-INF/facelet/schedule/navigation.xhtml @72,62 valueChangeListener="#{calendarController.viewableHoursValueChangeListener}": Target Unreachable, identifier 'calendarController' resolved to null
at javax.faces.event.MethodExpressionValueChangeListener.processValueChange(MethodExpressionValueChangeListener.java:82)
 


Because the internal workings of the calendar requires the bean to be named exactly as defined. Is there a way to allow me to NOT have to have the controller tied so statically to that name?

I do this everywhere else for other icefaces components.. like tables, etc.
Ok... ok... I finally figured it out. It would appear that you SHOULD NOT use the same panel as both draggable and droppable or you can get unpredictable results. So I simply created a nested panel where the inner panel is all about dragging and the outer panel is all about dropping. This seems to work just find now. No more duplicate events, and the DropEvent always has the values populated correctly. Hope this helps someone.

Code:
 							<ice:panelGroup dropTarget="true" dropValue="#{location.id}" dropMask="dragging,drag_cancel,hover_start,hover_end" dropListener="#{flatPlanLocation.viewBean.dropListener}">
 								<ice:panelGroup draggable="#{location.isDraggable}"
 									dragOptions="dragGhost"
 									dragMask="dropped,dragging,drag_cancel,hover_start,hover_end"
 									style="width:100px; height: 150px; cursor:move;"
 									dragValue="#{location.id}">
 
 									<ui:include src="/views/flatplan/flatPlanViewLocation.xhtml">
 										<ui:param name="location" value="#{location}" />
 									</ui:include>
 								</ice:panelGroup>
 							</ice:panelGroup>
 
Hmmm... well it would appear that only works some of the time. Because sometimes I ask the DropEvent for the source and target values and it still gets them reversed at times. Not sure what is going on still.

Anyone else have a similar issue? I think the core problem is around having the same exact panel be BOTH a drag source and a drop target at the same time.

??
I answered my own question, not sure why it works. But I got rid of the double event by changing the following lines:

Code:
 								dragMask="dropped,dragging,drag_cancel,hover_start,hover_end"
 								dropMask="dragging,drag_cancel,hover_start,hover_end"
 
I have a panel series that contains a bunch of panels that are all drag and drop. The effect I want is the ability to drag any panel on top of any other panel in that same series and perform a "switch" in the backing array of the items.

The code looks something like this:

Code:
 		<ice:panelSeries
 			value="#{flatPlanLocation.viewBean.paginatedViewModel.containers}"
 			var="container" style="background-color: black;">
 
 			<ice:panelGroup style="width: 100%;">
 
 				<!-- CONTAINER -->
 				<ice:panelSeries value="#{container.locations}" var="location">
 
 					<!-- LOCATIONS -->
 					<ice:panelGroup style="float: left; background-color: #B0B0B0;"
 						menuPopup="::::flatPanelMenuPopup">
 
 						<ice:panelGrid columns="1" ellpadding="0" cellspacing="0"
 							style="vertical-align: super;">
 							<ice:outputText value="pos: #{location.position}"/>
 							<ice:outputText value="loc: #{location.id}"
 								isRendered="#{location.hasPage}" />
 							<ice:outputText value="page: #{location.page.id}"
 								isRendered="#{location.hasPage}" />
 
 							<ice:panelGroup draggable="#{location.isDraggable}"
 								dropTarget="true" dropValue="#{location.id}"
 								dragOptions="dragGhost"
 								dragMask="dragging, drag_cancel,hover_start,hover_end"
 								dropMask="dragging, drag_cancel,hover_start,hover_end"
 								style="width:100px; height: 150px; cursor:move;"
 								dragValue="#{location.id}"
 								dropListener="#{flatPlanLocation.viewBean.dropListener}">
 
 								<ui:include src="/views/flatplan/flatPlanViewLocation.xhtml">
 									<ui:param name="location" value="#{location}" />
 								</ui:include>
 							</ice:panelGroup>
 
 ... more
 


What happens is my backing mean's "public void dropListener(final DropEvent dropEvent)" gets called twice. The first call has the source and target ids correct in the DropEvent. The second call has the source and target reversed.

I would not expect the second call to get called at all since I am clearly dragging the "source" and dropping it on the "target".

Can anyone help me understand what I am doing incorrectly? Any help is GREATLY appreciated.
Looks like it has something to do with this line in the icefaces OutputChartRenderer.java encodeBegin method:

Code:
 image.setAttribute(HTML.SRC_ATTR, outputChart.getChartURI().getPath());
 


For some reason, the URI is null. Not sure why. Having same issue as you.
Looks like it only works when toggleOnClick is false:

http://www.icefaces.org/JForum/posts/list/12672.page


However, if toggleOnClick is false, then the enhancedMultiple auto selecting with CTRL or SHIFT multi-selection does not work anymore!!!

If you have this:

Code:
 <ice:rowSelector value="#{row.selected}" multiple="true" toggleOnClick="false"
 					enhancedMultiple="true" preStyleOnSelection="true" clickListener="#{table.rowClickListener}"/>
 


Then when you click on a row it does not highlight (obviously) and neither does the 'hold the shift key and select multiple'

I thought about programming that myself in the ClickActionEvent method, but I was not sure how to know that the CTRL or the SHIFT key is being pressed.

ICEfaces 1.8.2
Build number: 7
Revision: 19321


Help greatly appreciated!
frans17 is right. If you take exactly what you have EXCEPT change the countryList method in your commonDataHelper to return SelectItem[] objects instead of your Country[] objects it will work.


Code:
 public class CommonDataHelper {
      ...
 
      // DO THIS!
      public SelectItem[] getCountryList() {
            // RETURN your country objects within select items
      }
 
      // NOT THIS!
      public Country[] getCountryList() {
      }
 
      ...
 }
 
Is it possible to have a panelseries with panels and have multiple selection behave much the same way multiple selection happens in the table rowselector? I would like to be able to hold down my control key and click with a mouse button panels in my panel series and process the messages accordingly.

Any help greatly appreciated!
I am attempting to use a panelseries that renders a series of panelgroups and I give the outter panel group the popup. Coding up the following does not work, it gives a "duplicate component id" error:

Code:
 						<ice:menuPopup id="flatPanelPopup">
 							<ice:menuItem id="shake" value="delete"
 								actionListener="#{FlatPanelBean.deletePage}">
 							</ice:menuItem>
 						</ice:menuPopup>					
 						
 						<ice:panelGroup
 							style="background-color: black; height: 500px; width: 800px;" menuPopup="flatPanelPopup">
 
 							<!-- uses panelSerices to iterate over the page collection -->
 							<ice:panelSeries id="flatPanel" value="#{FlatPanelBean.pages}"
 								var="page" style="float:left" >
 
 								<!-- page box is repeated for each page -->
 								<ice:panelGroup style="float: left;" draggable="true"
 									dragOptions="dragGhost"
 									dragListener="#{FlatPanelBean.flatPanelDrag}"
 									dragValue="#{page}" dropValue="#{page}" dropTarget="true"
 									dragMask="dragging,drag_cancel,hover_start,hover_end"
 									dropMask="dragging,drag_cancel,hover_start,hover_end">
 
 									<ice:graphicImage url="images/gap.png" style="border:none;"
 										visible="#{page.gap}" />
 
 									<ice:graphicImage value="#{page.pageImage.value}"
 										style="float:right" />
 
 								</ice:panelGroup>
 
 							</ice:panelSeries>
 
 
 						</ice:panelGroup>
 



java.lang.Exception: javax.faces.FacesException: java.lang.IllegalStateException: Duplicate component ID : j_id8:flatPanelPopup
 


I have also tried to put the menu item inside the panel series, inside the group... tried to give the inner panelgroup inside series the menu popup... all give the same error.

Any help GREATLY appreciated!
I guess I should clarify what I mean by 'dont work'. You cannot have a row selection listener with multi-select and a clickListener at the same time. Nor do I see a way to code around this with multiple select (where I hold down a control key and select).

If there is a code way to get around this, to be able to support double click and multiselect with ctrl key press, I am all ears...
It would appear that clickListener & selectionListener don't work well together period. If I use clickListner (even outside of facelets) by itself, it works. If I use selectionListener by itself it works. But if I put both togehter, only the clickListener works.
Hi Gabi,

Do you think you could post your complete working example here for others to reference?

Much appreciated,
Mark
I have a selectOneList box with a value change listener like so:

Code:
 					<ice:selectOneListbox id="selectMetaDataTypeListBox"
 						converter="#{XAdminBean.metaDataTabInfo.levelMetaDataTypeStringConverter}"
 						value="#{XAdminBean.metaDataTabInfo.selectedMetaDataType}"
 						style="overflow: auto; width: 150px; height:500px;"
 						partialSubmit="true"
 						valueChangeListener="#{XAdminBean.metaDataTabInfo.selectedMetaDataTypeChanged}">
 						<f:selectItems id="selectMetaDataTypeListBoxValues"
 							value="#{XAdminBean.metaDataTabInfo.availableMetaDataTypes}" />
 					</ice:selectOneListbox>
 


Below this I have a series of text boxes that make use of the XAdminBean's "{XAdminBean.metaDataTabInfo.selectedMetaDataType}" from the selection above like so:

Code:
 <ice:inputText id="levelmetadatatype_name"
 												value="#{XAdminBean.metaDataTabInfo.selectedMetaDataType.name}"
 												converter="#{XAdminBean.metaDataTabInfo.levelMetaDataTypeNameConverter}" />
 



I would expect that the text filled in the text area gets applied to only the currently selected item. But the bad behavior I see is after my first selection, every subsequent selection always gets the first selection's name SET by the framework via a setter - which is bad.

If I replace the text boxes with outputText, the outputText displays the names appropriately when I select different ones.

The crazy part is that I do absolutely nothing in the valueChangeListener except log to console.

What am I doing wrong? I have this working in other parts of my web application, but not here. This particular code is located within a tab - not sure if that has anything to do with it.

Any help is tremendously appreciated!!!
Actually, I did not really find the problem. I kinda just worked around what I think should work out of the box. I have attached a quick movie of what I do and how the problem happens. Seems a bit "goofy" to me that the wizards do not work unless you specify jspx as it used to not be that way. Have a look and tell me what you think.
 
Profile for markricard -> Messages posted by markricard [67] Go to Page: 1, 2, 3, 4, 5 Next 
Go to:   
Powered by JForum 2.1.7ice © JForum Team