Default parameters to extension functions

How to pass default parameters to a extension function which have a default value?

blocks (11)
Like the cancelable parameter here

It is not possible yet! This particular method that you have shown here has the default value hardcoded in the blocklyeditor source.

Ok, thanks!

I think it is possible if we use
boolean cancelable right
I could help if u share what u did still now

No, it doesn't happen. I've used boolean cancelable as in the appinventor source but nothing happens.

What code u have till now

I think @pavi2410 is correct as in the sources also they haven't done anything different.

Then fine it's just a thought

Here is the code where the ShowChooseDialog block's cancelable parameter is appended a default block

As you can see, similar functionality cannot be achieved via an extension


So it's embedded into the website only?

That's correct

1 Like

I've filed a feature request here


just same word

the same i mentioned here

any way fine

If you look at the code I linked, the default block is added if and only if the component_type is Notifier and the method_name is ShowChooseDialog.

Setting your parameter name to 'cancelable' won't do the trick, I'm afraid


i thought of different way sorry i thought qs is how to ask

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.