Siebel Dynamic Button - crm

The button in the form applet should have two different names one before pressing the button and one after pressing the button.( Send OTP and after sending it Should change to Verify OTP).

You haven't mentioned which version of Siebel you are using. Your requirement seems to be to change the text on the button control dynamically. Couple of ways to do this. If you are on OpenUI, you can use jQuery to easily change button captions. You will have to write a PM to bind to the InvokeMethod method. This code will be outside the repository.
If you are on high interactivity, you can achieve this via browser script. There are browserscript functions FindControl with which you can change control attributes. This code will go into applet browserscripts, and you need to run genbscipt after compilation.
Hope it helps.

Apart from the above answer, You can also achieve this with Toggle applet as well.
Steps:
Create Toggle applet copying the main applet.Set a flag when Send OTP is successfully submitted from main applet.
Toggle Applet will be displayed now when flag is set. Update the button name to Verify OTP in the Toggle Applet.
For an ideal situation, I would suggest a design change in this requirement. Create 2 buttons Send OTP and Verify OTP in the form applet. Button enable disable logic as per business requirement. I have a similar requirement in my project for Verifying Finger Print.

Related

Adding lightbox (or something similar) to ASP.NET project

I need to implement some, let's call it "dialog" in some old ASP.NET project that I took over. It's huge project so I'm not allowed to implement new things.
I have a form on which user can attach up to 3 file attachments, enter some 10-15 fields, and when required fields are filled, submit button get's enabled.
What need to be done is press submit, wait for any possible response for server, and then display some sort of dialog, alert, lightbox which would display short summary and list of correctly uploaded files.
What would be the best approach to do this in ASP.NET?
Considering jQuery Lightbox is designed for overlaying images rather than HTML I would recommend using FancyBox or FaceBox instead.

How to trigger the Back browser button from a Flex app with deep linking

How can I programmatically click the browser's Back button from within my Flex application.
I'm using deep linking to allow the user to navigate back/forth inside my application. I want this to work when BACKSPACE is clicked inside the application as well, but Flex captures BACKSPACE and the browser doesn't get the event. I don't want to implement browsing history myself within the application, naturally.
Any ideas? Can I send BACKSPACE to the containing browser? Can I specifically invoke "BACK" in the browser from javascript maybe?
you can try a JavaScript/Flex bridge.
write a JS function that sends the browser back, and invoke it from within Flex.
have a look at ExternalInterface

ASP.NET How can I disable re-sending of request to server on refresh?

I am developing a page whereby users can login and demo some pieces of functionality. I only want to allow the user to demo this once per day.
A small example:
I have a web page with 3 buttons (relating to 3 different scenarios). On page load, I look up the database and check if the current logged in user has run any one of the 3 scenarios available (via an audit table). Each button is enabled/disabled based on the results. If any buttons are enabled, then they have not run that demo yet. By clicking the relative button, the demo runs a record is written into the Audit Table, and the button is disabled.
This was working ok, however, I realised that when I refresh the page (and confirm I want to re-submit the information) the demo runs again.
How can I stop this from happening? I need to only allow the user to run the demo once!
Thanks.
I would suggest that you change your form submission to use the Post/Redirect/Get pattern to avoid a resubmission if they hit refresh on the demo page.
Also, it seems like you should just be able to change the code at the point where it writes the record into the audit table to check to see if the record already exists, and if so, return a different result. I'd be pretty wary about this approach though. The "refresh" functionality of the browser isn't generally something you should be trying to prevent. What happens if a user hits "refresh" in the middle of their demo?
you can check not only on the page load to enable/disable the buttons, but on the button events, you can verify if that task has already been performed

Using XMLHttpRequest to display a popup

