ItEr26S03ContornaItEr25S03: Fixing problem at error popup
This commit is contained in:
parent
6b54cc723a
commit
25734e7132
4 changed files with 12 additions and 3 deletions
|
|
@ -2,6 +2,7 @@ package org.navalplanner.web.common.components;
|
|||
|
||||
import org.navalplanner.web.I18nHelper;
|
||||
import org.zkoss.zk.ui.HtmlMacroComponent;
|
||||
import org.zkoss.zul.Label;
|
||||
|
||||
/**
|
||||
* ZK macro component for translating texts created dinamically, that means,
|
||||
|
|
@ -82,4 +83,9 @@ public class I18n extends HtmlMacroComponent {
|
|||
|
||||
return I18nHelper._(value);
|
||||
}
|
||||
|
||||
public void forceLoad() {
|
||||
Label label = (Label) getFellow("i18nlabel");
|
||||
label.setValue(getI18n());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.navalplanner.web.common.components.I18n;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.Executions;
|
||||
import org.zkoss.zk.ui.util.GenericForwardComposer;
|
||||
|
|
@ -19,7 +20,8 @@ public class PageForErrorOnEvent extends GenericForwardComposer {
|
|||
super.doAfterCompose(comp);
|
||||
logError();
|
||||
modalWindow = comp;
|
||||
|
||||
I18n fellow = (I18n) modalWindow.getFellow("message");
|
||||
fellow.forceLoad();
|
||||
}
|
||||
|
||||
private void logError() {
|
||||
|
|
|
|||
|
|
@ -4,5 +4,5 @@
|
|||
]]>
|
||||
</zscript>
|
||||
|
||||
<label value="@{top.i18n}" />
|
||||
<label id="i18nlabel" value="@{top.i18n}" />
|
||||
</zk>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
width="400px" border="normal" mode="modal"
|
||||
apply="org.navalplanner.web.error.PageForErrorOnEvent">
|
||||
<vbox>
|
||||
<i18n value="Run-time error: {0} . Error was registered and it'll be fixed as soon as possible." arg0="${requestScope['javax.servlet.error.message']}" />
|
||||
<i18n id="message"
|
||||
value="Run-time error: {0} . Error was registered and it'll be fixed as soon as possible." arg0="${requestScope['javax.servlet.error.message']}" />
|
||||
<hbox style="margin-left:auto; margin-right:auto">
|
||||
<button id="continueWorking" label="${i18n:_('Continue')}" />
|
||||
<button id="reload" label="${i18n:_('Reload')}" />
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue