Expand my Community achievements bar.

SOLVED

rtc:Note toolbar out of position

Avatar

Level 2
I put up a simple collaboration example using a chat, wb,
roster and note pods. When the user focuses on the note pod, a
toolbar related to notes surfaces right over the chat component
entry box. Not only is this out of the bounds of the note pod, but
it obscures further chat submissions. The y-value is correct but
the x value is 0. Example here:



[link removed since issue has been resolved]



I also get related runtime-errors issued by the note pod -
shown below



TypeError: Error #2007: Parameter child must be non-null.

at flash.display::DisplayObjectContainer/contains()

at com.adobe.rtc.pods::Note/hideToolBar()

at com.adobe.rtc.pods::Note/onEditorToolBarTimerComplete()

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at flash.utils::Timer/tick()



What can I do to correctly position this toolbar and avoid
the RT errors ?



Thanks,

Will



1 Accepted Solution

Avatar

Correct answer by
Former Community Member
Hi,

You need to override the sizeAndPositionContainer container
in ProgressiveDisclosureContainer . That is in
com.adobe.rtc.controls. This will help in solving the position
problem

Here is the updated FUnction



/**

* @private

*/

public function
sizeAndPositionContainer(p_evt:Event=null):void

{



var topStyle:Number = (getStyle("top")==undefined) ? -1 :
getStyle("top");

var bottomStyle:Number = (getStyle("bottom")==undefined) ?
-1 : getStyle("bottom");

var leftStyle:Number = (getStyle("left")==undefined) ? -1 :
getStyle("left");

var rightStyle:Number = (getStyle("right")==undefined) ? -1
: getStyle("right");





var originalPt:Point = new Point();



_subContainer.cacheAsBitmap = false;



if (topStyle!=-1) {

originalPt.y = topStyle;

if (bottomStyle!=-1) {

// need to stretch

_subContainer.height = target.height - topStyle -
bottomStyle;

}

} else if (bottomStyle!=-1) {

// TODO : nigel : normalize height against owner

originalPt.y = target.y + target.height -
_subContainer.height - bottomStyle;

} else {

originalPt.y = target.y + (target.height -
_subContainer.height)/2;

}





if (leftStyle!=-1) {

originalPt.x = leftStyle;

if (rightStyle!=-1) {

// need to stretch

_subContainer.width = target.width - leftStyle - rightStyle;

}

} else if (rightStyle!=-1) {

// TODO : nigel : normalize width against owner

originalPt.x = target.x + target.width - _subContainer.width
- rightStyle;

} else {

//originalPt.x = target.x + (target.width -
_subContainer.width)/2;

originalPt.x = target.x ;

}





var ownerPt:Point = target.parent.localToGlobal(originalPt);

var _subContainerPt:Point =
_subContainer.parent.globalToLocal(ownerPt);

_subContainer.move(originalPt.x, _subContainerPt.y);

if (bitmapOverlay) {

// bitmapOverlay.x = _subContainerPt.x;

// bitmapOverlay.y = _subContainerPt.y;

}

}





And you need to also override the HideToolBar function, that
will fix the RTE. Here is the updated function

/**

* @private

*/

protected function hideToolBar():void

{

if (!_model.isSynchronized) {

return; //just in case

}



//focusEnabled = false;

if(focusManager)

{

if ( focusManager.getFocus() != null &&
contains(DisplayObject(focusManager.getFocus())) ) {

setFocus();

}

}



if (_editorToolBar &&_editorToolBarTimer &&
_editorToolBarTimer.running == true) {

_editorToolBarTimer.reset();

_editorToolBarTimer.stop();

}



if (_toolbarContainer) {

_toolbarContainer.undisclose();

}



_iAmEditing = false;



if(_model.getUserRole(_userManager.myUserID) <
UserRoles.PUBLISHER) {

return;

}



//setUpFromModel(); //catch up with everyone else

//remove updateScrollPosition when hiding the toolbar,

//so we don't always drag scroll bar to the bottom

if (_noteUndoRedo) {

_noteUndoRedo.startingText = _model.htmlText;

}

updateEditorTextFromModel();

//updateScrollPositionFromModel();

onEditingListUpdate();

}





