[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 
Problems with Data Binding  XML
Forum Index -> Development
Author Message
bthalheim

Power User

Joined: 05/04/2012 11:45:24
Messages: 72
Offline

Hi,

I have a popup, which I open like this:
Code:
final ModalPopup popup = JournaleintragUebersichtUI.this.dispatcher.createModalPopup();
 			popup.setUndecorated(true);
 			AnhaengePopupUI anhaengePopupUI = (AnhaengePopupUI) JournaleintragUebersichtUI.this.dispatcher.getDispatchedBean(AnhaengePopupUI.class);
 			anhaengePopupUI.setAnhaenge(this.m_journaleintragsInfo.getAnhaengeList());
 			// @formatter:off
 			popup.open(anhaengePopupUI.getPageName(),
 					JournaleintragUebersichtUI.this.captainCasaUiMessageSource.getMessage("journaleintraege_anhaenge"), 
 					450, 300,
 					new DefaultModalPopupListener(popup));

My JSP looks like this:
Code:
 <t:fixgrid id="g_3" objectbinding="{d.AnhaengePopupUI.anhaengeGrid}" sbvisibleamount="25" width="100%" >


The UI Class looks like this:
Code:
 @CCGenClass(expressionBase = "{d.AnhaengePopupUI}")
 public class AnhaengePopupUI extends WorkpageDispatchedBean {
 


The Idea is to re-use a popup, so I re-init the UI class with data anytime just before the popup is opened. It's basically like in the demo workplace, just with less indirection.

The Problem is, I don't see any Data in my grid. The error message is:
2012:07:23 11:25:30:506 | 16 | SEVERE | Binding execption: java.lang.Exception: The binding object #{{d.AnhaengePopupUI.anhaengeGrid} for the FIXGRID is null
 


I have got no idea, where this Double-{ comes from. It is obviously wrong ant I have not written it down anywhere.

Has anybody had this problem before or any hint, where I can look. It seems like a typing error, but as far as I can see it, there is no typing error.

Regards,

Björn
bthalheim

Power User

Joined: 05/04/2012 11:45:24
Messages: 72
Offline

OK I found the error. I need to us a # before the { in the CCGenClass annotation.
I guess I always have to do that, when I use a workspace dispatched bean.

Waht if I use a PageBean? I think I have seen things work also without # before.

Regards,

Björn
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5555
Offline

Hi,

no - expressions always start with "#" or with "." (in case of grid cell components)...

If using page beans, yes, it in certain constellations also works without "#", but then you cannot test the page bean as separate bean anymore... so we strongly recommend NOT to do so!...

In general: the object binding, esp. when working with popups is much nicer when consequently working with page beans. You are going through the dispatcher for creating the popup, so this is only the second best option...!

Regards, Björn

Björn Müller, CaptainCasa GmbH
bthalheim

Power User

Joined: 05/04/2012 11:45:24
Messages: 72
Offline

OK, cool, so I'll stick to #{...} completely.

I totally agree on your statement, I usually like to develop Popups as Pagebeans first, so if I just use WorkspaceDispatchedPageBeans, I can use them easily within a popup or not.

Thanks,

Björn
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team