voyent
Messages posted by: atomz4peace  XML
Profile for atomz4peace -> Messages posted by atomz4peace [121] Go to Page: Previous  1, 2, 3, 4, 5, 6, 7, 8, 9 Next 
Author Message
Thanks bionut. I see you have the changeSelection method when the user makes a select or un-select.

Say each of my rows lists a username and user ID. I need to keep track of which user IDs are selected. When the user clicks "go" I take that list and do something with it.

So this ValueChangeEvent contains the details. So if I have something like:

[code]
<ice:column>
<ice:outputText value="#{person.username}" />
<ice:outputText value="#{person.userid}" />
</ice:column>
[code]

and I want to now insert a checkbox:

[code]
<ice:column>
<ice:selectBooleanCheckbox partialSubmit="true"
value="#{person.selected}"
valueChangeListener="#{personList.changeSelection}"
/>
<ice:outputText value="#{person.username}" />
<ice:outputText value="#{person.userid}" />
</ice:column>
[code]

How will my changeSelection method know the person.userid?

In an old-fashioned JSP Servlet model, I could do:

<input type="radio" name="mergeId" value="<%=WebUtils.printToJsp(new Integer(user.getUserId()))%>">

Is there a reason you used a boolean in the value? It seems like I could just do it like:

[code]
<ice:column>
<ice:selectBooleanCheckbox partialSubmit="true"
value="#{person.userid}"
valueChangeListener="#{personList.changeSelection}"
/>
<ice:outputText value="#{person.username}" />
<ice:outputText value="#{person.userid}" />
</ice:column>
[code]

Does ICE automatically handle whether the box is selected or not?

I'm still trying to see how I keep track of both whether the checkbox is selected as well as the <input> value. Say I'm paging a table and go forward 3 pages. When I go back to page 1, I still want to have those same rows selected. With jsp/servlets, I can have a loop and just look up the user object and if it's selected for this ID, then show SELECTED. Has anyone done similar with ICE?

Thanks!
Hi,

I am trying to show a table where each row will have a checkbox on the left. We want to user to select multiple entries from the list, then click submit when done. Kind of like the ice:rowselector demo but with checkboxes.

Can this be done? If so, is there a taglib for a checkbox? And then how do you know which row element was selected in the backing bean?

If I do it by hand and inside the <ice:column> tags just insert raw html, how do I reference which row number or data so I know which ones were checked?

Thanks!
Jim
Hi,

We are testing icefaces as an include to our existing jsp pages. We have some pages where we have a search form. One of the parameters you can search for is a user or a list of users.

So today, you click on a button and we have a pop-up where the user can select multiple users from a list. When we close the pop-up, the selected users are populated in the search parameter textarea. This is all done today with plain jsp and post vars populating a session variable.

So now we want to use the icefaces to show the resulting table. We have two options:

1) Just include the iface files for the table data and leave the rest as-is. Can the ice backing bean still get at the session variables? If so, how do we get the handle to the session?

2) We can move the search form into the iface file as well. If we do that and have a pop-up, how do we get the values selected by the pop-up window back into the iface backing bean?

Any design thoughts are greatly appreciated!

Thanks!
Jim
I wish I had an answer too. For me, the F5 does NOT force the ice-extras.js to be loaded. But when I load the iface file directly, it does load ice-extras.js.

If Phillip is listening, does this sound like a bug?

I include the iface with:

<jsp:include page="/jsp/users_without_managers.iface" />


Is there anything we can try to help you figure out what is going wrong and why ice won't send the js file?

And is there a way for us to manually force it to be sent? If I insert a <link> to include the ice-extras.js I get a js error.

Thanks!
Thanks for the continued feedback to try and get this working!


Does that imply that my calling page is faces-ready as well?

I am converting an old app that has jsp pages that will probably not parse cleanly, according to the requirements in the ice release notes.

So I'm hoping to just include the ice page with an include. So the calling page will not be faces-compatible. Will that work?

.jsp page --not clean and not defined as a faces servlet in web.xml

The jsp page will include the jspx page which has ice taglib and defined as a faces persistent servlet.

This works for the paging and sorting table. But when I add the special effects for rowselect, fading, etc... It does not.

Should it work as I'm trying to do it?

Thanks,
Jim
And this is the main jsp file. When run this way, I get the errors. When loading iface directly, it works fine. I didn't want ice on every page, so was planning on including on those the need it.

The special effects also do not work, probably because of the missing extras file.

<html >
<head>
<link href="../xmlhttp/css/xp/xp.css" rel="stylesheet" type="text/css" />
<link href="../html/sccstyles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<jsp:include page="users_without_managers.iface" />
</body>
</html>
I just tested and if I load the .iface file directly, the rowselect works.

But NOT when included with the jsp:include.

Does that give any hints for what could be blocking?
I have refreshed everything including cleaning the temp andn work dirs of jboss.

If I force include the extras file, I still get the js error. The only warning I see is:

