| Author |
Message |
|
|
Same thing as with event scope (I did try it). The @Factory method is being called BEFORE the request parameters are processed so it still thinks that it's running the old query. On the next request the query will execute with the criteria from the 1st request.
I think the problem may be a way Icefaces interacts with the JSF request cycle. Seam is firing the @Factory method before the icefaces request is getting processed. At least that's what it looks like.
Thanks again!
Gerald
Code:
@Factory(value = "customResultList", scope = ScopeType.STATELESS)
public List customResultListInitializer()
{
System.out.println("1 *****GETFIRSTRESULT = " + getFirstResult());
List<Contest> resultList = super.getResultList();
System.out.println("2 *****GETFIRSTRESULT = " + getFirstResult());
return resultList;
}
|
 |
|
|
No, I'm just trying to update the resultList. Without the Factory EVERYTHING (it's a finished app, just doing performance tuning) works fine except for the standard JSF problem of a million repetitive queries. Since calling EntityQuery.resultList() as my value can't happen (due to JSF/queries) I have to create the factory object. I have to have the factory object in an event (request) scope or the dataset will never update until the user makes a call to the xhtml page.
I don't think what I'm doing is that unusual, it's pretty much boilerplate stuff as I understand it without the Factory thing. But in doing performance tuning I have to take care of the calls to getResultList to plug a BIG performance hole.
If I'm missing something big, I'm very willing to see things in a new light ; )
Thanks!
Gerald
|
 |
|
|
Yes, it has to update pretty much everytime there is a request so it applies filtering, sorting, paging, etc. Otherwise the dataset never changes since icefaces is ajaxish.
|
 |
