show warning message to user in ASP.NET - asp.net

I have a pop up window that is create in run time, and can have several text area. I need to count number of characters of its text area and show warning to users if they pass maximum number.
the application wrote by ASP.NET. I can't use "onClientClick", because I don't know the name of the text area, they created run time and I save their name in a dictionary that just have in server side.
I tried to use "RegisterStartupScript" to call java script "alert" method but it doesn't work. In fact it works but it execute all the save code and show alert after that. but I want to execute save code after user confirmation.
I think to open message box with jquery but my current windows is opening with AJAX and it won't nice to open another AJAX page.
Can You help me and show me the way to show warning, or solving my problem.

You need to use the onkeypress or onkeyup events in the text area, and use a function like this to show the warning:
onkeypress="checkLength(this, 200);"
And the JavaScript function:
checkLength = function(input, maxLength){
if (input.value.length > maxLength)
alert('Length exceeds maximum');
}

Related

The validation in interactive grid in oracle apex

My problem is that the validation is not working well in interactive grid in my application. I have tried all the possible ways, but nothing is working. The validation works well in the interactive report, but not with the interactive grid.
The problem is that the error message keeps appear even if the data is correct. EX: if the validation condition is "Column is not null", the error message is shown even if I fill the column with data.
..
Another thing, if I made the option of value required on, the same problem appears.
Is their anything to do?
I'm curious about how the validation worked for Interactive Report, anyway here's an example about how to create page validations:
In your Interactive Grid Page, navigate to validations and make sure that editable region and column are set up correctly.
When you run the page, you'll be able to see the error message when column is null. Once the column has a value, it will possible to save the changes.
I'm doing what the solution states, however, the error notification message "1 Error has ocurred" followed by the validation error message doesn't show up, I just get a red frame with an X icon on the field, and when saving, it just shows a notification message "Correct errors before saving". For the validations, The editable region and column are set up correctly, just like on the example image.

Notifying user about his bad input in Shiny app

Let's take a look at one of the demos.
runExample("09_upload")
I am using the supplied file to perform some computations and to display an aggregated performance across all uploaded files. Therefore, I use something like
tryCatch(compute.smth(), error=function(e){})
so that the displayed result is not affected by the bad input. However, I'd like to indicate somehow that uploading the bad file lead to an error, notifying the user about the problem with his input. It'll be something like
tryCatch(compute.smth(), error=badFile())
where badFile() should modify some displayable output. Any ideas?
As a last resort, this is probably an option, but I'd like some native Shiny.
You can show alerts like below with the ShinySky package: https://github.com/AnalytixWare/ShinySky
You can install the package using
install.packages("devtools")#if not alrady installed
devtools::install_github("ShinySky","AnalytixWare")
Place a shinyalert(id) in the ui.R for where you want the alert to appear.
In your server.R
Make sure you have a 3 parameters funciton being passed to shinyServer e.g.shinyServer(function(input, output,session) {
use showshinyalert(id,HTMLText,session) to show the alert. Clicking on the alert will dismiss it.
See this gist for example https://gist.github.com/xiaodaigh/7707701
Run this too see an example
shinysky::run.shinysky.example()

Anguilla - Get the version and user information

I have created a command button on the Ribbon Toolbar. When I select an component an click on "Display Info" button, an popup should open telling me about the latest version of the Component, Modified date, and the User who last modified it.
I do get the component with the following code:
var item = $models.getItem(selection.getItem(0));
How can I get the other information from here.
Part 2:
When I try to see the JS code in Firebug, I see them in one single line. I am unable to put an break point on the execute function within my code.
Any suggestions on the above points. ?
To deminify the JS, to allow you to add breakpoints, and also to allow you to use a JS console to inspect objects that are available, you can follow the instructions at http://code.google.com/p/tridion-2011-power-tools/wiki/DeactivateJSMinifier.
User information can be retrieved using the information at How to get the user Id of the currently logged user in Tridion?
I find that the only way to find anything with Anguilla is to use a JS Console like Chrome's.
Once you get the current item - like you do now - you can do stuff like:
var version = item.getVersion();
var lastModifiedDate = item.getLastModifiedDate();
var lastEditorId = item.getStaticRevisorId();
getStaticRevisorId() gives you the Tridion URI of the last user to change the item, and you can then load this to retrieve further information from it.

Access Front MySql Back Runtime Error 7878

RunTime Error The Data has been changed.
I`m having a difficult time with one of my sub-forms. It used to work without complaints but I guess now it decided to be a little verbose. On this form I have a subform that has a variety of checkbox options. Whenever the user enters a checkbox option and then exits to the main form there is an On Exit Event which runs. It combines some textboxes from various forms and then puts that value in a textbox on the main form.
var1 = [Form1]![Textbox].Value
var2 = [Form2]![Textbox].Value
var3 = [Form3]![Textbox].Value
Me.[TextBox].Value = var1 & var2 & var3
For some reason upon exiting the subform I am getting the Runtime error.
The pattern is not apparent.
I can navigate from the subform to the main form without making any changes in either without receiving an error message.
If I go into the subform, make a change, exit the subform, the textbox will be updated with no complaint, however if I go back into the subform, do not make a change and then go back to the main form, then I get the runtime error
similarly after making sure that behavior 1 is true I can go into the subform, change something come back out, but if I try to go back into the subform and make an additional change I will get a complaint. (I was able to fix this by making an on enter event refresh the subform)
I am unable to get the Runtime Error fixed though... :(
I see that this is an issue for many people with no solution. Here was my work around.
From my observation the form that was having it's Textbox.value updated is somehow silently updated by either the on enter or on exit of it's subform so when the on exit action of updating that textbox occurs it complains that the main form was updated, thus leaving me to conclude that when that form is updated it is not shown to the user.
Thus, my work around is to requery the main form on the subform's exit in order to get that new data loaded and changed.
Caveat!! Requery will by default bring you back to the first record thus presenting the possibility of changing the textbox of the wrong record. Thus as part of the requerying process, if you choose this hack, you will have to bookmark the current open record, requery, and then fetch that record again. I used the code from this webpage in order to achieve the desired effect. Thus circumnavigating the 7878.
Requery and stay on record:
http://www.baldyweb.com/Requery.htm

how to use QTable::editCell()

I don't understand how QTable::editCell() should be used. I am trying to do some error checking based on entries made by user in a QTable as mentioned in my another question.
I would like to give user an opportunity to re-edit the cell which has error. For example, if name column entry has some special characters such as '(', the user should be prompted for the error and the control should go back to same cell in edit mode. I tried using QTable::editCell() in my code as shown below.
Table->editCell(row, 0, TRUE);
name = Table->text(row, 0);
However, this doesn't work as expected. The control doesn't stay in the cell at all and obviously the name is not correctly collected. So, my question is how to ensure from within code that a cell of QTable can be edited so that the edited contents can be accessed immediately in next statement (as shown in above code).
Note: I am working with qt 3.3.8 only.
I don't think you can do that. You'll have to go back to the event loop, and wait for one of the signals (like valueChanged(row,col)) to be fired to re-validate the data.
A blocking wait on a GUI object is often not a good approach (except for modal dialogs).
I know I'm a little late here but you should use the following connect statement with your own custom function to do your specific needs such as below. You can also use this method to disable users from entering in special characters within you custom function. That way they wont ever have to correct undesirable characters.
connect(ui->tableWidget, SIGNAL(cellChanged(int,int)), this, SLOT(customFunction(int,int)));
void updateTable
{
//remove invalid characters
}

Resources