reusing client actions from a block

reusing client actions from a block

  

hi, please help. i have an application that exposes blocks, and another that consumes them. now the problem is on my consumer module i dont have access to the blocks' client actions. 


so i guess the real question here is, "can i reuse client actions defined on a block"? :)

Hello phiwokuhle

You don't.
Client actions defined inside a block are available only inside that block.

Cheers.

EDIT: If you need to reuse, you can make those client action "generic", and call than from inside the block and from any other place you want.

https://success.outsystems.com/Documentation/10/Developing_an_Application/Implement_Application_Logic/Actions_in_Mobile_Apps

EDIT 2: In fact, in mobile there is a way to call a block action through javascript. See answer below.

Solution

Hi Phiwokuhle,

Have a look at this document if it can help you:

https://success.outsystems.com/Documentation/Development_FAQs/How_to_Call_a_Block_Action_in_a_Mobile_Screen

Regards,

Daniel

Solution

Eduardo Jauch wrote:

Hello phiwokuhle

You don't.
Client actions defined inside a block are available only inside that block.

Cheers.

EDIT: If you need to reuse, you can make those client action "generic", and call than from inside the block and from any other place you want.

https://success.outsystems.com/Documentation/10/Developing_an_Application/Implement_Application_Logic/Actions_in_Mobile_Apps

hey Eduardo,

thanks for the immediate response, so what i left out on my question is the fact that i am actually  trying to reuse the actions from the block they're defined in.... but from a consumer app.

my block has buttons and their related actions but when ever i consume it i have to redefine the actions on the consumer app. or i might be missing something here

phiwokuhle vimbayo wrote:


hey Eduardo,

thanks for the immediate response, so what i left out on my question is the fact that i am actually  trying to reuse the actions from the block they're defined in.... but from a consumer app.

my block has buttons and their related actions but when ever i consume it i have to redefine the actions on the consumer app. or i might be missing something here

If I understood right, you want to be able to redefine the actions on an app that is consuming this block?
If so, no. There is no way for you to do that (as far as I can tell...).

Not directly, at least. What is defined inside a block can't be accessed outside. And you can''t redefine the actions the buttons inside it execute...

MAYBE (and it is a BIG maybe), it would be possible through JavaScript, but I really think it would be, probably, a bad idea most of the time... 

So, why do you need this generic block? What are you trying to do, exactly?


Daniël Kuhlmann wrote:

Hi Phiwokuhle,

Have a look at this document if it can help you:

https://success.outsystems.com/Documentation/Development_FAQs/How_to_Call_a_Block_Action_in_a_Mobile_Screen

Regards,

Daniel

Didn't remember of this :)
Nice!


P.S.

But there is an easy solution.
Events.

Your block actions can trigger events and than in each app you can associate app client actions to execute logic on those events.

Eduardo Jauch wrote:

Daniël Kuhlmann wrote:

Hi Phiwokuhle,

Have a look at this document if it can help you:

https://success.outsystems.com/Documentation/Development_FAQs/How_to_Call_a_Block_Action_in_a_Mobile_Screen

Regards,

Daniel

Didn't remember of this :)
Nice!


Works like a charm :)


Daniël Kuhlmann wrote:

Eduardo Jauch wrote:

Daniël Kuhlmann wrote:

Hi Phiwokuhle,

Have a look at this document if it can help you:

https://success.outsystems.com/Documentation/Development_FAQs/How_to_Call_a_Block_Action_in_a_Mobile_Screen

Regards,

Daniel

Didn't remember of this :)
Nice!


Works like a charm :)


it really worked like charm... thanks guys :)