I am writing an ASP.NET 3.5 web app that displays a list of items. I want to be able to display a non-modal popup with details when the user selects an item. I want to be able to display several detail popups simultaneously. (i.e., the user can click an item to see its details, then click another item to get another popup.) Currently I call RegisterStartupScript during postback to write a "window.open(...)" script to the page when it re-renders. The problem, of course, is that this requires a full page postback and refresh.
It occured to me that this might be a perfect use for XMLHttpRequest or AJAX but I don't know how to do it (or whether it's even possible or smart to do this). Can someone show me the way?
I have the AJAX Extensions installed but I'd prefer not to use the AJAX Control Toolkit.
EDIT:
Some clarification: When the user selects an item a custom event is raised. On the server I handle this event and use some server-side logic to construct a URL which I then use with RegisterStartupScript to construct a "window.open(myUrl...)" script. But posting back the whole page to do this seems inefficient and I'd like to know if I can just make a call to a simple server-side function that constructs the url and sends it back without having to roundtrip the entire page.
Creating a popup has very little to do with AJAX, and a lot more to do with JavaScript. See the jQuery dialog library here. You can then use jQuery's AJAX API to do your server dirty work :)
jQuery Dialog UI
--
Bill Konrad
Devtacular - Web Development Tutorials
You can use DHTML Window widget.
It offers many way to display either modal or non modal window.
Also it supports AJAX.
You can use dhtmlwindow for open a new window, or
dhtmlmodal to open a new modal window.
Of course, you can edit it to match your requirement.
Sample:
var insWindow = dhtmlmodal.open("insbox", "iframe","UserMaster.aspx?" + queryStr, "User Master", "width=425px,height=500,center=1,resize=0,scrolling=1", "recal");
Do you really need to open a new window? Opening an absolutely positioned DIV or a new layer on top of the current page in the same window is all the rage these days.
Edit:
I don't think it would limit the number of popups, there is some neat stuff that can be done these days with libraries like jQuery + jQuery UI, you can simply create as many of these DIVs/layers as you need and make them movable, resizable, etc. Only thing that real popups have and these do not is that they do not appear on the tab panel/taskbar.
Yes, you will be limited to the size of the window in which is the main page opened, however, I don't personally see it as a problem since most people surf in a maximized browser window anyways.
Implementation of the oldschool typical popup window is undoubtedly much easier for you, but it also runs into problems with end user popup blockers. Just had that problem # my work, they needed to make a popup during the certificate authentication process for some reason and as soon as Yahoo released a new version their toolbar, it quit working).

Using Yes/No Messagebox in Updatepanel AJAX

I have a requirement where I ask user for confirmation and also display messages.
The programmers used for this were from Windows forms background. Hence have used the MsgBox in every nook and corner. Even in business logic part they have used the Messageboxes which requires Yes/No style confirmation from user.
When we tested the site from the remote machine we found that it gives error of using DefaultDesktopOnly/ServiceNotification. But when tested we found that this is totally different from what we were looking for.
Now my requirement is a confirmation box is shown from the code like Delete record" yes no and based on the reply we take the action.
This is to be done using updatepanel.
As you use this code in several places, I suggest you make a custom control, that takes your message and displays and Update panel with message and yes/no buttons.
Internally set some value for yes, no, cancel... so that you get something just like MessageBox.
Update panel or not, you'll have to attach some javascript that would call confirm() javascript function. Based on it's result you cancel javascript default link/button behaviour...
This will give you something to scratch your head for a start:
http://www.dotnetfunda.com/tutorials/ajax/updatepanel.aspx
That's not really a question, but a requirement.
Anyway ... MessageBox is a Windows function, it is not an HTML or browser function. Now you can mimic it in one of two ways, via a javascript confirm function or via Yes/No buttons and the appropriate event.
Given that your requirements are for something that works in an update panel I'd guess that wiring up javascript events manually for this isn't going to be something you are comfortable with, so I'd suggest an asp:Panel inside the UpdatePanel which has yes and no buttons, with server side events bound to them. In the UpdatePanel logic show this when you want confirmation and hide everything else, the act accordingly.
If you want to do server-side confirms, you'll get into more complicated code generation. First of all, you'll have two views. The first one has a link/button delete but will actually be just a postback to the second view that will display confirmation form with yes/no. In this form, your yes button will actually be your delete action...
But I'd still chose a hybrid (especially if this is a grid we're talking about) of javascript and serverside (since alert() and confirm() are evil from user experience perspective):
you have a linkbutton delete
when user clicks on it, you replace this control with a div, that displays two linkbuttons yes/no
send a postback with one of the two
Addendum
No linkbutton could be just dummy, to hide this confirmation and display delete again - so it means there won't be any server round trip
you could even create a usercontrol that mimics this sophisticated delete link behaviour to make it reusable application wide.

Resources