| Author |
Message |
|
|
Hi Kumar,
We modified the source code of 1.8.2 version. I've attached the related file, and you can see the modified method below:
public void dispose() {
try {
if (!lifecycleLock.isHeldByCurrentThread()) {
lifecycleLock.tryLock(30, TimeUnit.SECONDS);
}
dispose.run();
ContextEventRepeater.viewNumberDisposed(
facesContext.getExternalContext().getSession(false),
sessionID,
Integer.parseInt(viewIdentifier));
} catch (InterruptedException exception) {
// do nothing.
} finally {
releaseLifecycleLockUnconditionally();
}
}
The problem was a deadlock. Two threads used an instance of this class (at session invalitation), and one thread locked the HTTP session, the other thread locked the lifecycleLock field. They were waiting for each others monitors. The new solution that dispose method waits max 30secs until get the monitor. This solutions it seems to be proper.
|
 |
|
|
Hi Errorken,
You wrote you fixed this problem. We've experienced the same problem in Icefaces 1.8.2 in IBM WebSphere Application Server 6.1.0.29. Could you please write me where did you fix or send me the related source code? Sry if my request is stupid, I'm a beginner in the community work.
|
 |
|
|
Hi all,
I have the same problem. I tried the error page solution:
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error500.jsp</location>
</error-page>
I generated an error in jspx page: I wrote wrong bean property, but error page solution did not work, I got this error:
Exception Processing ErrorPage[exceptionType=java.lang.Exception, location=/error500.jsp]
java.lang.IllegalStateException: PWC3991: getOutputStream() has already been called for this response
(see error.txt)
Furhermore, error page solution did not work at all in action listener methods of backing beans:
public void saveProp( ActionEvent event )
{
try
{
...
}
catch ( FacadeException fe )
{
logger.throwing( this.getClass().getName(), "saveProp", fe );
FacesContext context = FacesContext.getCurrentInstance();
context.responseComplete();
context.getApplication().getNavigationHandler().handleNavigation( context, null, "applicationError" );
}
}
I mapped applicationError to an error page but it was not shown.
If I used this code:
public void saveProp( ActionEvent event ) throws FacadeException
{
...
}
then I saw error in the log but error page it still was not shown.
Can anybody help me? Is there an usual exception handling overview document in Icefaces???
|
 |
|
|
Hi Wayne,
I put edit functionality out of dataTable. There is a form that will be filled current row data if you push the Edit button on the row. This solution it works fine. Nevertheless, I'm interested in your suggestion.
" you can call the resetValue method on the componet before it is dispalyed which will return it to the default state."
Could you write me exactly to where should I put resetValue() call? Is it a lifecycle related thing and should I put it in a specific lifecycle method?
Best regards,
Rudi
|
 |
|
|
Hi Wayne,
Thx, I see your last suggestion. Sry for my incompetence but I need bind input text MULTIPLE components 'cause it is contained in the datatable, input text has multiple values. E.g. I could bind it to a HtmlInputText[] attribute, but I should know which iteration is the current one, and no numeric loop variable available. If I do what you wrote productmanager.myInputText will refer JUST one input field and I cannot access its other values.
Best regards,
Rudi
|
 |
|
|
Hi Wayne,
I think I found the reason of the problem: HtmlDataTable component saves all its children and restore them, but I cannot "see" children, because I just access child components. E.g. if table contains ten rows including ten HtmlInputText, I can access just one HtmlInputText. Here is the tree that I can see:
(see tree.txt)
If table contains ten rows tree will look like the same above. If I call resetValue() on the one HtmlInputText, DataTable will it overwritten then it restores the children state. The related code:
(see jspx.txt)
To your suggestion: As you can see, in value of dname field refers to the dataTable cycle variable: ownProps. Do you have an idea howto bind dName to a backing bean if dName is in the dataTable "cycle"?
Best regards,
Rudi
|
 |
|
|
Hi Wayne,
I added an new input text to my form OUTSIDE the dataTable. I bound it to an HtmlInputText property of my bean (with "binding" attribute). I reset the field in action listener. It worked fine! I think the problem is that inputs there are INSIDE the dataTable. I can't find the solution:(
Best regards,
Rudi
|
 |
|
|
Hi Wayne,
Thx your quick answer.
I've tried your suggestion. I bound the ice:dataTable to a HtmlDataTable component in a backing bean (I couldn't bind the inputText because rows and input inside are shown in a dynamically way from database). In the contentVisibleAction action listener I get the HtmlDataTable component this way:
HtmlDataTable ownDataTable = ( HtmlDataTable ) facesContext.getApplication().createValueBinding( "#{productmanager.ownDataTable}" ).getValue( facesContext );
After I reset all input values with this code:
private void resetInputValues( UIComponent component )
{
if ( component != null )
{
List<UIComponent> children = component.getChildren();
for ( UIComponent child : children )
{
if ( child instanceof UIInput )
{
UIInput input = ( UIInput ) child;
input.resetValue();
logger.finest( "### " + input.getId() + ": reset value" );
}
resetInputValues( child );
}
}
}
...
resetInputValues( ownDataTable );
Unfortunately, I get the same error.
Did I understand you well?
|
 |
|
|
Hi,
I'm using ICEfaces 1.8.2 on Glassfish 2.1. I downloaded the sample application from this site ('cause I'm a beginner in ICEfaces):
http://facestutorials.icefaces.org/tutorial/dynamic-includes-tutorial.html
This sample: http://facestutorials.icefaces.org/tutorial/dynamic-includes-tutorial.zip
Then I started to modify the sample. I modified the logic of tree building and I put a ice:dataTable component to the content-facelet.jspx but base navigation logic wasn't modified: if you click on a node of tree, PageContentBean.contentVisibleAction() will be called, and the backing bean for content-facelet.jspx will use the navigation bean. dataTable contains columns those contains input elements like inputText, etc. Each error messages are placed after each input elements like this:
<h:column>
<f:facet name="header">
<ice:outputText value="#{msg.product_prop_table_frnum}"/>
</f:facet>
<ice:inputText id="frnum" value="#{ownProps.frnum}" required="false"/>
<ice:message for="frnum" style="color: red"></ice:message>
</h:column>
ice:dataTable is placed in a form. There is a button above the form, it have an action listener. Action listener saves data to the database, it works fine. If I don't fill a required field, relevant error message will be shown, it's ok too. But after that I cannot make "dissappear" this message. It means that I click on different nodes of tree, table is shown properly, but the first field (that was empty and had a message) is empty and error message is still shown. I saw on the log that no more validation after clicking (because button wasn't pushed), but as I mentioned table is shown properly, the appropriate method of backing bean is called. I tried that I added "immediate" attribute to ice:commandLink of nodes of tree, but the result is the same.
Could you help me anyone? Might the problem is that navigation logic of the original sample cannot be used to this purpose?
|
 |
|
|