12:10:21,484 DEBUG [FacesContextFactoryImpl] Portlet classes not available: java.lang.ClassNotFoundException: No ClassLoaders found for: javax.portlet.PortletRequest


I even tried the dummyEffect on panelgroup and it did not give errors, but also did not include the extras.

I included the libs, some of these are for non-ice stuff in my code

Any other ideas to try before I punt on rowselect?

aopalliance.jar
backport-util-concurrent.jar
commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-fileupload.jar
commons-io-1.0.jar
commons-lang.jar
commons-logging-api.jar
commons-logging.jar
commons-validator.jar
el-api.jar
el-ri.jar
icefaces-comps.jar
icefaces-facelets.jar
icefaces.jar
jsf-api.jar
jsf-impl.jar
jsp-api.jar
jstl.jar
krysalis-jCharts-1.0.0-alpha-1.jar
log4j-1.2.9.jar
quartz-1.5.2.jar
servlet-api.jar
spring-aop.jar
spring.jar
standard.jar
taglibs-unstandard.jar
velocity-1.4.jar
velocity-dep-1.4.jar
xercesImpl.jar
xml-apis.jar





The full iface jsp is below:


<f:view xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ice="http://www.icesoft.com/icefaces/component">
<html>
<body>

<ice:form>
<ice:panelGrid columns="1" styleClass="" width="100%">
<ice:dataPaginator id="userlist"
for="data"
rowsCountVar="rowsCount"
displayedRowsCountVar="displayedRowsCountVar"
firstRowIndexVar="firstRowIndex"
lastRowIndexVar="lastRowIndex"
pageCountVar="pageCount"
pageIndexVar="pageIndex">
<ice:outputFormat
value="{0} users found. Page {4} of {5}."
styleClass="standard">
<f:param value="#{rowsCount}" />
<f:param value="#{displayedRowsCountVar}" />
<f:param value="#{firstRowIndex}" />
<f:param value="#{lastRowIndex}" />
<f:param value="#{pageIndex}" />
<f:param value="#{pageCount}" />
</ice:outputFormat>
</ice:dataPaginator>
<ice:dataPaginator id="usersPagerTop"
for="data" fastStep="10"
pageCountVar="pageCount" pageIndexVar="pageIndex" paginator="true"
paginatorMaxPages="10"
styleClass=""
rendered="#{!userWithoutManagers.vertical}">
<f:facet name="first">
<ice:graphicImage
url="../xmlhttp/css/xp/css-images/arrow-first.gif"
style="border:none;" title="First" />
</f:facet>
<f:facet name="last">
<ice:graphicImage
url="../xmlhttp/css/xp/css-images/arrow-last.gif"
style="border:none;" title="Last" />
</f:facet>
<f:facet name="previous">
<ice:graphicImage
url="../xmlhttp/css/xp/css-images/arrow-previous.gif"
style="border:none;" title="Previous" />
</f:facet>
<f:facet name="next">
<ice:graphicImage
url="../xmlhttp/css/xp/css-images/arrow-next.gif"
style="border:none;" title="Next" />
</f:facet>
<f:facet name="fastforward">
<ice:graphicImage url="../xmlhttp/css/xp/css-images/arrow-ff.gif"
style="border:none;" title="Forward" />
</f:facet>
<f:facet name="fastrewind">
<ice:graphicImage url="../xmlhttp/css/xp/css-images/arrow-fr.gif"
style="border:none;" title="Backward" />
</f:facet>
</ice:dataPaginator>

<ice:dataTable
id="data"
var="person"
binding="#{userWithoutManagers.usersTable }"
value="#{userWithoutManagers}"
styleClass=""
width="100%"
sortColumn="#{userWithoutManagers.sortColumnName}"
sortAscending="#{userWithoutManagers.ascending}"
rows="#{userWithoutManagers.entriesPerPage}"
headerClass=""
footerClass="grouptabletop"
headerClasses="menutableleft,menutable"
columnClasses="grouptableleft,grouptableright"
rowClasses="FFFFFF,F0F0F0"
columnWidths="50%,50%"
>

<ice:column>
<ice:rowSelector value="#{person.disabled}"
multiple="#{false}"
/>
<f:facet name="header">
<ice:commandSortHeader
columnName="#{userWithoutManagers.userColumnName}"
arrow="true" >
<ice:outputText value="#{userWithoutManagers.userColumnName}" />
</ice:commandSortHeader>
</f:facet>
<ice:outputLink value="admin_user_details.htm?userId=#{person.userId}">
<ice:outputText value="#{person.username}" />
</ice:outputLink>
&nbsp;
<f:facet name="footer">
&nbsp;
</f:facet>
</ice:column>

<ice:column>
<f:facet name="header">
<ice:commandSortHeader
columnName="#{userWithoutManagers.fullColumnName}"
arrow="true" >
<ice:outputText value="#{userWithoutManagers.fullColumnName}" />
</ice:commandSortHeader>
</f:facet>
<ice:outputLink value="admin_user_details.htm?userId=#{person.userId}">
<ice:outputText value="#{person.fullName}" />
</ice:outputLink>
<f:facet name="footer">
&nbsp;
</f:facet>
</ice:column>

