[Logo] OLD FORUM - Use new one: https://www.CaptainCasa.online/forum
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Cloase Workpage while initialize  XML
Forum Index -> Development
Author Message
rheinrichs

Power User
[Avatar]

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


mreich

Power User
[Avatar]

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
[WWW]
rheinrichs

Power User
[Avatar]

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...!
mreich

Power User
[Avatar]

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?
[WWW]
CaptainCasa

Power User
[Avatar]

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
mreich

Power User
[Avatar]

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!
[WWW]
rheinrichs

Power User
[Avatar]

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...! ;-)
mreich

Power User
[Avatar]

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
[WWW]
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team