How to make file clickable in upload collection? - sapui5

I am doing upload collection component in sap ui5. I want to make file clickable after upload. Previously uploaded files are getting clickable but currently uploaded files are not getting clickable. Please help me to find solution.
Below is my XML code :

You have not set the mode for the Upload list, by default this is set to None. Add a mode parameter in you List as below. This will make the List clickable.
mode="SingleSelectMaster"
Reference:
https://sapui5.netweaver.ondemand.com/#docs/api/symbols/sap.m.UploadCollection.html#getMode
https://sapui5.netweaver.ondemand.com/#docs/api/symbols/sap.m.ListMode.html

Related

Manage image deletion in a WYSIWYG editor

When an HTML editor is used and images are added from the local computer, they are uploaded to a server and a link is obtained to put it in the image src attribute. What happens when the img element is removed from the editor? How would the image be deleted from the server? In this case I understand that the image deletion event could be detected and then call a service to delete it. But what happens if the user adds a new image and leaves the page? How would it be deleted in these cases?
In both cases, if the deletion of the images is not managed, it could happen that the server is filled with unused images. How do you usually solve this problem? How is the proper way to solve this?
That's a nice question there. And yeah, for sure the server would fill up with unused images in some point. I'm not an expert on this but I'll try to suggest something so I can implement it too in my WYSIWYG editor haha. I suppose you have a custom modal for the insertion of the image. Upon clicking the button you could save the image link to an array and at SAVE || on leaving the document edit || on popstate event you could make a regex that checks the innerHTML of the editor for the specific SRC. If is not found then you could push an ajax request with the image name so you can deleteit. For sure there are more efficient and complex ways to achieve that. Such as creating text ranges and track elements on keydown - Backspace(8) / Deletekey(46).
An other way is that you could track the images that are in use. When the document is saved regex out the images in the document, push them to a db table and periodically make a check from the back end so you can delete those that are not in use.
I don't know if my suggestions are helpful or not. I just saw an interesting subject so I jumped in. Cheers mate.

How to add images in Protege

How can I describe class instances with images (e.g. abc.png) and display them inside Protege 5.2.0? I have read the tutorial which uses widgets, but the Forms tab is no longer available in current version of Protege-Owl.
There is a project which intends to provide such ontology : Schema.org.
It is also possible to fully describe a picture thank to the use a of metadata ontology (ISO, ...).
schema:image annotation property may provide what you intend to do.
For annotation values that are URLs that point to images, Protégé displays thumbnails of the images.
More info: https://github.com/protegeproject/protege/issues/315.
Update
You should add the schema:image annotation property (or another suitable annotation property) first:
You can add pictures both for classes and instances.
Be aware until this moment you only can add picture from the web.
I'm going to show you how to add a picture for a class.
First go to Annotation tab and click on + button:
A window will be opened. At this window, you should add schema:image as an annotation property:
After adding schema:image, go to IRI Editor tab at the same window and paste the picture URL into the box (for copying the picture URL, right-click on the image on the web and then click on copy image address):
By clicking on OK you can see the thumbnail of the picture:
Now if you click on this thumbnail, the full image will be opened in a new tab in your browser and you can see it in full size.

How to take screenshot of each link clicked in Selenium IDE

I want to click links in a webpage by storing it in array and click this links one after another and take entire screenshot of each and every link after clicked,and all this i have to do only in SELENIUM IDE...how to do that??
I know up to save links in array and clicking links, but failed to capture screenshot of each page after clicking..because it is taking only one screenshot and overwriting that screenshot when second link clicked..
Maybe the reason why your screenshots are being overwritten is because you have a consistent image file name for them. Try something like this:
Command:
captureEntirePageScreenshotAndWait;
Target:
C:\\<Directory>\\different-filename-for-screenshot.png
and so on and so forth...
If you have very less screens to capture then you can simply capture them in different file names. Please refer example below.
LessScreenshot IDE Script
LessScreenshot Files stored
If you have more screens to capture then you can read the file locations and names from CSV file. For more information about loop and readCSV, please refer this link. In the example below, I have capture 7 clicks screenshots.
Input_CSV_File
IDE_Script_Loop&ReadCSV
Screenshot captured

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.

Single Product Image not showing

I have added multiple products in my zen cart store. The problem is when i click on a specific product, the image wont show. It remains blank.
http://www.fmchase.com/
Above is the url of the site. When we go to a single product, i image of that product is not displayed, though it is displayed on the category.
The image it's looking for doesn't exist.
e.g http://www.fmchase.com/images/large/Aquafresh%20little%20Teeth%20toothbrush_LRG.jpg
returns a 404 (not found) error.
edit: The category page is using a different image http://www.fmchase.com/images/Aquafresh%20little%20Teeth%20toothbrush.jpg
The problem is in your new template. Go to includes/templates/your_template/templates/tpl_modules_main_product_image.php and change all variables matching $products_image_medium to $products_image
This should fix your problem.
I removed
Content-Security-Policy module from .htaccess
and I got my listing images back