107
Views
10
Comments
Solved
Consume screen from another module

How to consume a screen from another mobile module since the public toggle is not available on mobile apps?

Am I supposed to do workarounds with the url?

2024-05-30 10-12-48
Anushka singh
Solution

Hello

In OutSystems, consuming a screen from another mobile module can be a common requirement. However, in mobile apps, the option to make screens public (as is possible in web apps) is not available. Here’s how you can achieve this: 

Using Blocks for Reusability:

One effective method is to encapsulate the UI and logic you want to share into reusable blocks. These blocks can then be used across different modules.

Create a Block in the Module with the Desired Screen:


Go to the module where the screen is located.

Create a new Block and include the necessary UI and logic.

Make the Block Public:


In the properties of the Block, enable the Public option.

Use the Block in Another Module:


Go to the module where you want to use the Block.

Add a dependency on the module containing the Block.

Drag and drop the Block onto your screen and configure it as needed.

You can use a URL schema to navigate to a screen in another module. This is an indirect method and requires proper navigation management.


Steps:


Configure URL Schema:


Configure the URL schema for your application in the Service Center.

Create the Navigation Logic:


Use JavaScript and URL parameters to manage screen navigation.

Construct the URL for the screen in the other module.

Navigate Using URL:


Use the constructed URL to navigate to the desired screen.Directly consuming a screen from another mobile module is not possible in OutSystems, but you can achieve similar functionality using Blocks, URL schemes, and Client Actions. Using Blocks is the preferred method as it promotes reusability and maintainability. 

i hope it's help you

UserImage.jpg
Patrick X

Hi,

Thanks for the very solid response.

So in this case I would need to put the screens logic/components into a CWM module?

Because refences of blocks from end user to end user are strong dependencies, right?

Thanks

UserImage.jpg
Patrick X

Great!
I'll mark this response as the solution, because it provided different ways of addressing this question and it's also rich in details.

Thanks everyone, thanks Anushka.

2023-08-28 07-00-10
Paulo Torres
Champion

Hi,

Screens is not a consumable element and if it was possible you would create a side reference (One of the 3 references that you cannot create).

You can call the screen by the URL if you really need.

Regards

UserImage.jpg
Patrick X

Hi,

Screens are definitely consumable. 

Side references of screens from End User module to End User module are considered weak dependency in O11+ and as such, acceptable...therefore without breaking any architecture rules. 


https://success.outsystems.com/documentation/11/building_apps/reusing_and_refactoring/understand_strong_and_weak_dependencies/


My doubt was if is there any clean approach when it's needed to do the same thing but with mobile apps, that doesn't have the public option available for screens

Thanks

2023-08-28 07-00-10
Paulo Torres
Champion

In mobile they are not consumable!

Even weak reference should be avoided. for that exists WebBlocks.

Applications are subject to the same validation rules, respecting the relations between them:

  1. No upward references

  2. No side references among End-User applications or Orchestration applications

  3. No cyclic references between two applications

https://success.outsystems.com/documentation/best_practices/architecture/designing_the_architecture_of_your_outsystems_applications/application_composition/applying_the_architecture_canvas_to_applications/

2020-03-10 08-50-23
Sven Persijn

Hi Patrick,

I would rather suggest that you convert the screen from the other application to a web block. This way, you can consume the web block while make sure that both mobile applications can use their own theme and navigation.

UserImage.jpg
Patrick X

Hi Persijin,

Can consider this option. Will wait a bit to see if is there any clean solution that doesn't require moving everything to blocks or referencing URLs.

Thanks

2024-05-30 10-12-48
Anushka singh
Solution

Hello

In OutSystems, consuming a screen from another mobile module can be a common requirement. However, in mobile apps, the option to make screens public (as is possible in web apps) is not available. Here’s how you can achieve this: 

Using Blocks for Reusability:

One effective method is to encapsulate the UI and logic you want to share into reusable blocks. These blocks can then be used across different modules.

Create a Block in the Module with the Desired Screen:


Go to the module where the screen is located.

Create a new Block and include the necessary UI and logic.

Make the Block Public:


In the properties of the Block, enable the Public option.

Use the Block in Another Module:


Go to the module where you want to use the Block.

Add a dependency on the module containing the Block.

Drag and drop the Block onto your screen and configure it as needed.

You can use a URL schema to navigate to a screen in another module. This is an indirect method and requires proper navigation management.


Steps:


Configure URL Schema:


Configure the URL schema for your application in the Service Center.

Create the Navigation Logic:


Use JavaScript and URL parameters to manage screen navigation.

Construct the URL for the screen in the other module.

Navigate Using URL:


Use the constructed URL to navigate to the desired screen.Directly consuming a screen from another mobile module is not possible in OutSystems, but you can achieve similar functionality using Blocks, URL schemes, and Client Actions. Using Blocks is the preferred method as it promotes reusability and maintainability. 

i hope it's help you

UserImage.jpg
Patrick X

Hi,

Thanks for the very solid response.

So in this case I would need to put the screens logic/components into a CWM module?

Because refences of blocks from end user to end user are strong dependencies, right?

Thanks

UserImage.jpg
Patrick X

Great!
I'll mark this response as the solution, because it provided different ways of addressing this question and it's also rich in details.

Thanks everyone, thanks Anushka.

2020-03-10 08-50-23
Sven Persijn

Hi,

That's correct. Referencing to other end user blocks are considered strong connections. Best way is to put the block in a separate module and even a separate application. Otherwise, the mobile applications still will have strong connections.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.