How can I delay validation of Field?
There's validation issue that we need help on right away, and I've tried to described it below:
There's a drop down on a page, and it's configured for Auto Submit on Change, and there's a text field which is set as 'Required', and there's a submit button on the page. What is happening right now is that the validation gets triggered on the change of the drop down item. This is even though I've set the immediate property of the 'Drop Down' to true.
I don't want the text field validation to be triggered till I hit the 'submit' button. Is there anyway, I can achieve that?
Regards
Haroon
Hi Haroon,
Required is a property of the textField. Hence one option that could be tried is to set textField1.setRequired(true) in the process value change method of the dropdown. I havent tried this myself though.
Consequently this situation is well taken care of by the virtual forms in Creaotr 2 EA 2. The tutorial that would be useful is Using Virtual Forms at:
http://developers.sun.com/prodtech/javatools/jscreator/ea/jsc2/learning/tutorials/index.html
Hope this helps
Cheers
Giri
Similar Messages
-
How can i delay the using period of certificate when i start ssl in ims
i enabled https and imaps in ims52,but i found the period of validity of the certificate is 1 year by default. how can i delay it to 5 years or more?
does it specify during generation of CERTIFICATE REQUEST ?
thx!
Message was edited by:
giant.salaThere is nothing you can do in Messaging Server for this. The expiration of a certificate is defined by the certificate itself.
-
How can I validate a date field in Portal Forms
I have a date field in portal forms that I want to perform validation on to make sure it's in the proper format before being accepted (mm/dd/yyyy). How can I validate against that field?
Hi Ben,
I took the time to test and revise. This is code that will validate a date entry (format MM/DD/YYYY). Just paste this in the "Before the start of the form..." window of the Additional PL/SQL code section of the form. Then add validateDate(); into the onBlur event window of the field in question. Replace the CYCLE_END_DATE with the field name in question.
HTP.P('
<SCRIPT LANGUAGE=javascript>
function validateDate() {
var ddObj;
var mmObj;
var yyObj;
var day;
var mon;
var year;
var field_val;
var field_name;
for (var j=0; j < document.forms[0].elements.length; j++) {
field_name = document.forms[0].elements[j].name;
field_val = document.forms[0].elements[j].value;
if (field_name.substring(field_name.indexOf(''DEFAULT.'') + 8, field_name.lastIndexOf(''.01'')) == ''CYCLE_END_DATE'') {
var delimPos = field_val.search(/\//i);
if (delimPos < 0)
alert(''Invalid date entry! Please enter in MM/DD/YYYY format. '' +
''e.g, Dec 21, 2003 would be entered as 12/21/2003'');
else
if (field_val.length != 10)
alert(''Invalid date entry! Please Please enter in MM/DD/YYYY format. '' +
''e.g, Jan 1, 2003 would be entered as 01/01/2003'');
else {
month = field_val.substring(0, field_val.indexOf(''/''));
day = field_val.substring(field_val.indexOf(''/'') + 1, field_val.lastIndexOf(''/''));
year = field_val.substring(field_val.lastIndexOf(''/'') + 1, 10);
/* Need to subtract 1 from value because in Javascript, January begins with 0
and ends with 11 for December */
month = month - 1;
ddObj = new Date(year, month, day);
mmObj = new Date(year, month, day);
yyObj = new Date(year, month, day);
if (ddObj.getDate(ddObj.setDate(day)) != day)
alert(''Invalid day!'');
if (mmObj.getMonth(mmObj.setMonth(month)) != month)
alert(''Invalid month!'');
if (mmObj.getYear(mmObj.setYear(year)) != year)
alert(''Invalid year!'');
</SCRIPT>
'); -
How can I get the "text" field from the actionEvent.getSource() ?
I have some sample code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.ArrayList;
public class JFrameTester{
public static void main( String[] args ) {
JFrame f = new JFrame("JFrame");
f.setSize( 500, 500 );
ArrayList < JButton > buttonsArr = new ArrayList < JButton > ();
buttonsArr.add( new JButton( "first" ) );
buttonsArr.add( new JButton( "second" ) );
buttonsArr.add( new JButton( "third" ) );
MyListener myListener = new MyListener();
( (JButton) buttonsArr.get( 0 ) ).addActionListener( myListener );
( (JButton) buttonsArr.get( 1 ) ).addActionListener( myListener );
( (JButton) buttonsArr.get( 2 ) ).addActionListener( myListener );
JPanel panel = new JPanel();
panel.add( buttonsArr.get( 0 ) );
panel.add( buttonsArr.get( 1 ) );
panel.add( buttonsArr.get( 2 ) );
f.getContentPane().add( BorderLayout.CENTER, panel );
f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
f.setVisible( true );
public static class MyListener implements ActionListener{
public MyListener() {}
public void actionPerformed( ActionEvent e ) {
System.out.println( "hi!! " + e.getSource() );
// I need to know a title of the button (which was clicked)...
}The output of the code is something like this:
hi! javax.swing.JButton[,140,5,60x25,alignmentX=0.0,alignmentY=0.5,
border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@1ebcda2d,
flags=296,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,
disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,
right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,
rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=first,defaultCapable=true]
I need this: "first" (from this part: "text=first" of the output above).
Does anyone know how can I get the "text" field from the e.getSource() ?System.out.println( "hi!! " + ( (JButton) e.getSource() ).getText() );I think the problem is solved..If your need is to know the text of the button, yes.
In a real-world application, no.
In a RW application, a typical need is merely to know the "logical role" of the button (i.e., the button that validates the form, regardless of whether its text is "OK" or "Save", "Go",...). Text tends to vary much more than the structure of the UI over time.
In this case you can get the source's name (+getName()+), which will be the name that you've set to the button at UI construction time. Or you can compare the source for equality with either button ( +if evt.getSource()==okButton) {...}+ ).
All in all, I think the best solution is: don't use the same ActionListener for more than one action (+i.e.+ don't add the same ActionListener to all your buttons, which leads to a big if-then-else series in your actionPerformed() ).
Eventually, if you're listening to a single button's actions, whose text change over time (e.g. "pause"/"resume" in a VCR bar), I still think it's a bad idea to rely on the text of the button - instead, this text corresponds to a logical state (resp. playing/paused), it is more maintainable to base your logic on the state - which is more resilient to the evolutions of the UI (e.g. if you happen to use 2 toggle buttons instead of one single play/pause button). -
How can I program the text fields in my email forum to have rounded corners
How can I program the text fields in my email forum to have rounded off edges or corners.
this is the code im using.
// insert code here// insert code here// prepare email field
var email = sym.$("email")
email.html("Enter your Email: ");
inputEmail = $('<input />').attr({'type':'text', 'value':'', 'id':'email'});
inputEmail .css ('font-size', 14);
inputEmail .css ('width', 350);
inputEmail .css ('background-color', '#4e4e4e');
inputEmail .appendTo(email);
// prepare topic field
var topic = sym.$("topic");
topic.html("Topic: ");
inputTopic = $('<input />').attr({'type':'text', 'value':'', 'id':'topic'});
inputTopic .css ('font-size', 14);
inputTopic .css ('width', 350);
inputTopic .css ('background-color', '#4e4e4e');
inputTopic .appendTo(topic);
// prepare message field
var message = sym.$("message");
message.html("Message: ");
inputMessage = $('<textarea />').attr({'type':'textarea','rows':'10', 'cols': '25','value':'', 'id':'message'});
inputMessage .css ('font-family',"Arial,Helvtica,sans-serif");
inputMessage .css ('color',"#ffffff");
inputMessage .css ('font-size', 14);
inputMessage .css ('background-color', '#4e4e4e');
inputMessage .css ('box-shadow', '#4e4e4e');
inputMessage .css ('width', 350);
inputMessage .css ('height', 150);
inputMessage .appendTo(message);
var submitBtn = sym.$("btn");
submitBtn.html("Submit");
submitBtn.css("text-align", "center");
submitBtn.css("font-size",14);
submitBtn.css("font-weight","bold");
submitBtn.css("color","#ffffff");Try this: inputEmail.css ('border-radius', '25px');
attachment
more details -
How can we change the input field on a view stop showing zeros
Hello,
To make screen look consistent with other character input field. How can we change the input field on the view stop displaying zeros even though the data type is NUMC and data type should not be change?
Edited by: sap_learner on Mar 25, 2010 5:44 PM
Edited by: sap_learner on Mar 25, 2010 5:49 PM
Edited by: sap_learner on Mar 25, 2010 5:55 PMhello Manas Dua,
Thanks for your help. I am able to resolve my problem.
My code will help the future comers to resolve this kind of issues.
*The code is applied to method WDDOINIT of the default view.
DATA lo_nd_terms_input TYPE REF TO if_wd_context_node.
DATA lo_nd_terms_input_i TYPE REF TO if_wd_context_node_info.
DATA lv_zeros TYPE wdy_attribute_format_prop.
lv_zeros-null_as_blank = 'X'.
lo_nd_terms_input = wd_context->get_child_node( name = wd_this->wdctx_input ).
lo_nd_terms_input_i = lo_nd_terms_input->get_node_info( ).
lo_nd_terms_input_i->set_attribute_format_props(
EXPORTING
name = `ENTER THE ATTRIBUTE NAME`
format_properties = lv_zeros ).
Edited by: sap_learner on Mar 26, 2010 5:02 PM -
How can we read the screen field values from the report selection screen wi
Hi expart,
How can we read the screen field values from the report selection screen with out having an ENTER button pressed .
Regards
Razzuse this code...
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_posnr.
**Read the Values of the SCREEN FIELDs
CALL FUNCTION 'DYNP_VALUES_READ' -
How can I share a static field between 2 class loaders?
Hi,
I've been googling for 2 days and it now seems I'm not understanding something because nobody seems to have my problem. Please, somebody tell me if I'm crazy.
The system's architecture:
I've got a web application running in a SunOne server. The app uses Struts for the MVC part and Spring to deal with business services and DAOs.
Beside the web app, beyond the application context, but in the same physical server, there are some processes, kind of batch processes that update tables and that kind of stuff, that run once a day. Theese processes are plain Java classes, with a main method, that are executed from ".sh" scripts with the "java" command.
What do I need to do?
"Simple". I need one of those Java processes to use one of the web app's service. This service has some DAOs injected by Spring. And the service itself is a bean defined in the Spring configuration file.
The solution is made-up of 2 parts:
1. I created a class, in the web app, with a static method that returns any bean defined in the Spring configuration file, or in other words, any bean in the application context. In my case, this method returns the service I need.
public class SpringApplicationContext implements ApplicationContextAware {
private static ApplicationContext appContext;
public void setApplicationContext(ApplicationContext context) throws BeansException {
appContext = context;
public static Object getBean(String nombreBean) {
return appContext.getBean(nombreBean);
}The ApplicationContext is injected to the class by Spring through the setApplicationContext method. This is set in the Spring configuration file.
Well, this works fine if I call the getBean method from any class in the web app. But that's not what I need. I need to get a bean from outside the web app. From the "Java batch process".
2. Why doesn't it work from outside the web app? Because when I call getBean from the process outside the web app, a different class loader is executed to load the SpringApplicationContext class. Thus, the static field appContext is null. Am I right?
So, the question I need you to please answer me, the question I didn't find in Google:
How can I share the static field between the 2 class loaders?
If I can't, how can I load the SpringApplicationContext class, from the "Java batch process", with the same class loader my web app was started?
Or, do I need to load the SpringApplicationContext class again? Can't I use, from the process, the class already loaded by my web app?
I' sorry about my so extensive post...
Thank you very much!zibilico wrote:
But maybe, if the web service stuff gets to complicated or it doesn't fulfill my needs, I'll set up a separate Spring context, that gets loaded everytime I run the "Java batch process". It'll have it's own Spring configuration files (these will be a fragment of the web app's config files), where I'll define only the beans I need to use, say the service and the 2 DAOs, and also the DB connection. Additionally, I'll set the classpath to use the beans classes of the web app. Thus, if the service and DAOs were modified in the app server, the process would load the modified classes in the following execution.You'll almost certainly have to do that even if you do use RMI, Web services etc. to connect.
What I suggest is that you split your web project into two source trees, the stuff that relates strictly to the web front end and the code which will be shared with the batch. The latter can then be treated as a library used by both the batch and web projects. That can include splitting Spring configuration files into common and specific, the common beans file can be retrieved from the classpath with an include. I regularly split web projects this way anyway, it helps impose decoupling between View/Controller and Model layers.
On the other hand, you might consider running these batch processes inside the web server on background threads. -
How can i make a search field in my app using applescript?
I am making an app and i would like to learn how can i add a search field, that will search the content of a window. BTW i am using xcode and applescript
Like pretty much all of the Cocoa documentation you will need to convert from Objective-C, but take a look at the Search Fields documentation.
-
How can I create a custom field in contacts and have it appear in ICal?
How can I create a custom field in contacts (death date) and have it appear in calendar?
Birthdays seems to work fine but I'd like to do the same for a custom field called Date of DeathBy default, iTunes convert files to type AAC which has an extension of .m4a
For iTunes to recognize them as Audiobook files, the extension needs to change from .m4a to .m4b
This can be done a number of different ways. Here are 2 (beginner and advanced)
. simply, by renaming each file from windows explorer
. more complex, by using Start/Run/cmd to get a "DOS" type window,
using the command "cd" to change to the directory that your files are in
and entering "ren *.m4a *.m4b" -
i paid for exportpdf and every time i try to use tool on pdf, it asks me to subscribe. i have to log into website EVERY time. not acceptable. Some forms can't be saved so having to log in and only use webtool to upload a saved pdf won't work.
as well, how can i export only form fields that were filled in if I can get pdf to save to computer?Hi kstine,
I can see why that would be frustrating! Have you tried selecting Stayed Signed In underneath the Adobe ID and Password boxes when you try to log in?
What did you use to create the PDF form? If you used FormsCentral, form data is saved to your online FormsCentral account. If you have Acrobat, you can export form data as described here: Adobe Acrobat X Pro * Manage form data files
Best,
Sara -
hi,
sap gurus,
good morning to all,
how can i add STORAGE LOCATION field which is not in the standard tables namely
KOMP, KOMK, and KOMG.
how to include it in our FIELDS FROM FIELD CATALOGUE.
if we include this field is there any impact on the standard tables.
plz let me know this.
bcz
we are selling our products in two ways
(1). one is straight from factory ie direct sales from factory
if customer asks for excise invoice then we will sell thru factory and keeping freight in mind we will
deliver him which ever is economical either rail or road.
before coming to second case of selling the goods
we will do STOCK TRANSPORT ORDER from plant to different storage locations.
if we did STO thru road we have to sell the goods thru road only.
if we did STO thru rail we have to sell the goods thru rail route only.
(2). if the customer is not asking any excise invoice then we will send the goods thru depo/storage
location which is not registered under excise.
if the goods came by road then it will be delivered by road only.
if the goods came by rail then it will be delivered by rail only.
my logic here is
basing on the
storage location, transportation types, and distance i want to create condition record
that captures exact frieght at the sales order level.
confirm whether i am right or wrong.
regards,
balaji.t
09990019711.Hi,
It is not recommended to add new fields to any SAP standard tables. It disturbs the whole SAP functionality.
But if you have no choice expcept to change the standard tables to meet your requirement - then you need an access key to modify the object, which is available from the market place.
Nevertheless, the better option is to create a 'Z' table with the required fields and use that accordingly.
Changing standard tables will have serious impact when you apply patches or do an upgrade on the existing functionality.
REWARD POINTS IF HELPFUL
Regards
Sai -
How Can I Set the Search Field in iTunes?
In applescript...
In another app - I have copied a song title to the clipboard...
Q: Now - How Can I Set the Search Field in iTunes to the clipboard contents?
Q: Also how can I also open the main library itunes window?Hi Rev Dave,
Q: Now - How Can I Set the Search Field in iTunes to
the clipboard contents?
Unfortunately the only way I can think to achieve this involves the use of "UI Scripting". The other previous posters have given you the preferred method you should consider using. If you want to script iTunes so that you visually see the search take place in iTunes you'll need to use the method shown in the script I've posted below.
Q: Also how can I also open the main library itunes
window?
Cyclosaurus has given you the answer to this part of your question already.
Here is a script that (though ugly IMHO) should achieve what you are asking for:set theSearch to (the clipboard) as string
tell application "iTunes"
activate
set allPlaylists to playlists
repeat with aList in allPlaylists
if name of aList is not "Library" then
set view of front browser window to aList
exit repeat
end if
end repeat
set LibList to playlist "Library"
set view of front browser window to LibList
end tell
tell application "System Events"
tell process "iTunes"
if "iTunes" is not in name of windows or ¬
focused of window "iTunes" is false then ¬
keystroke "1" using command down
keystroke tab
keystroke theSearch
end tell
end tellIn order for the above script to work you need to have "Enable access for assistive devices" enabled in the "Universal Access" section of the "System Preferences" application.
If you have any further questions about the above script feel free to ask.
Hope this helps...
iBook G4 1GHz Mac OS X (10.4.3) 640 MB RAM -
How can I add the the field in the database in JSP?
How can I add the the field in the MS access using JSP?
By using JDBC.
http://java.sun.com/docs/books/tutorial/jdbc/index.html -
How can I concatenate a currency field (eg: 12.25) with numeric values
Hi,
I ma working in ECC6.0.
How can I concatenate a currency field (eg: 12.25) with numeric and character values into a variable.
I want to concatenate 12.25 with "+" and "0".
Regard,
DivyaHi,
I ma working in ECC6.0.
How can I concatenate a currency field (eg: 12.25) with numeric and character values into a variable.
I want to concatenate 12.25 with "+" and "0".
Regard,
Divya
==================================
data: l_string type string.
move l_curr_field to l_string.
condense l_string no-gaps. "if needed
concatenate l_string '+' '0' into l_string.
now your l_string will have all the values.
Maybe you are looking for
-
Logic Pro 7.2 and Tascam FW-1884 Not Working
I recently upgraded to Logic Pro 7.2 and I'm using a Tascam FW-1884 as my audio interface / Control Surface. Everything was working fine in 7.1.1, but now it doesn't work correctly. When I press buttons and faders on the Tascam I see MIDI information
-
How can we download the Purchase order report?
Hi, In my requirement i am displaying the PurchaseOrder details report to the Manager in the workitem he want to download the report (after execution of the workitem the manager approved the PO) in the form of EXCEL sheet. Can anybody give the soluti
-
This is what it shows when I click on any link: General failure, The URL was: http://.....The system cannot find the file specified.
-
Itunes 6.0 Windows XP Problems
When I upgraded to Itunes 6.0, i can see my 500 music and audio files, but when i click to play or even transfer to my IPOD, itunes says it can not find the file I can clearly see in my music library.
-
Can I delete the .tmp files?
In "My Adobe Captivate Projects" folder I have noticed a large number of .tmp files. Is it safe to delete these? They are not in a specific project folder and some are very large. I have about 22 projects and about 15 .tmp files. Example names are Ad