RadFileExplorer Customize alert popup if folder already present - telerik

I am using telerik ASP.Net Ajax RadFileExplorer. When the user tries to add a folder which is already present in the path radfileexplorer displays an alert popup stating "An object with the same name already exists in this directory!".
My question is "Is it possible to display the same content in a radWindow popup instead of an alert box"?

You can: Calling it from client will be:
<button onclick="radconfirm('Client radconfirm: Are you sure?', confirmCallBackFn, 330, 180, null, 'Client RadConfirm', $dialogsDemo.imgUrl); return false;">
This folder already exists, are you sure?
</button>
Check this to have more examples https://demos.telerik.com/aspnet-ajax/window/examples/browserdialogboxes/defaultcs.aspx?show-source=true

Related

Make a button to open the "send files" window of DropzoneJS

I'm currently making a dropzone to upload photos and it working well on Desktop But in mobile, when i click to the zone, sometimes the "Upload from files" window doesn't opening So due to this problem, i'm currently looking to add a button under the dropzone called "Choose photos to upload". This button is suposed open the "Upload from files" Window but i haven't found any help for that in the documentation.
Also on Desktop, when a file is uploaded, the message is disappearing, but i want to make them always visible. There is a specific option or i'm forced to use CSS ?
I know this question is a few months old but saw nobody had answered it yet. It is entirely possible to do both parts of your question.
Video walkthrough of how to add the upload button and force the message to always be visible: https://youtu.be/_CCojUWu2uQ
Working CodePen: https://codepen.io/vpolston/pen/BaxYxNg
HTML
=> Create a parent wrapper div around your dropzone and HTML button element with a given ID.
<div id="dropZone">
<form action="/file-upload" class="dropzone" id="my-great-dropzone"></form>
<button>Add Files...</button>
</div>
JavaScript => Use the clickable property of your Dropzone and give it the value of your wrapper div.
Dropzone.options.myGreatDropzone = {
autoProcessQueue: false,
paramName: "file",
maxFilesize: 2,
clickable: "#dropZone" // the ID of our parent wrapper div
};
And then tackling your second question on making sure the 'Drop files here to upload' message is always visible we must modify the CSS. Default functionality of Dropzone sets the display property of this selector to none..
CSS => My solution was to set it to display: block with !important.
.dropzone.dz-started .dz-message {
display: block !important;
}
Hopefully that helps. If so please mark answered :)

how do I write a ruby watir script for switching to a modal dialog(iframe) of a third party company(payment services)

How do I write a ruby watir script for switching to a modal dialog (iframe) of a third party company (payment services)? I always get element not found error message.
Given this HTML:
<frame id="foo">
link
</frame>
This snippet shows how to method-chain so that the element is found:
b.link(href: "http://www.example.org").exists?
#=> false
b.frame(id: "foo").link(href: "http://www.example.org").exists?
#=> true
If clicking on any element triggers a modal dialog (iframe) where you will have to enter texts in a textbox and click on Save button, then it will be like this-
#browser.iframe(index: 0).text_field(id: 'title').set 'Test Title'
#browser.iframe(index: 0).button(value: 'Save').click

Watir-Webdriver - Unable to locate a button with id, name, text, value

I am very new to web automation and watir-webdriver. i am trying a script to launch a web and submit the login form. I was able to identify the username and password text fields with the 'id' tag. but the login button doesn't have any of the id, name, text and value keys. i have tried looking all the sources, they all have atleast any one key to search the button. but as i am not seeing that in my web application, could someone help me how to search the button and click it.
Here's a portion of the HTML from the page where the button is identified
<jl-button-bar class="margin-bottom centered ng-scope">
<button class="primary full jl-button ng-scope" type="submit" tabindex="0">
<ng-transclude>
<span class="ng-scope">Login</span>
</ng-transclude>
</button>
</jl-button-bar>
It is hard to tell what is unique about the button without seeing the entire page. However, assuming there is only one login button, you can probably do:
browser.button(text: 'Login').click
If the application supports multiple languages, you might not want to use the text. If there is only the login form, you can probably do:
browser.button(type: 'submit').click

ajax return is not displaying in chrome until hover on main menu

I'm experiencing a problem ONLY in Chrome where an Ajax response is not being displayed. Oddly, when I hover over the page's main menu, the response shows up and also stays when I move the mouse away again from the main menu.
Here is a more specific description:
The page contains a search box that allows the user to start typing a contact name. As the user types, an ajax request is made to return a list of suggested contacts. The user can then click on a radio button corresponding to a contact in that list to display all the contact information of that one person. Up to that point everything works fine. But now if the user goes back to the search box to change his search, the previously returned list of contacts goes away, but the new one from the new search does not show up. It is the click on the radio button that causes the following search not to display any ajax responses. The odd thing now is that the response does show up if the user hovers over the main menu at the top of the page (which uses css), and it also stays if the user moves the mouse away again from the menu and everything works fine afterwards. Here is the page structure:
<div id="fixedTopBar">
<?php
include("include/mainMenu.php");
?>
</div>
<div id="pageContent">
<div id="contactListContainer">
<form>
<input id="contactSearchBox" type="text" autocomplete="off" onkeyup="showHint(this.value, 'contactList', null , 'include/ajax/getContacts.php')">
</form>
<div id="contactList">
<form>
<?php
echoAllContacts(getContactsFromDatabase());
?>
</form>
</div>
</div>
<div id="profile"></div>
The ajax request is made with the showHint() function in the id="contactSearchBox" input, and the response is displayed within the id="contactList" div.
So in short, the click on a radio button causes the problem, and hovering over the top menu solves the problem (very strange no?).
Please let me know what other code you need to track down the problem if you have any ideas, or if anything I said did not make sense.
Thanks in advance!
I was able to solve my problem with some css:
The id="contactListContainer" div was positioned: fixed ...once I positioned it absolute, the problem was gone. Now, to actually position it fixed and not have the problem, I also had to add the position:fixed or position:absolute property to the child div id="contactList".

Refresh Captcha Image on JQUERY Dialog

I've a jquery model dialg box below. When user clicks on one of the link on page, the dialog box appears with Captcha. When user enters the invalid captch the captch image should be refreshed and should show new text. But this is not happening. Below is the code snippet:
<div id="model">
<img id="captchaImage" src="#Url.Content("~/CaptchaImage.ashx?text=" + ViewBag.EncryptedCaptcha)" />
<input id="captchText" type="text" value="" />
Validate
</div>
When user clicks on Validate, the text is sent to MVC controller via $.getJSON. The controller returns back isCpatchValid and encryptedText wrapped in JSON object Captcha. I've a done below if
the captcha text is not valid:
$("#captchaImage").attr("src", "~/CaptchaImage.ashx?text=" +
Captcha.encryptedText);
On Chrome debugger I can see the controller is returning a correct encrypted text. But this line above doesn't deem to fresh the captch image. I suspect this is due to async call.
COuld someone please help me with how to refresh the captcha image on Jauery Dialog box.
You can't use the "~" feature in javascript. That's a .NET thing. You'll need to wrap it around a .NET call, like:
attr("src", "#Url.Content("~/CaptchaImage.ashx")?text=" + Captcha.encryptedText)
Or if this JS is in a separate file, you can define a variable back on the view, then use it in the JS file, like:
** in the view **
var CAPTCHA_IMAGE_URL = "#Url.Content("~/CaptchaImage.ashx")";
** in the JS file **
attr("src", CAPTCHA_IMAGE_URL + "?text=" + Captcha.encryptedText)

Resources