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
Hopefully this is a simple one. I have a datatable with checkboxes tied to a selected property in my object. In the header if the table, I put a selectBooleanCheckbox. If you check that box, it should "select all".

So I implemented the setter for the selectBooleanCheckbox to loop through the entire list of elements and set the selected property.

When I check the box, the setter works but the table does not re-paint and check the boxes until I click a sort, next page, etc...

Is there an easy way to force the re-draw of the checkboxes? I'm sure I could use javascript but that doesn't seem like the best thing.

Thanks!
Hi,

I'm using a datapagination table and have a checkbox on each row tied to a boolean value in my row object. In general, this works great.
I fetch 50 rows, show 10 per page. I can page and sort and the checkboxes follow as they should.

When I click a column heading, I have a sort method just like in the showcase example sort. This also works fine.

But if I click various column headers VERY fast, the checkboxes will change on their own. Say I check only 1 row. Then I start clicking the columns to sort and re-sort and repage very fast. I then end up with many checkboxes selected.

I can only assume it has to do with the data being sent asynchronously to the server. Does anyone have any ideas here? Could it be the javascript and POST colliding or is it more likely in my backing bean where we need to lock-step the access to it???

Thanks!

There is a post where someone listed a way to do it here:

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

But it has a bug. The behind the scenes faces libraries cause the datapager to get one row higher than rows per page. say I have 10 rows per page, it will query row 11. This forces the pager to get the next page of data from the DB. Then it always goes back and forth whenever you click on it.

I put in a hack that now works. In the getRowData method I inserted a clause in this section:

Code:
         if (rowIndex < startRow) {
             page = fetchPage(rowIndex, pageSize);
             startRow = page.getStartRow();
         } else if (rowIndex >= endRow) {
         	if (pager.getPageIndex() == lastPageNum) {
         		return page.getData().get(0);
         	}
             page = fetchPage(rowIndex, pageSize);
             startRow = page.getStartRow();
         }
 


The part I inserted this:
Code:
         	if (pager.getPageIndex() == lastPageNum) {
         		return page.getData().get(0);
         	}
 


Earliear in the abstract class I bound the datapager to the bean and you have to use the binding option for the <ice:datapaginator binding="pager">:

protected com.icesoft.faces.component.datapaginator.DataPaginator pager;

public com.icesoft.faces.component.datapaginator.DataPaginator getPager() {
return pager;
}

public void setPager(
com.icesoft.faces.component.datapaginator.DataPaginator pager) {
this.pager = pager;
}


and then in the fetchData method of the implementing class, I added one line to track what page number I should be on:

lastPageNum = (startRow / pageSize) + 1;


So basically, I keep track myself of what page I should be on. If the uidata faces component tries to get a row greater than the maxrows on my page (and it will as of the current version) then just fake it out and return row0 of this page since I know I will have data in that row.

This hack solved the problem we mentioned in that other post where you get 2 or 3 database queries on every click.

hope that helps...
I see it as well when you have MSIE 6 with security settings that warn you on mixed page types (SSL and nonSSL together). MSIE gives a pop-up warning. It's not the SSL cert error or anything like that. It says your page contains both secure and non-secure items. Do you want to display the nonscure items?

All of my ice pages use paging tables and I see it on every ICE page. We use the latest version.

I do not get the error message on firefox.
Silly me, this is a generic faces problem not specific to ICE. I found the answer here:

http://wiki.apache.org/myfaces/JavascriptWithJavaServerFaces

Does icefaces have any way to do a validation on a form submit? Say I have a submit button or commandlink or whatever. With normal html, I could have a submit="javascript...." and give an alert to the user to make sure they want to submit. If they said no, I stopped the js. If they said yet, I called the submit function in js.

But if I'm inside of an <ice:form> and I want to call a submit method in the backing bean, how can I still get that confirmation before calling the method? Or can my submit method somehow ask the user???

I didn't know if raw javascript can still access the backing bean since it's all dynamically generated with icefaces. I guess I could have javascript call a different controller after the confirmation and have that controller get at the bean via the session but that seems really ugly. Anyone have a good solution?

Thanks!
Jim
I'm seeing this and a few variations in the debug output for a pagination table. Does anyone know what it means or if it's a problem?

