Need to show a Web block on screen through service action using javascript

Need to show a Web block on screen through service action using javascript

  

Hi,

I want to create a service action to show a web block on any Webscreen, may be by using JS. Can anyone help me how Can I achieve it.

Thanks,

Sachin

Hi Sachin,

You cannot have Web Blocks magically appear on any Screen at run time. You need to include them design time.

Kilian Hekhuis wrote:

Hi Sachin,

You cannot have Web Blocks magically appear on any Screen at run time. You need to include them design time.

Yes Kilian I know, But I was looking like to implement as Feedback message. Though it is a web block, we are still able to show it on every screen by calling feedback message service action.

Sachin


Hi Sachin,

The Feedback message is actually a combination of a Web Block and an Action. The Web Block is included on every screen (through the Theme), and the Action calls some JavaScript that's included with the Web Block.

Kilian Hekhuis wrote:

Hi Sachin,

The Feedback message is actually a combination of a Web Block and an Action. The Web Block is included on every screen (through the Theme), and the Action calls some JavaScript that's included with the Web Block.

Correct, I have looked at it. I tried to replicate as it is, But unable to do so. That's why I thought to share it on our community.

Sachin

Hi Sachin,

"unable to do so" is too little information to say something about it. What have you tried exactly? What did you run in to? Some errors? Nothing happened? And so and so forth.

Kilian Hekhuis wrote:

Hi Sachin,

"unable to do so" is too little information to say something about it. What have you tried exactly? What did you run in to? Some errors? Nothing happened? And so and so forth.

There wasn't any error,  Simply I created one server action and put runJavascript action with OsNotifyWidget() to call the desire web block through it. When I use that server action to show that web block, Nothing had happened.


Hi Sachin,

"Nothing happened" - you can't see it on the screen? Or the notify isn't received at all? Have you debugged? Looked in the console of your browser for any errors? Etc.?

Hi Sachin,

Did you tried the same way as Feedback message is implemented ? Also Kilian is correct Feedback message is a combination of a webblock which needs to be there in your theme layout so that can be available to each form and one server side action which shows the popup message.


Regards

-PJ-

Pramod Jain wrote:

Hi Sachin,

Did you tried the same way as Feedback message is implemented ? Also Kilian is correct Feedback message is a combination of a webblock which needs to be there in your theme layout so that can be available to each form and one server side action which shows the popup message.


Regards

-PJ-

Yes, I have implemented it same way. But I Didn't checked the console log of browser as Kilian suggested. May be I should give a try again.

Sachin