Expand my Community achievements bar.

SOLVED

Issue with wcmmode=disabled

Avatar

Level 3

Hi community,

 

I've created a button component to send email, and when i tried to test it in "view as published" mode, first i got this url and the image below.Seems like everything is ok at this moment.

URL:localhost:4502/content/training/us/test.html?wcmmode=disabled

zonghuiliu_0-1668762933629.png

And when i clicked the button, nothings happened and the url changed to the one below and the email was not sent. Also at header part a context hub appeared and below the button some empty space appeared.

Then if i click the button again it finally sends the email.

URL:localhost:4502/content/training/us/test.html?

zonghuiliu_1-1668763051963.png

I have no reason why the button did not work at the first time i clicked it, also have no idea why this context hub and empty space appeared.

Prefer some help!

Thanks in advance!

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

I think then there is a conflict due to markeup.

you can change button markup and try.



Arun Patidar

View solution in original post

5 Replies

Avatar

Community Advisor

Hi,

Can you try to change button/link markup (id, class), there is a possibility that the another javascript event listener is acting on buttons first click.



Arun Patidar

Avatar

Level 3

Hi!

 

Thank you for your help.

Below is my created html file.

I didn't use id and class so i don't know what is the problem.

I use ajax call to invoke my created servlet.And I wonder is this way ok to be used?

 

html file:

<form>  
    <input type="submit" value="sendemail" onclick="sendemail()"/>  
 </form>
 
 <script>
     function sendemail() {
        $.ajax({    
        type : "GET",    
            url : '/bin/sendemail'  
            });
     }
 </script>

Avatar

Community Advisor

Can you please check page's source, if you can see the above code rendered or not?

check the console error as well when you click first time on button.

 

You can also change the code 

<button type="button" onclick="sendemail()">sendemail</button>
 <script>
     function sendemail() {
        $.ajax({    
        type : "GET",    
            url : '/bin/sendemail'  
            });
     }
 </script>

 

 



Arun Patidar

Avatar

Level 3

I've checked the page's source and the code is rendered.

And after i clicked the button first time, the error message is like this.

 

com.adobe.cq.msm.ui.servlet.IsSourceRenderCondition path /content/training/us/en.html to check render condition is not valid

 

 

Avatar

Correct answer by
Community Advisor

I think then there is a conflict due to markeup.

you can change button markup and try.



Arun Patidar