Show more/Show less widget disappering when the page is refreshed.
Application Type
Traditional Web
Service Studio Version
11.9.0 (Build 32956)

Hello everyone,

                 I downloaded the moretextsample.oml module that is in this page. Mine is a comments section kind of application so I used Autorefresh component to refresh the page every 10 seconds to update with the latest comment. When it is refreshing the more/less link for the comment is disappearing. Is there any way for it not to disappear even if the screen is refreshed? Please do help!

Before refreshing: 

After refreshing:

Regards,

Vaishnavi

Hello Vaishnavi,


That is intended functionality and more-ever that is the actual/only requirement of that OML. As name suggested show less/more, You can switch to see less or complete sentence by clicking on more/less link. The text is not dis-appearing, it's just hidden with more .

And if you don't want this, just remove this more class from expression, but what will be the use of this component?

Hope it helps!


Sanjay

Hi Sanjay,

                 I understood the module but after the screen is refreshed the "more" link is disappeared. again if I refresh the whole page it is working fine. As I'm using autorefresh component which s refreshing my page every 10 seconds the "more" link is disappearing.


Regards,

Vaishnavi

I tried to reproduce the issue with auto refresh but it is not happening in my case. Can you confirm if you are refreshing the complete page? Using part refresh results to not load JavaScript/HTML again, hence we face this kind of issue.

Hi Sanjay,

                 I'm not refreshing the whole I'm only refreshing a container. Is it because of refreshing only the container? 

Regards,

Vaishnavi.

Yes, Vaishnavi. It is the most probable reason. As I said, part refresh does not submit the complete page, so client side code does not load again. 

If the timer internally usage Ajax, calling MoreText JS with AjaxComplete should work properly, you can change it like below:

$(document).ajaxComplete(function() { 
// Existing code
});

Hi Vaishnavi,

Create a timer and write a logic to refresh whole page and schedule it as per your need.

Regards,
Samiksha.

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