Author |
Message |
26/05/2010 10:40:16
|
rheinrichs
Power User
Joined: 08/05/2009 10:05:36
Messages: 209
Offline
|
Hi!
In case, that an error occurs while initializing a workpage we want to close the workpage, that is rendering in that moment.
To open the workpage, we use:
<pre>
ContentWindowUI wwui = (ContentWindowUI) getOwningDispatcher().getDispatchedBean(ContentWindowUI.class);
wwui.showContentPage("/SchrittDetail.jsp", "Schrittdetail", item.getView().getId());
</pre>
In <code>SchrittDetailUI</code> in case of an Exception we use:
<pre>
try {
init(taskId);
} catch (Exception e) {
writeError(e.getCause().getMessage());
// Das schließen waehrend der Initalisierung schlaegt fehlt, dass Workpage muss geoeffnet bleiben. Bug?!
getWorkpageContainer().closeWorkpage(getWorkpage());
}
</pre>
The new workpage is still open, but it should be closed.
Any idea?
best regards
|
|
|
26/05/2010 10:59:36
|
mreich
Power User
Joined: 30/01/2009 08:34:23
Messages: 750
Offline
|
Hi,
where is your init() method called, in the beans constructor?
If so, there's no possibility to close the workpage!
This was already discussed at http://www.casabacdemo.com/forum/posts/list/522.page thread.
regards
Markus
|
|
|
26/05/2010 13:40:06
|
rheinrichs
Power User
Joined: 08/05/2009 10:05:36
Messages: 209
Offline
|
yes, I see, that is the same issue. We'll find a other solution.
thx...!
|
|
|
26/05/2010 13:58:04
|
mreich
Power User
Joined: 30/01/2009 08:34:23
Messages: 750
Offline
|
Now that CC is at JSF 1.2 maybe there's a possibilty through the @PostConstruct Annotation, Captain?
|
|
|
26/05/2010 14:31:38
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5555
Offline
|
Hi,
am not sure...
...and to be honest: I would recommend to be verrrry aware of the JSF phases: if you open a new workpage in the invoke-phase (action Listener) and you find out that this workpage is not valid within the rendering phase, then I would guess something is not 100% clear within your processing ;-)
The render phase is too late for doing page changes ("obviously" ;-)...) and I would not try to bypass this with re-rendering or whatever, but would better properly check within the invoke-phase what to do.
Please do not mit-interpret me... (what I say may sound like "everything different is stupid" - this is not my intention!).
Regards, Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
26/05/2010 15:07:57
|
mreich
Power User
Joined: 30/01/2009 08:34:23
Messages: 750
Offline
|
Ok, I saw that PostConstruct is also done in Rendering Phase too, so this wouldn't work anyway!
|
|
|
27/05/2010 14:56:46
|
rheinrichs
Power User
Joined: 08/05/2009 10:05:36
Messages: 209
Offline
|
Thanks for supporting and good ideas.
In our case it es possible, that while choosing a item for "edit mode", someone else has edit this item. Only in that case we want to aware to edit.
Maybe we find a better solution for that case.
anyway, thanks...! ;-)
|
|
|
27/05/2010 15:02:59
|
mreich
Power User
Joined: 30/01/2009 08:34:23
Messages: 750
Offline
|
For this case I use a global static Lockmanager class, which has a ConcurrentHashMap, where the entitiy id is the key and the sessionID is the value!
So I can always check against this map!
Markus
|
|
|
|