[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Using page beans within popup dialogs  XML
Forum Index -> Development
Author Message
jmewes

Active

Joined: 19/11/2017 06:20:00
Messages: 16
Offline

Hi,

In the "Tutorial - First Development Steps with CaptainCasa Enterprise Client" it is stated that "One page bean can open another one by simple calling the openModalPopup-method."

I tried to do this with the following code:

Code:
 Dialog d = new Dialog();
 d.setLabel("New label");
 d.setCloseDialogCallback(() -> closePopup(d));
 
 ModalPopup mp = openModalPopup(d, "Test", 300, 300, () -> closePopup(d));
 


(Complete example here: https://github.com/experimental-software/hello-captaincasa/tree/dialog)

It looks pretty much like the example in the Developer's Guide (p. 80) and the example code in the demo application. But instead of the text from the page bean the input field it shows "#.popups.P0.text}".

See https://pasteboard.co/Hao46lY.png

While the popup can be closed by clicking on the "x" the "onClose" action is not being called when clicking on the custom "Close" button.


Can you please help me to find out how to use page beans within dialogs?


Kind regards,

Jan
[WWW]
CaptainCasa

Power User
[Avatar]

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

Hi Jan,

I do not see any problem from code... but this is the theoretical view only...

So debugging what happens is the way to go. ;-) This is "just" one object talking to the other, so independent from CaptainCasa issues.

Regards, Björn

Björn Müller, CaptainCasa GmbH
jmewes

Active

Joined: 19/11/2017 06:20:00
Messages: 16
Offline

Hi Björn,

Can you please be a bit more specific?

I looked into the code with the debugger but have no clue what might be the problem.

https://pasteboard.co/Hcm8RDx.png

Actually the sample project above looks like the example in the documentation and the demo application to me. Even if I apply exactly the same code structure as in the demo application the same problem persists.



Code:
     public void onOpenDialog(ActionEvent actionEvent)
     {
         if (m_popup == null) {
 
             m_bean = new Dialog(getOwningDispatcher());
             m_bean.setLabel("New label");
 
             m_popup = openModalPopup(m_bean,"Hello World!",300,300, new ModalPopup.IModalPopupListener()
             {
                 public void reactOnPopupClosedByUser()
                 {
                     onClosePopup(null);
                 }
             });
         }
     }
 
[WWW]
jmewes

Active

Joined: 19/11/2017 06:20:00
Messages: 16
Offline

When I set a breakpoint at the end of the "PageBean#openModalPopup" method I am seeing the following values in my example project:

Code:
 pageBean.getActualRootExpression() : "#.popups.P0}"
 mp.getContentReplace() : "#{d.Dialog:#.popups.P0"
 


This looks quite different from the "DemoPopup" from the demo application (Section "Popup dialogs") which opens up the "DemoBudget" dialog:

Code:
 pageBean.getActualRootExpression() : "#{d.d_16.DemoPopup.popups.P0}"
 mp.getContentReplace() : "#{d.DemoBudget:#{d.d_16.DemoPopup.popups.P0"
 


To me it looks like the "Popup dialogs" example uses the same structure for the root expressions. What am I doing differently?
[WWW]
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team