I will say if you are linking to the source path in project
properties , just make these changes in the actual Note and
ProgressiveDisclosureConatainer itself and you should be fine.



Hope this helps.



Thanks

Hironmay Basu

View solution in original post

4 Replies

Avatar

Former Community Member
Hi,



Thanks for reporting. I could reproduce by going to your
example. I will run it locally and update the fix.

Thanks

Hironmay Basu

Avatar

Former Community Member
Hi,



This issue has been fixed and will be updated in the next
drop of afcs.

Let me know if you want it now. Then you might have to
override couple of functions in Note and
ProgressiveDisclosureContainer class.

Thanks again for reporting.





Thanks

Hironmay Basu

Avatar

Level 2
Yes please. Could you post the relevant over-rides on this
forum so that others can also implement them too before the next
afcs drop?



Thanks for being so responsive. Cheers,



Will

Avatar

Correct answer by
Former Community Member
Hi,

You need to override the sizeAndPositionContainer container
in ProgressiveDisclosureContainer . That is in
com.adobe.rtc.controls. This will help in solving the position
problem

Here is the updated FUnction



/**

* @private

*/

public function
sizeAndPositionContainer(p_evt:Event=null):void

{



var topStyle:Number = (getStyle("top")==undefined) ? -1 :
getStyle("top");

var bottomStyle:Number = (getStyle("bottom")==undefined) ?
-1 : getStyle("bottom");

var leftStyle:Number = (getStyle("left")==undefined) ? -1 :
getStyle("left");

var rightStyle:Number = (getStyle("right")==undefined) ? -1
: getStyle("right");





var originalPt:Point = new Point();



_subContainer.cacheAsBitmap = false;



if (topStyle!=-1) {

originalPt.y = topStyle;

if (bottomStyle!=-1) {

// need to stretch

_subContainer.height = target.height - topStyle -
bottomStyle;

}

} else if (bottomStyle!=-1) {

// TODO : nigel : normalize height against owner

originalPt.y = target.y + target.height -
_subContainer.height - bottomStyle;

} else {

originalPt.y = target.y + (target.height -
_subContainer.height)/2;

}





if (leftStyle!=-1) {

originalPt.x = leftStyle;

if (rightStyle!=-1) {

// need to stretch

_subContainer.width = target.width - leftStyle - rightStyle;

}

} else if (rightStyle!=-1) {

// TODO : nigel : normalize width against owner

originalPt.x = target.x + target.width - _subContainer.width
- rightStyle;

} else {

//originalPt.x = target.x + (target.width -
_subContainer.width)/2;

originalPt.x = target.x ;

}





var ownerPt:Point = target.parent.localToGlobal(originalPt);

var _subContainerPt:Point =
_subContainer.parent.globalToLocal(ownerPt);

_subContainer.move(originalPt.x, _subContainerPt.y);

if (bitmapOverlay) {

// bitmapOverlay.x = _subContainerPt.x;

// bitmapOverlay.y = _subContainerPt.y;

}

}





And you need to also override the HideToolBar function, that
will fix the RTE. Here is the updated function

/**

* @private

*/

protected function hideToolBar():void

{

if (!_model.isSynchronized) {

return; //just in case

}



//focusEnabled = false;

if(focusManager)

{

if ( focusManager.getFocus() != null &&
contains(DisplayObject(focusManager.getFocus())) ) {

setFocus();

}

}



if (_editorToolBar &&_editorToolBarTimer &&
_editorToolBarTimer.running == true) {

_editorToolBarTimer.reset();

_editorToolBarTimer.stop();

}



if (_toolbarContainer) {

_toolbarContainer.undisclose();

}



_iAmEditing = false;



if(_model.getUserRole(_userManager.myUserID) <
UserRoles.PUBLISHER) {

return;

}



//setUpFromModel(); //catch up with everyone else

//remove updateScrollPosition when hiding the toolbar,

//so we don't always drag scroll bar to the bottom

if (_noteUndoRedo) {

_noteUndoRedo.startingText = _model.htmlText;

}

updateEditorTextFromModel();

//updateScrollPositionFromModel();

onEditingListUpdate();

}





I will say if you are linking to the source path in project
properties , just make these changes in the actual Note and
ProgressiveDisclosureConatainer itself and you should be fine.



Hope this helps.



Thanks

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] ----