Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How To Hide The ComboBox of Chat Component

Avatar

Former Community Member

Hi

I had requirement that i don't want the combobox associated with the SimpleChat component and the text "user typing" is there anyway to hide those.?

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Hi,

My advice for your case would be to build your own simpleChat UI with the simpleChatModel we provide and you can have the freedom for doing whatever UI you want. Our SimpleChat example in samepleApps folder builds a chat UI using the SimpleChatModel.

However, if you feel to go the quick fix route, you can simply override the createChildren or other functions in your CustomSimpleChat subclass of SimpleChat and use that to visible/hide any component. You can look at the source code for player 9 in SimpleChat for more details. Its helpful as a reference in many cases even if you are using player 10 swc.

For your specific case, you can do this in your subclass

Override protected function createChildren():void

{

super.createChildren();

if(_toCombo) {

_toCombo.visible = false ; // for making combobox invisible

}

}

Override protected function commitProperties():void

{

super.commitProperties();

if (_typingLabel) {

_typingLabel.visible = false; // for making typing label invisible

}

}

Thanks

Regards

Hironmay Basu

View solution in original post

3 Replies

Avatar

Correct answer by
Former Community Member

Hi,

My advice for your case would be to build your own simpleChat UI with the simpleChatModel we provide and you can have the freedom for doing whatever UI you want. Our SimpleChat example in samepleApps folder builds a chat UI using the SimpleChatModel.

However, if you feel to go the quick fix route, you can simply override the createChildren or other functions in your CustomSimpleChat subclass of SimpleChat and use that to visible/hide any component. You can look at the source code for player 9 in SimpleChat for more details. Its helpful as a reference in many cases even if you are using player 10 swc.

For your specific case, you can do this in your subclass

Override protected function createChildren():void

{

super.createChildren();

if(_toCombo) {

_toCombo.visible = false ; // for making combobox invisible

}

}

Override protected function commitProperties():void

{

super.commitProperties();

if (_typingLabel) {

_typingLabel.visible = false; // for making typing label invisible

}

}

Thanks

Regards

Hironmay Basu

Avatar

Former Community Member

Hi Hironmay Basu,

    Thank You for quick replay.I tried in both ways you mentioned one is simplechatmodel and onther is Overriding the methods.Both are working fine.

Just one more clarification that if we want to chage the userrole to owner generally i used to do send request to my java class there i am changing the user role to owner by using my Developer credentials.I tried to do samething using actionscript but i didn't get any equal method.like in java i am using    the follwing metohds

           accountmanager.getSession(roomname);
          authsession.getAuthenticationToken(secret, studentname, id,100);
     the samething i want using actionscript is there anyway ?

   Thank you once again.

Thanks & Regards

Sudhakar Reddy

Avatar

Former Community Member

Hi Sudhakar,

If you want to change the userRole of someone to Owner, you can use UserManager's setUserRole method with userID of that user and desired role. Note that you need to login as owner credentials to change other's user roles. The API doc will make more clear.

Hope this helps.

Regards

Hironmay Basu

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----