|
|
Greetings!
I have a problem where I'm trying to use a @Factory method in an EntityQuery to avoid the JSF problems of calling EntityQuery.getResultsList() so many times. In general it works, however it seems as though on a request from IceFaces it's creating the Factory object before the query properties are updated.
From my list.xhtml:
Code:
<ice:form id="listFormId">
<ice:dataTable id="listDataTableId"
var="myEntity"
value="#{customResultList}"
rendered="#{not empty customResultList}"
width="100%">
And the factory method in the EntityQuery object:
Code:
@Factory(value = "customResultList", scope = ScopeType.EVENT)
public List customResultListInitializer()
{
List<Contest> resultList = super.getResultList();
return resultList;
}
Here's my page.xhtml facelet for grins (not particularly relevant, but since I use it as example):
Code:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:ice="http://www.icesoft.com/icefaces/component"
xmlns:s="http://jboss.com/products/seam/taglib">
<ice:form>
<table id="pagerTable" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<ice:commandLink
action="#{entityList.first}"
disabled="#{not entityList.previousExists}"
onclick="blur(); top.scroll(0,0);">
<ice:graphicImage url="#{entityList.previousExists ? '/images/pager_first_en.png' : '/images/pager_first_dis.png'}" style="border:none;"/>
</ice:commandLink>
</td>
<td align="center">
<ice:commandLink
action="#{entityList.previous}"
disabled="#{not entityList.previousExists}"
onclick="blur(); top.scroll(0,0);">
<ice:graphicImage url="#{entityList.previousExists ? '/images/pager_prev_en.png' : '/images/pager_prev_dis.png'}" style="border:none;" />
</ice:commandLink>
</td>
<td align="center">
<ice:selectOneMenu
value="#{entityList.currentPage}"
partialSubmit="true">
<s:selectItems value="#{entityList.pageList}"
var="page"
label="#{page}"/>
</ice:selectOneMenu> / #{entityList.pageCount}
</td>
<td align="center">
<ice:commandLink
action="#{entityList.next}"
disabled="#{not entityList.nextExists and entityList.currentPage ge entityList.pageCount}"
onclick="blur(); top.scroll(0,0);">
<ice:graphicImage url="#{entityList.nextExists or entityList.currentPage lt entityList.pageCount ? '/images/pager_next_en.png' : '/images/pager_next_dis.png'}" style="border:none;" />
</ice:commandLink>
</td>
<td align="center">
<ice:commandLink
action="#{entityList.last}"
disabled="#{not entityList.nextExists and entityList.currentPage ge entityList.pageCount}"
onclick="blur(); top.scroll(0,0);">
<ice:graphicImage url="#{entityList.nextExists or entityList.currentPage lt entityList.pageCount ? '/images/pager_last_en.png' : '/images/pager_last_dis.png'}" style="border:none;" />
</ice:commandLink>
</td>
</tr>
<tr>
<td align="center" style="font-size: .75em;">
First
</td>
<td align="center" style="font-size: .75em;">
Prev.
</td>
<td align="center" style="font-size: .75em;">
Go to Page (#{entityList.currentPage})
</td>
<td align="center" style="font-size: .75em;">
Next
</td>
<td align="center" style="font-size: .75em;">
Last
</td>
</tr>
</table>
</ice:form>
</ui:composition>
An example of the symptoms (just one example, is NOT paging specific, this is just easiest to communicate):
1. I load the page, everything's fine.
2. I click Next (using seam style paging through the EntityQuery, not icefaces paginator)
3. nothing happens (firstResult should now equal 2)
4. Hit next again
5. Shows me page 2 (firstResult should be 3, but is now 2)
6 etc.
The above values are printed out from the Factory method above. Sometime AFTER the factory method is called the values are updated so on the next request it shows what it should have shown previously. This make ANY sense at all? hehe
This is NOT paging specific as I said above. It does the same thing using EntityQuery restrictions as filters, changing maxResults() anything shows the same symptoms.
So just to try and say it in another way, this is what I thinks happening:
1. Load the page. everything's fine.
2. Click next (or filter or whatever) instantiate the factory
2.5 pass request data into seam (object already instantiated)
3 Render page
I've been beating my head against this for a couple days now so any help is VERY much appreciated.
Gerald
|
 |
|
|
Greetings!
I have an icefaces & seam (2.1.2) app that I've deployed in Liferay (not portlet-ized, just with the WAI bridge(all defaults atm)). It deploys and comes up ok but ALL icefaces javascript functionality is problematic. Below is a bit of what firebug is telling me:
Code:
illegal character
[Break on this error] ?
icefaces-d2d.js (line 1)
illegal character
[Break on this error] ?
ice-extras.js (line 1)
"plyC4tIkhbUf7g-xbl1CKg:1:configuration-script".asElement is not a function
[Break on this error] var container = 'plyC4tIkhbUf7g-xbl1CKg:...guration-script'.asElement().parentNode;
applicationPage.seam (line 7)
$element is not defined
[Break on this error] <tr><td class="m1" colspan="3" id="navig...dden" value="ICEfacesRenderKit" /></div>
applicationPage.seam (line 16)
"j_id106".asExtendedElement is not a function
[Break on this error] <div class="iceMnuBarItem" id="j_id77:j_...MnuBarItemLabel">Portal</span></a></div>
applicationPage.seam (line 48)
$element is not defined
[Break on this error] <div class="iceMnuBarItem" id="j_id77:j_...MnuBarItemLabel">Issues</span></a></div>
applicationPage.seam (line 51)
$element is not defined
[Break on this error] <link href="favicon.ico" rel="shortcut i...d2d.js" type="text/javascript"></script>
applicationPage.seam (line 62)
$element is not defined
[Break on this error] <script type="text/javascript">try { doc...se, true); } catch(e) {}</script></head>
applicationPage.seam (line 64)
$element is not defined
[Break on this error] <div class="iceMnuBarItem" id="j_id77:j_...eMnuBarItemLabel">Admin</span></a></div>
applicationPage.seam (line 82)
$element is not defined
[Break on this error] <table class="icePnlGrd" id="applicationPageF...orm</a></span></td></tr></tbody></table>
applicationPage.seam (line 397)
Ice is not defined
[Break on this error] <div class="icePnlClpsblColpsdCnt"></div...:j_id172Expanded" type="hidden" /></div>
applicationPage.seam (line 412)
setFocus is not defined
[Break on this error] <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML...le id="document:title">MyApplication</title>
applicationPage.seam (line 1)
iceSubmit is not defined
As I know icefaces and liferay are supposed to get along, and I can't find any mention of this type of problem anywhere, I suspect I've got something wrong on my side. Can't figure it out for the life of me though.
I have a deadline coming up next Tuesday and am starting to get a little nervous/desperate. Any pointers I can get on this would be GREATLY appreciated!
Thanks!
Gerald
|
 |
