Help with Conditional Display and Validation
Version 4.1.1.00.23
Hello,
I'm having a difficult time with a conditional display and validation I'm hoping someone can help with.
Requirements:
When the Start Date (Datepicker) and/or End Date (Datepicker) change then display the Change Reason (Select List) and Change Description (Textbox)
If the page is saved without entering a Change Reason display a validation error message that the Change Reason cannot be empty (NULL)
What I've tried
Create a Dynamic Action on the Start Date
Event: Change
Selection Type:Item(s)
Items(s): P51_START_DATE
Condition: none
True Action Section:
Action: Show
Fire on Page Load: Checked
Show all page items on the same line: No
Affected Items Section:
Selection Type:Item(s)
Item(s): P51_CHANGE_REASON,P51_CHANGE_DESC
I've also created a Dynamic Action with similar settings for the P51_END_DATE.
I created a Validation for the P51_CHANGE_REASON as Function Returning Error Text:
DECLARE
v_start_date work_items.start_date%TYPE;
v_end_date work_items.end_date%TYPE;
BEGIN
SELECT start_date
,end_date
INTO v_start_date
,v_end_date
FROM work_items
WHERE work_items_id = :P51_WORK_ITEMS_ID;
IF ( (v_start_date != TO_DATE(:P51_START_DATE,'DD-MON-YYYY') OR v_end_date != TO_DATE(:P51_END_DATE,'DD-MON-YYYY') ) AND
:P51_CHANGE_REASON IS NULL ) THEN
RETURN 'Change Reason must have a value';
END IF;
END;
The Issue
I tried to create another Dynamic Action to hide the P51_CHANGE_REASON and P51_CHANGE_DESC fields on page load, but when either of the date fields are changed and the validation is fired the P51_CHANGE_REASON and P51_CHANGE_DESC are hidden again.
There are two buttons to submit the page: 'SAVE' will submit the page and stay on the page and 'SAVE_CHANGES' will submit the page and branch to the previous page (which is a report with EDIT buttons to edit the record).
I can't get the page load Dynamic Action to NOT fire when the validation is fired.
I hope this is clear and if not what information can I provide?
Thanks,
Joe
Phil,
Thank you for looking at this.
Yes if the Change Reason is NULL when the edit page is displayed then the Change Reason and Change Description fields are hidden. If the Start Date (Datepicker) and/or End Date (Datepicker) change then display the Change Reason (Select List) and Change Description (Textbox). If the page is saved without entering a Change Reason display a validation error message that the Change Reason cannot be empty (NULL).
The problem I'm having is that if no Change Reason is entered and the page is saved thereby firing the validation the Change Reason and Change Description fields are hidden again (because of the On-Load Dynamic Action to hide them). So now the user can't put in a Change Reason...unless they change one of the date fields again which isn't going to be accepted.
Is there a way to determine if a validation error was fired and be able to use that on the On-Load Dynamic Action to hide the two fields? Something like...If the validation fired then don't run?
Please let me know if I'm still confusing you.
Thanks,
Joe
Similar Messages
-
Problems with Conditional Display and Read Only
Hi Everybody,
I have a form to Add/ Modify Table Info.
I have column which stores numeric value (like no. of purchases, no.of returns etc.,) and I have a text field with this Database column as Source.
In some cases the value is a foreign key (Id of the Owner, Buyer etc.,) to another table. In such cases, I want to display a select list containing people information. Is that possible?
This is what I did to achieve that
I added a select list with info from second Table. Made both the text field and the select list to conditional display and conditional read only.
My understanding is that When an item is made read only it should not be saved to the Database.
But while Updating I am getting the following Error
ORA-06550: line 1, column 130: PL/SQL: ORA-00957: duplicate column name ORA-06550: line 1, column 7: PL/SQL: SQL Statement ignored.
Any can anybody help me out on this?
Thanks
NimmiMy understanding is that When an item is made read only it should not be saved to the Database
No, all page items with a Source Type of "Database Column" will be used by the Automatic DML process to insert/update the database. Form inputs with the "disabled" HTML attribute set are not POSTed to the server.
Try to create 2 items, one Select List and other Text Field but setup their conditions such that only one of them is rendered on the page at any given time. That might work. -
Need help with conditional display
I found a older thread (704012) that explains how to conditionally display a link using style. Which is what I want to do. The part I'm having trouble with is that part of the instructions say to put
class="row_has_values_#HAS_VALUES#"
in the Link Attributes which I have done. I also have a column in the report called HAS_VALUES and I'm properly populating it in my select. I know because I left it displayed while I'm testing. I can run the report and I have Y's and N's showing up in that column but the conditional part does not work. When I look at the page source (below) I see that in the html the #HAS_VALUES# has not been replaced by the actual Y or N. I think that's where I'm having trouble? I think it might work if there was a Y or N in that but I don't understand why that didn't happen.
<tr class="odd"><td headers="LINK"><a href="f?p=125:3:12628966088981::NO::P3_PROGRAM_KEY:2" class="row_has_values_#HAS_VALUES#"><img src="/i/e2.gif" border="0"></a></td><td align="left"LawrenceJ wrote:
I've continued to snoop around and see lots of posts on conditional display in reports. Common desire I guess. I saw some stuff that I interpreted to suggest that what I'm trying to do may not work in interactive reports, only in classic reports. Does that sound familiar?
That would certainly apply to anything template-related. However there have been enhancements to IRs (like adding HTML Expressions) that might supersede information in older posts. If you provide a link to the sources you've found and the APEX version you're using someone will be able to confirm whether that information is relevant.
Many other posts on doing things conditionally in reports seemed to lean towards "selecting" the html based on data values and then just letting that get put in the report column. That looks promising but sure is a bit ugly. I've very little apex experience but lots of mod pl/sql and that sort of solution was pretty common when I did stuff with it. I saw a little suggesting using templates as a solution but I'll confess to not understanding it at all.
As I pointed out in the original thread, if the conditional display of the link is in any way security related then CSS or JS/jQuery methods are not acceptable. If the user is not supposed to be able to click the link or see any data contained in it, then you have to use a method that ensures that the link element never reaches the browser.
Hard-coding the link HTML in the report query is the common approach, but is as you say a bit ugly. Using a custom report template (my favourite APEX subject) enables clean separation of the report query, conditional logic and HTML structure. If you know HTML then you're advised to get familiar with using templates in APEX. You'll find this a major advance on the PL/SQL web toolkit. What is it that you're not understanding about using templates? -
Help with simple display and add in ADF/Struts app
I created a simple ADF/Struts application based on the HR schema. I have a department view object and entity object based on the Departments table. From the Struts page flow designer, I create a data page action (viewDepartments) that binded to a departments view object by dragging the departments view object as a "Read-Only" form from the palette with the navigation buttons --- this page will just display the departments. Next, I created another data page action (addDepartments) that allows a user to add a department. I did this by dragging the departments view object from the palette as an "Input Form" and then dragging the "Create" operation onto the data page action. Each data page action has its own JSP of course.
I'm noticing that every time when I go to to the "addDepartments.do" and then go to "viewDepartments.do", a blank record is added to the view object. Why is this? Also, I want the Submit button to do the "save and commit" in one step. How do I do that?
If it helps, I can email anybody the workspace file so that you can see this behavior.
Thanks.Try following this step by step tutorial to see if it will make things better for you.
http://otn.oracle.com/obe/obe9051jdev/adftojsp/defaultendtoend.htm#t3 -
Help with conditional Spry Form Validation
Hi,
I am creating some validation for this form and need some help.
Need to require a finish to be selected if a qty is selected and visa versa.
I have got this part working but can't get it to destroy the validation if the qty/finish is added and then removed.
Here is the code for just the 2 fields:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Deleting and rebuilding validations</title>
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<script src="SpryAssets/SpryValidationSelect.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationSelect.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
// build validations and delete / destroy them
function val(e){
// get the value
value = e.value;
//check if value is greater than 0
if (value>= 1 ){
// if it is then turn on validation
var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", "none", {isRequired:true});
return true;
function val2(e){
value = e.value;
if (value= "" ){
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "integer", {isRequired:false});
else { var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "integer", {isRequired:true}); }
return true;
</script>
</head>
<body>
<form id="form1" method="post" action="#">
<p><span id="spryselect1">finish:
<select name="finish" id="finish" onclick="val2(this);" >
<option>please select</option>
<option value="6, Antique Wiluna White">Antique Wiluna White</option>
<option value="12, Antique Wiluna White Gloss">Antique Wiluna White Gloss</option>
<option value="2, Charred Oak">Charred Oak</option>
<option value="10, Charred Oak Gloss">Charred Oak Gloss</option>
<option value="5, Gentle Beige">Gentle Beige</option>
<option value="1, Refined Oak">Refined Oak</option>
<option value="9, Refined Oak Gloss">Refined Oak Gloss</option>
<option value="4, Rocksalt">Rocksalt</option>
<option value="7, Snowdrift">Snowdrift</option>
<option value="13, Snowdrift Gloss">Snowdrift Gloss</option>
<option value="3, Vicenza Walnut">Vicenza Walnut</option>
<option value="11, Vicenza Walnut Gloss">Vicenza Walnut Gloss</option>
<option value="14, 2 Pack Gloss White">2 Pack Gloss White</option>
</select>
qty:
</span><span id="sprytextfield1">
<input type="text" name="qty" id="qty" onblur="val(this);" />
</span>
<input type="submit" value="Submit" />
</p>
</form>
<script type="text/javascript">
var sprytextfield1, spryselect1;
</script>
</body>
</html>
Also is there a shortcut so this doesn't have to be repeated for all 80 or so fields?
CheersI am very busy at the moment with having a few projects on hand. Maybe the following example will help you. If not, please come back here.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Deleting and rebuilding validations</title>
<link href="http://labs.adobe.com/technologies/spry/widgets/textfieldvalidation/SpryValidationTextFiel d.css" rel="stylesheet">
</head>
<body>
<form id="form1" method="post" action="#">
<p>
<input type="radio" name="radio" id="Married" value="Married" onclick="val(this);">
<label for="Married">Married</label>
</p>
<p>
<input type="radio" name="radio" id="Defacto" value="Defacto" onclick="val(this);">
<label for="Defacto">Defacto</label>
</p>
<p>
<input type="radio" name="radio" id="Single" value="Single" onclick="val(this);">
<label for="radio">Single</label>
</p>
<hr>
<span id="sprytextfield1">
<label for="f_married">Married</label>
<input name="married" id="f_married" type="text" value="">
<span class="textfieldRequiredMsg">A value is required.</span>
</span>
<span id="sprytextfield2">
<label for="f_defacto">Defacto</label>
<input name="defacto" id="f_defacto" type="text" value="">
<span class="textfieldRequiredMsg">A value is required.</span>
</span>
<span id="sprytextfield3">
<label for="f_single">Single</label>
<input name="single" id="f_single" type="text" value="">
<span class="textfieldRequiredMsg">A value is required.</span>
</span>
<hr>
<input type="submit" value="Submit" />
</form>
<script src="http://labs.adobe.com/technologies/spry/includes_minified/SpryValidationTextField.js"></script>
<script>
var sprytextfield1,
sprytextfield2,
sprytextfield3;
// build validations and delete / destroy them
function val(e){
// get the value
value = e.value;
// see what radion button we have
if(value == "Married"){
// if there inst a validaton build one
if(!sprytextfield1){
sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
// if there is a validaiton in sprytextfield destory it, and clear the variable
if(sprytextfield2 && sprytextfield2.destroy){
sprytextfield2.resetClasses();
sprytextfield2.destroy();
sprytextfield2 = null;
// same as the rest
if(sprytextfield3 && sprytextfield3.destroy){
sprytextfield3.resetClasses();
sprytextfield3.destroy();
sprytextfield3 = null;
} else if(value == 'Defacto'){
if(!sprytextfield2){
sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
if(sprytextfield1 && sprytextfield1.destroy){
sprytextfield1.resetClasses();
sprytextfield1.destroy();
sprytextfield1 = null;
if(sprytextfield3 && sprytextfield3.destroy){
sprytextfield3.resetClasses();
sprytextfield3.destroy();
sprytextfield3 = null;
} else if(value == 'Single'){
if(!sprytextfield3){
sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3");
if(sprytextfield1 && sprytextfield1.destroy){
sprytextfield1.resetClasses();
sprytextfield1.destroy();
sprytextfield1 = null;
if(sprytextfield2 && sprytextfield2.destroy){
sprytextfield2.resetClasses();
sprytextfield2.destroy();
sprytextfield2 = null;
// proceed with the rest as normal
return true;
</script>
</body>
</html>
Gramps
Carn the Pies -
Help with Spry form and Validation
We have a form with shipping and billing information. When
you fill out the billing and select same as billing radio button.
Then it fills out the shipping fields properly using focus to make
sure the spry validation recognizes the input. Everything on the
form appears to be valid in Firefox Windows and Mac and Safari but
the submit button does not work. Before we started we go the
shipping fields to populate with the billing data the form
submitted fine.
On IE 7 the 1st Zip code fields shows the error messages and
then only some of the hints show up in the spry validate fields
below. This is only on IE. When you populate the shipping section
in IE with the radio button in fills in everything but that
shipping zip again on IE only. You actually have to manually type
in the zip.
Is this IE bug related to the form not submitting in the
other browsers?
I don't understand why the form in all the other browsers
appears to have all fields validate but will not submit.
I bet between three of us we have 60 hours in the stupid form
and 2/3rds of it is not billable.
On the other hand we need to finish this today!!. We will all
be around at about 3 on Sunday. I am happy to pay someone to look
at this and help us get through this last step.
I wish there was some debug tool we could use to see what is
going on. I look at the debug.js file in 6 in the meantime. I can
be reached at 610-256-2843 and best email is [email protected]
Help!!
You can see all the by going to
http://vv.dss-demo.com/
then add something to your cart and go to checkout. you will
get the form.Florin,
Thanks for the response. We were looking for a way to remove
the hints but did not see anything in the documentation.
But I am still having issues.
A. Not sure how you are not seeing the text "Zip is
required.Invalid format." in the grey area next to zip
code fields. It is there on IE 6 and 7 4 different users with
different computers see it.
B. As soon as I add you code you suggested and comment out
what we had it throws and error in IE and the debug says it is at
the 1st instance of your method sprytextfield20.removeHint();
Object does not support method.
C. A new problem we did not notice last night on all browsers
is that the form now does not respect the spry validations. It
submits no matter what. I am using this to submit the form.
<input name="submit"
id="submit" type="image"
src="images/complete_checkout.png"
onclick="document.forms['checkout_signup'].action='<@appfilepath>checkout_sign up.taf?_function=signup';document.forms['checkout_signup'].submit();"
/>. We for sure don't want. It seems to have occured once we
added the document.forms['checkout_signup'].submit(); in the 1st
place but that without that the form would not submit even when
everything appeared to be validated. So was adding
document.forms['checkout_signup'].submit(); =seems to have just
covered up another issue that is keeping the form from submitting.
I still would like to have someone really look at this form
with me and pay them if I have to. But it really does not seem that
the path we are talking really works.
I am going to roll this back to where it was till I can get
some help.
my guess at this point
Hints have to go because if we fill down with fields that
have hints then the hints become the values and are submitted. And
it also breaks the spry validation.
I would hope that the way we are rebuilding the zip and state
fields would be possible with spry. It sure looks like it works. My
hope is it is not causing the submit to not work.
Anyway I still need help from someone who would be willing to
take the time ort has the time to look over the page and al lthe
logic we are using and see if there is a better way to do this
even. This form is ending up costing me more time in non billed
hours then the job itself. Yipes!!!
As far as the HTML tags I will look at that again there are a
bunch of includes build some of this page but I do see the
beginning <html> seems to have been lost and I put it
back in.
D. I realize there is a fault with this method in the 1st
place since it replaces the hints with values even if the value is
the hint. Any suggestion on how to deal with that? are these hints
more trouble then they are worth when used as field names. Should
we just redisgn and use the field names in the 1st place? -
Help with instantiating objects and validating them please
Hello,
im working on an assigment where i have to make a milk tank object that simulates a Milk tanker (one of those things that carrys milk :P)
It has a specific constructor that you can pass the volume and capacity to it. I was wondering how i could validate this and make it so the object doesnt instantiate and maybe return an error message if the volume of milk exceeds the capacity of the milk tanker?
basically i just want to make sure an object is valid while it instantiates, otherwise bomb out and return an error..
Thank you,
Phill
PS: im still learning java so some stuff might be over my head, but ive got a book next to me to help me understand :) (yes, ive checked and i cant find anything on this subject)public MilkTanker(int volume, int capacity) throws
InvalidArgumentException
if (volume > capacity)
throw new InvalidArgumentException("Volume can't be greater than >capacity");
this.volume = volume;
this.capacity = capacity
}This means that while trying to create a new object of this class you need to handle a possible exception:
public static void main (String [] args){
try {
MilkTanker tank = new MilkTanker(100, 1000);
catch (InvalidArgumentException _){
System.err.println(_.getMessage());
}In the case that an exception is thrown the object of this class will not be created and every line of code you might have after the constructor call (inside the try clause) will not be executed.
Hope that helped
afotoglidis -
hi, recently i bought macbook pro with retina display and installed windows 8 professional original software also. but in windows 8 track pad/ TOUCHPAD is not working properly. can you help me with providing drivers for trackpad to work on windows 8 professional .
Did you download and install the Windows Support software? If you did, did you use the Boot Camp Control icon to set up the trackpad how you want it?
http://www.apple.com/support/bootcamp/
https://discussions.apple.com/community/windows_software/boot_camp -
I am trying to update my iPad 32 with retina display and whenever I do it tells me that I am not connected to the Internet even though I am. I have tried several different wifi spots with the same results. Any suggestions would be helpful. Thanks
Try a reset: hold down the home button along with the power button until you see the Apple, then let go.
-
As a stockholder, I would like see the development of iTV with Retina display and integrating Siri control, internet access, and iTunes apps. This new product would be a large screen, thin wall mounted television, much like a oversided iPad.
Do you think this product is possible?In general theory, one now has the Edit button for their posts, until someone/anyone Replies to it. I've had Edit available for weeks, as opposed to the old forum's ~ 30 mins.
That, however, is in theory. I've posted, and immediately seen something that needed editing, only to find NO Replies, yet the Edit button is no longer available, only seconds later. Still, in that same thread, I'd have the Edit button from older posts, to which there had also been no Replies even after several days/weeks. Found one that had to be over a month old, and Edit was still there.
Do not know the why/how of this behavior. At first, I thought that maybe there WAS a Reply, that "ate" my Edit button, but had not Refreshed on my screen. Refresh still showed no Replies, just no Edit either. In those cases, I just Reply and mention the [Edit].
Also, it seems that the buttons get very scrambled at times, and Refresh does not always clear that up. I end up clicking where I "think" the right button should be and hope for the best. Seems that when the buttons do bunch up they can appear at random around the page, often three atop one another, and maybe one way the heck out in left-field.
While I'm on a role, it would be nice to be able to switch between Flattened and Threaded Views on the fly. Each has a use, and having to go to Options and then come back down to the thread is a very slow process. Jive is probably incapable of this, but I can dream.
Hunt -
Need help with Blog, Wiki and Gallery
Hi Team,
Need help with Blog, Wiki and Gallery startup. I have newly started visiting forums and quite interested to contribute towards these areas also.
Please help.
Thanks,
Santosh Singh
Santosh SinghHello Santhosh,
Blog is for Microsoft employees only. However, you can contribute towards WIKI and GALLERY using the below links.
http://social.technet.microsoft.com/wiki/
http://gallery.technet.microsoft.com/ -
What's the phone number I should call for help with my iPhone and ihome dock?
What's the phone number I should call for help with my iPhone and ihome dock?
http://www.ihomeaudio.com/support/
-
whats the difference between the 13-inch: 2.5GHz with Retina display and the 2.6GHz macboock pro?
http://www.apple.com/macbook-pro/specs-retina/
At the top of the page youi can cycle between the Macbook Pro specs and the Macbook Pro with Retina specs. -
Why can't I upgrade from CS 5.5 design premium to CS 6 design standard with purchased DVD and valid serial nos?
Kkofron please make sure the CS5.5 serial number you are using is also able to be registered under your account at http://www.adobe.com/. You can find additional details on how to register your Creative Suite 5.5 serial number at Find your serial number quickly - http://helpx.adobe.com/x-productkb/global/find-serial-number.html.
-
I plan to buy and use a MacBook Pro with Retina display and I already own and use the PS CS 5 on my PC window-based. How can I obtain a copy of CS 5 for my MacBook Pro?
Message was edited by: CHARNCHAN. That is without having to buy another copy for the Mac!Not sure why you'd want CS5 for your new Mac with Retina display.
Retina support was first added to Photoshop in CS6 version 13.0.3
http://blogs.adobe.com/jkost/2013/01/retina-display-support-and-photoshop-cs6.html
So, assuming you own standalone Photoshop CS5 (and you're running at least Windows 7 on your PC) then your best option - for optimal display on your Mac - might be to subscribe to the Photoshop Photography Program for $9.99/month
https://creative.adobe.com/plans/offer/photoshop+lightroom?sdid=KIHZP
Then you'll get Photoshop CC + Lightroom 5 + extras and you can run them both on your Mac and Windows (2 installs permitted regardless of operating system) for the same $9.99 monthly fee.
If you don't want to subscribe then your other option would be to buy a separate CS6 license for Mac (paying full price).
Maybe you are looking for
-
HP Photosmart 8750 prints slow when using Photo Gray Cartidge
HP Photosmart 8750 prints slow when using Photo Gray Cartidge ... sometimes indicates Black Cartridge failed, however upon reinserting works slow
-
I just got a ipo 4th generation and it keeps saying charging is not supported witht this accessory
it keeps saying charging is not supporte by this accessory
-
Which java technology best fits this environment
Hi everybody, I�m new to Java. I want to build an environment in which there is a group of devices, say a desktop, a laptop and a PDA sharing all resources including their CPU cycles and memories. Do you think it is feasible to implement such an envi
-
Cannot uninstall Java JRE 1.7 32bits
For some reason my firefox browser stopped detecting java and now I can't run anything with java on it because it says that it's not installed, so I went to add/remove programs and tried to uninstall java but it just won't get removed. http://rcuploa
-
Why would you need an H.264 hardware encoding device?
I am a casual user of Adobe Premiere Pro and just upgraded to CS5.5. I have been reading threads and someone said that he has problems with the Matrox encoder. I can import my video and make and DVD so why would you need another hardware solution?