</ice:dataTable>
<ice:dataPaginator id="usersPagerBottom"
for="data" fastStep="10"
pageCountVar="pageCount" pageIndexVar="pageIndex" paginator="true"
paginatorMaxPages="10"
styleClass=""
rendered="#{!userWithoutManagers.vertical}">
<f:facet name="first">
<ice:graphicImage
url="../xmlhttp/css/xp/css-images/arrow-first.gif"
style="border:none;" title="First" />
</f:facet>
<f:facet name="last">
<ice:graphicImage
url="../xmlhttp/css/xp/css-images/arrow-last.gif"
style="border:none;" title="Last" />
</f:facet>
<f:facet name="previous">
<ice:graphicImage
url="../xmlhttp/css/xp/css-images/arrow-previous.gif"
style="border:none;" title="Previous" />
</f:facet>
<f:facet name="next">
<ice:graphicImage
url="../xmlhttp/css/xp/css-images/arrow-next.gif"
style="border:none;" title="Next" />
</f:facet>
<f:facet name="fastforward">
<ice:graphicImage url="../xmlhttp/css/xp/css-images/arrow-ff.gif"
style="border:none;" title="Forward" />
</f:facet>
<f:facet name="fastrewind">
<ice:graphicImage url="../xmlhttp/css/xp/css-images/arrow-fr.gif"
style="border:none;" title="Backward" />
</f:facet>
</ice:dataPaginator>
</ice:panelGrid>

</ice:form>
</body>
</html>
</f:view>
Thank. I see that it works and it works on the showcase demo site. But not for me. I get these js errors in my browser (firefox)

Element.addClassName is not a function
Element.removeClassName is not a function

These are the onmouseover/out triggers.

In IE, I get 'Element' is null or not an object.

I am including my iface with this:

<jsp:include page="users_without_managers.iface"/>

Could the including page be causing an issue?
Thanks for the tip. That was certainly an issue, but did not cause ICE to insert the extras js file.

The taglib doc says you can just use

<ice:rowSelector />

and no other fields are needed. So I tried it but no js inserted.

bummer....

If anyone has this working with 1.5.1 it would be great to see sample code and jsp.

Thanks,
Jim
Thanks Phillip,

So how do I get the javascript onmouseover and onmouseout into the TR element when using the ice taglib. I can see how to get other text into the TD like this:


<ice:column>
ADD js CODE HERE FOR TD
<ice:outputText value="#{person.lastName}"/>
</ice:column>

But how do you insert at the TR level?

Thanks!
If it's fixed in 1.5.1, then any idea why I do not get the extra js file included? I'm including my iface page with a jsp include. It all works fine except for the js extras file not there. This is what I did. I added it inside the 1st column like the example in the showcase did:

Code:
                                 <ice:column>
                                 	<ice:rowSelector value="person.selected"
                                 		multiple="false"
                                 		mouseOverClass="highlight"	
                                 		/>
                                     <f:facet name="header">
                    					 <ice:commandSortHeader
                       				      columnName="#{user.userColumnName}"
                       				      arrow="true" >
                      			   <ice:outputText value="#{user.userColumnName}" />
                   					  </ice:commandSortHeader>         
                                     </f:facet>
                                     	<ice:outputLink value="admin_user_details.htm?userId=#{person.userId}">
                                     	<ice:outputText value="#{person.username}" />
                                     <!-- needed to get extras.js known bug -->
                                     	</ice:outputLink>
                                     	&nbsp;
                                     <f:facet name="footer">
                                    &nbsp;
                                     </f:facet>
                                 </ice:column>
 


Even when adding that dummyEffect, I still can't get it working. I get the error above with converting String to Effect. I'm using 1.5.1. Any ideas?

Thanks!
I tried the dummyEffect also and got this:

02:41:09,984 ERROR [D2DFaceletViewHandler] Problem in renderResponse: Cannot convert dummyEffect of type class java.lang.String to class com.icesoft.faces.context.effects.Effect
java.lang.IllegalArgumentException: Cannot convert dummyEffect of type class java.lang.String to class com.icesoft.faces.context.effects.Effect

Any ideas?
Is there an easy way to have the mouseover row highlighted on a datatable? I used to use javascript with onmouseover but can't do that on a ice datatable.

I see i could use the rowselector and not tie it to the backing bean but that seems a bit overkill.

Is there an easy way to say "highlight background color = #whatever"?

Thanks!
Jim
Thank you very much. That's the idea is was looking for! It was the whole dealing with first and last page and row that was the tricky part. I'll give it a shot and see if it's as easy as you made it look.

Jim
 
Profile for atomz4peace -> Messages posted by atomz4peace [121] Go to Page: Previous  1, 2, 3, 4, 5, 6, 7, 8, 9 Next 
Go to:   
Powered by JForum 2.1.7ice © JForum Team