[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Make REPEAT component "visible" in Layout Editor Preview  XML
Forum Index -> Development
Author Message
CaptainCasa

Power User
[Avatar]

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

...following text was copied from mail and is snwered through the forum....:

I'm currently working with the repeat component of Captain Casa and I have a problem there. The repeat component itself works fine, but the content of the repeat component is not displayed in the CC editor (which makes sense since the linked list does not exist at the time). However, this behavior is annoying if you want to edit the content of the Repeat component in the editor. I've already tried to export the content of the repeat component to a separate JSP and include it using rowinclude, but this doesn't work either. I suspect it's due to how the Repeat component's fields are accessed (using {.xxx}, which presumably can't be evaluated correctly with a rowinclude).

Do you have a suggestion how to make the content of the Repeat component visible inside the CC editor?

Björn Müller, CaptainCasa GmbH
CaptainCasa

Power User
[Avatar]

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

The preview is a live-view onto the application.

But - and I assume that's "your" problem: the application typically has some procedure how to get to a page - which is e.g. is shown after having executed certain steps before. This procedure is of course missing when you now open the page in "isolated mode" of the editor.

But...: look at the following code:

Code:
     public XxxxxUI()
     {
         if (HttpSessionAccess.checkIfInLayoutEditorPreview() == true)
         {
             // do things that are only executed when being in preview mode
             // of the editor
         }
     }
 


So you can check in the constructor if you are running in preview mode - and if yes, then do some dummy initialization to the page bean, that more or less puts the page bean into some working context.

Hope this is the repsonse to your question... ;-)

Kind regards! Björn

Björn Müller, CaptainCasa GmbH
jbaur



Joined: 14/02/2023 09:38:42
Messages: 3
Offline

Thanks for the quick response! This could solve the problem, however: I am not too fond of adding code to the application just so that I can see and edit something in the editor, since it is "dead" code. Is there really no other way to solve my issue? Just making sure.

Kind regards
Jonas
CaptainCasa

Power User
[Avatar]

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

Thanks for immediately responding through the forum!

Currently there is no other way. Of course you should outsource this preview-initialization as much as possible, so that the amount of dead code is only one line...

Code:
      public XxxxxUI()
      {
          if (HttpSessionAccess.checkIfInLayoutEditorPreview() == true)
              PreviewIntialization.init(this);
      }
 


You see: I even skipped the "{", "}" brackets - not to make three lines out of it! ;-)

In general I like the idea that results from your repsonse: to have some "Preview-Injector" that is outside the page bean class - and that is automatically uses when in preview mode.

We will think about adding this in one of the next updates. I just transferred the issue to our list of near-term-features... Any additional input from your side of course is appreciated.

Thanks! Björn

Björn Müller, CaptainCasa GmbH
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team