15:33:45,281 DEBUG [BridgeFacesContext] Cannot find clientId _id7:data:_id58from facesMessages

Thanks!

We implemented a custom pagination handler as described by bionut in http://www.icefaces.org/JForum/posts/list/2895.page. This gets only a page of data from the DB at a time, rather than storing the entire dataset in memory. After some testing, I noticed that the underlaying UIData components are calling the setRowIndex too often when paging. This was noticed also by hurzeler in that same post.

Here is what I mean:

Let's say I have it conifgured to show 10 rows per page and I have 100 rows.

Initial page load tries to getRowData for row indexes 0-10. But it should have only asked for 0-9 (ten per page). So when it asks for row 10 (really 11) I have to make another database call.

When I go next or jump to any other page, it gets:

- The pages I'm on now
- The pages I'm jumping too
- Plus one as with the initial query.

So say I jump to page 5. The UIData asks for:

- Rows 0-9 <-- Why??
- Rows 50-59
- Row 60 <-- Why??

Any ideas why it would ask for rows it already has and one more than the current page?

More importantly, does anyone know how to stop this?

Thanks!
If we want to use facelets, do we need to have the .xhtml extension, or can we still use .jspx? I did this in web.xml:

<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.jspx</param-value>
</context-param>

and this in faces-config.xml:

<application>
<view-handler>com.icesoft.faces.facelets.D2DFaceletViewHandler</view-handler>
</application>

So I thought that these lines with the libraries would be all that's needed to use facelets.

So I try a test on an ice page using the <c:out> tag and it renders nothing.

This will print nothing:
<c:out value="#{model.test}" />

But this does work:
<ice:outputText value="#{model.test}" />

Any idea why or should this work? I was using <c:out> as an easy test to make sure facelets and jstl were working.

Thanks and Happy New Year!
I have a page that has ICE components as well as normal HTML links. If I click on one of the normal links <a href="whatever"> then I get a quick network connection interrupted pop-up before it goes to the new page.

The dom debug shows simply:

01/00/2007 22:50:20 warn [window] : connection to server was lost
01/00/2007 22:50:20 debug [window.ajax] : [8681448] : connection closed
01/00/2007 22:50:20 info [window] : page unloaded!

So it makes sense that the connection is dropped because I clicked a link. I know also that I can turn off the persistence altogether.

But is there a way to have a normal link that suppresses the warning message for the connection closing? Sort of like a "I meant to do that so don't warn me" type of thing?

Thanks!
I saw the same thing and a debug showed that it was querying the NEXT page of data if you're on page one. If you're in the middle, it gets page-1, page, and page+1.

So that's what I saw it doing but I also have the same question of if it's really necessary and can I turn it off.
I saw that other faces implementations have a <radio> taglib to specify where exactly to place the button. Then you use layout="spread" to do-it-yourself.

Does anyone know if ICE has something similar?

Thanks and Happy New Year!
Hi,

I'm trying to make a table of data something like:

col1 text | col2 text | radio1 | radio2

With the ICE radio taglibs, can I put the 2 options for radio buttons one in each column of the table. The selectOneRadio looks like it needs the list to draw in a row but I want to have the buttons in different columns.

If not, can I do a checkbox in each column and then have javascript or the backing bean unset the other one to mimic the radio button?

The reason I want to split them between columns is that I want to then be able to sort for by which radio option was selected. Say I have approve or deny as my radio items. I want to sort to show which ones are approved and then resort for the denies.

Any ideas on how to split the radio buttons?

Thanks!
Jim
I have the same problem error with Problem in renderResponse: replacement showing up on a .jsp page.

Anyone have ideas why?

bionut wrote:


Lets say you had a Delete button which is intended to delete all selected rows via a deleteSelected(ActionEvent) method in your personList bean. All the deleteSelected() method would have to do is iterate through the list of person beans and delete those which had the person.selected property equal to true (since that property would have been set by the associated checkbox).
 


Great. I get it now thank you. My routine will be a bit more complicated since my personList will not have all of the people. I have to get data a page at time from the DB since it will take too much memory to store as many objects as I need for some reports. But I can still use your suggestion of iterating the list before populating with a new list.

Thanks!
 
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