AEM component not displayed on Preview Mode - aem

I have developed a few components for AEM but I just ran into an issue. One of the components I created is not displaying when I append the wcmmode=disabled flag. It works great on edit mode but once I pass the flag the component and contents are gone, this is the first time that this happens.
If it helps the component that I created is an extension of the column control component from AEM and it automatically adds children to it.
URL example in Edit Mode:
http://localhost:4502/cf#/content/location/file.html
URL example with WCMMODE flag set to disabled:
http://localhost:4502/content/location/url.html?wcmmode=disabled

$('#ContentWrapper').resize() / $(document).resize();
Try this code in your JS file. Once document ready, resize method will get updated component invisible portion.

I was using Column Control (sightly version) as a guide and figured out that the following code was what was causing the issue:
if (typeof wcmmode != "undefined" && wcmmode.isEdit())
Thank you for helping me debug this issue.

I guess it is the CSS issue . Can you inspect element &check .some times "float:left,right" cause this issue .

Related

Get screen size in EJS

I'm working in an EJS template and I need to determine the screen size. I'm using Grunt & Browserfy to compile (apologies if this is the wrong terminology). Using window.screen.width or window.matchMedia returns an error that window is not defined. What would be the best way to access this information?
Answering my own question: I understand now that EJS is rendered on the server so there is no screen to reference. I ended up using Javascript to accomplish what I needed since it's rendered in the browser. It's messier than I wanted but works nonetheless.
Try just using screen.width without the "window" in front.

How to fix codemirror not loaded correct?

I am using codemirror and sometime when I run my project the codemirror not loadedd fine and not allow to me to write on it ....
in picture above I color yellow number codemirror display (I did not knew why display this numbers and why did not allow to me to write on it )
the first time the problem appare I solved it by call (editor.refresh();)
But now the call of (editor.refresh();) not solved my problem ... I did not knew if the problem from codemirror or from tomac server or from eclipse ...please any help ?

Items in Plones TinyMCE content browser are overlayed in album view - how to tackle this?

I do not know if this is a bug or rather stems from any customizations. I would like to know how to tackle this problem:
If I click on "add image" or "Link" in Plone's "Content Browser" the default view mode is "Album". In this mode the items are layed above each other, i.e. after 4 items the next items do not seem to be put into a new column.
See the screenshot:
Plone version is 4.3.2. How can I fix this? Pointers (relevant files, parts of code) welcome.
I have seen this happen too, depending on what I did with styling and skins. TinyMCE uses a grid system for showing these images and this needs the columns.css file from plonetheme.sunburst. I only now realize that this actually already goes wrong in the way you describe when you use standard Plone 4.3.2 and choose the classic theme as skin.
Ah, but it only fails because there is a typo in the columns.css that is shipped with plonetheme.classic, which actually includes the grid css as well. You can customize this file in portal_skins and fix the error. The problem is a line that is meant as a comment.
Change this line:
The 16-column Deco Grid System.
into this line:
/* The 16-column Deco Grid System.

File Upload not working after moving form field

I have a large form with a image upload field working ok.
Field is defined in model as:
$this->add('filestore/Field_Image','thumbnail_id');
Then I created two tabs inside form:
$tabs=$form->add('Tabs');
$main=$tabs->addTab('General');
$design=$tabs->addTab('Design');
And moved image field to design tab:
$design->add($form->getElement('thumbnail_id'));
Now I can't upload files. When I try I get the following javascript error
Error: cannot call methods on atk4_form prior to initialization; attempted to call method 'submitPlain
Is there any other way to move the field or have upload working again after moving it?
I was trying to use the same method ($design->add($form->getElement('my_element'));) to move a slider into another place on the page. That didn't work - I think it was because the slider input field is not placed on the page the same way as other input fields.
So I tried with the jQuery appendTo-method (I found the hint in a comment from romanish in a documentation page). That worked. But then I experienced the same problem as you - and in the end I gave up and solved the problem by editing the slider-class page.
So I can't help you, sorry, but I guess this points out that there is a general problem related to getting input from moved form elements.

TinyMCE: Contenteditable - Paste plugin not working

I have a block of text with some of its regions editable via contentEditable property. I am using Paste plugin's paste_preprocess to cleanup the text before pasting it. But when I try it get the o.centent (the clipboard data) it returns empty.
But when I try to do the same with a completely editable section, it works fine.
Any clue?
Thanks,
Imran
Although, it has been fixed. I invite seniors to please comment on the workaround I used to make it running. Please follow the link below:
http://tinymce.moxiecode.com/forum/viewtopic.php?pid=84335#p84335