|
|
Hey all!
I have a question, and I'm pretty certain that it is a really stupid question. However, I can't seem to find or intuit an answer.
I've created a rather large application that will be a commercial subscription based service. I'm using IceFaces 1.8.0 and Seam 2.1.1 at the moment. The problem is (and I'm almost embarrassed to say it): I'm having trouble getting the browser to return to the top of a page on update. For instance, doing a Next for a dataTable or Submitting a form that has invalid data, any submit or action based operation. The position of the page just stays the same whereas if I were using a standard app that reloaded a page for each request I'd be put back up top.
I'm really hoping someone has something that can give me a leg up on this one. I've googled to no avail and my alpha testers keep complaining. . .understandably really.
Thanks in advance for any assistance. Please don't laugh too long or hard, don't want anybody hurt : b
Gerald
|
 |
|
|
Hey all!
I have a question, and I'm pretty certain that it is a really stupid question. However, I can't seem to find or intuit an answer.
I've created a rather large application that will be a commercial subscription based service. I'm using IceFaces 1.8.0 and Seam 2.1.1 at the moment. The problem is (and I'm almost embarrassed to say it): I'm having trouble getting the browser to return to the top of a page on update. For instance, doing a Next for a dataTable or Submitting a form that has invalid data, any submit or action based operation. The position of the page just stays the same whereas if I were using a standard app that reloaded a page for each request I'd be put back up top.
I'm really hoping someone has something that can give me a leg up on this one. I've googled to no avail and my alpha testers keep complaining. . .understandably really.
Thanks in advance for any assistance. Please don't laugh too long or hard, don't want anybody hurt : b
Gerald
|
 |
|
|
Makes sense, I've come up with an alternate solution.
Thanks!
Gerald
|
 |
|
|
Trying a little bump (only once). Still not able to find anything.
|
 |
|
|
Trying a little bump (only once). Still not able to find anything.
|
 |
|
|
Hey all!
IceFaces 1.7.2.SP1
Seam 2.1.1.GA
Jboss 4.2.3
I'm having a bit of a problem with a set of selectOneMenus that I'm about to pull all my hair out with.
I have a form that contains 4 selectOneMenus, these SOMs specify criteria for searches. The problem I'm having is that if a user selects something from ONE of the SOMs, it submits ALL of them. I can't break them out into individual forms due to other stuff going on. Here's code for them:
Code:
<s:decorate id="searchContestCategoryLabelId" template="/layout/edit.xhtml">
<ui:define name="label">Contest Category</ui:define>
<ice:selectOneMenu id="searchContestCategorySelectId"
partialSubmit="true"
value="#{contestCriteria.contestCategory}">
<f:selectItem itemLabel="Select Contest Category" itemValue=""/>
<s:selectItems var="_category"
value="#{contestCategoryList.resultList}"
label="#{_category.name}"/>
<s:convertEntity/>
</ice:selectOneMenu>
</s:decorate>
<s:decorate id="searchFrequencyLabelId" template="/layout/edit.xhtml">
<ui:define name="label">Frequency</ui:define>
<ice:selectOneMenu id="searchFrequencySelectId"
partialSubmit="true"
value="#{contestCriteria.frequency}">
<f:selectItem itemLabel="Select Frequency" itemValue=""/>
<s:selectItems var="_frequency"
value="#{frequencyList.resultList}"
label="#{_frequency.name}"/>
<s:convertEntity/>
</ice:selectOneMenu>
</s:decorate>
<s:decorate id="searchEligibilityLabelId" template="/layout/edit.xhtml">
<ui:define name="label">Eligibility</ui:define>
<ice:selectOneMenu id="searchEligibilitySelectId"
partialSubmit="true"
value="#{contestCriteria.eligibility}">
<f:selectItem itemLabel="Select Eligibility" itemValue=""/>
<s:selectItems var="_eligibility"
value="#{eligibilityList.resultList}"
label="#{_eligibility.name}"/>
<s:convertEntity/>
</ice:selectOneMenu>
</s:decorate>
<s:decorate id="searchPrizeCategoryLabelId" template="/layout/edit.xhtml">
<ui:define name="label">Prize Category</ui:define>
<ice:selectOneMenu id="searchPrizeCategorySelectId"
partialSubmit="true"
value="#{contestCriteria.prizeCategory}">
<f:selectItem itemLabel="Select Prize Category" itemValue=""/>
<s:selectItems var="_prizeCategory"
value="#{prizeCategoryList.resultList}"
label="#{_prizeCategory.name}"/>
<s:convertEntity/>
</ice:selectOneMenu>
</s:decorate>
I'd have to scrub to post more code, but there's 0 remarkable. Everything is contained in an <ice:form> and it's just setting properties on a bean that the EntityQuery (seam) is watching. They all work individually, just a matter of finding out why they're all submitting automagically.
Thanks!
Gerald
P.S. I've done plenty of searches, but everything I find is really old and supposed to have been fixed, so I suspect that they're not related.
|
 |
|
|