on 06-16-2004 12:11 AM
Is there a way to mimic, the exit command push button?
For example:
Input field1 _________ (required field)
PB_CONTINUE PB_EXIT
if the user clicks PB_CONTINUE -> the user asked to enter the input field1.
if the user clicks PB_EXIT -> the user did not asked to enter the input field1.
I only managed to get validation (using doValidate) for ALL push button.
Any idea?
Thanks,
Iwan
Hi Brian,
Thanks again for the tip. I was under the assumption that it's better do as much as possible at the client side, since there will be no communication to the server side. I guess, I was wrong
Regards,
Iwan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are no black or white answers here. Just subtle shades of gray. Do what it takes to get the job done. But when one starts to jump through loops, and mangling all concepts to force something to work, then rather try another shade of grey!
From our own experience a quick trip to the server is definitely acceptable from time to time!
++bcm
Brian,
As always, it's an excellent explanation you gave about round trip to server in the event of an error. Even in our applications mostly we do server side validations, some times it is not possible to have client side validation after submitting the request and prevent submitting half the way when error is detected at server.
Could you please tell me why there is an error page in the BSP page/controller attribute and How to use it. Right now I am collecting all the errors from server and display them in the view usin textview control.
thanks,
suresh
Is this BSP related? If yes, give us maximum 25 line program to demonstrate the question.
++bcm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes it is. I would like if the user click exit button, the required field validation will be ignored... just like Exit function in ABAP world.
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:content design="design2003" >
<htmlb:page title="Suporting Document" >
<htmlb:group>
<htmlb:groupHeader>
<htmlb:textView text = "Suporting Document: Initial Screen"
design = "EMPHASIZED" />
</htmlb:groupHeader>
<htmlb:groupBody>
<htmlb:form doValidate = "true"
autoComplete = "false" >
<htmlb:textView text="Request number" />
<htmlb:inputField id = "sDRequestNumber"
required = "X"
doValidate = "true" />
<br>
<htmlb:button id = "sDEdit"
text = "Manage Supporting Document"
onClick = "onClick" />
<htmlb:button id = "sDExit"
text = "Exit"
onClick = "onClick" />
</htmlb:form>
</htmlb:groupBody>
</htmlb:group>
</htmlb:page>
</htmlb:content>
Good example, about 10 lines to many
Here a suggestion. I am not complete happy with the solution, but it is pragmatic and works.
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:content design="design2003" >
<htmlb:page>
<htmlb:form id ="XYZ"
doValidate = "true"
autoComplete = "false" >
<htmlb:textView text="Request number" />
<htmlb:inputField id = "sDRequestNumber"
required = "X"
doValidate = "true" />
<htmlb:button
id = "sDEdit"
text = "Manage Supporting Document"
onClick = "onClick" />
<htmlb:button
id = "sDExit"
text = "Exit"
onClientClick = "window['doValidate_XYZ'] = null;"
onClick = "onClick" />
</htmlb:form>
</htmlb:page>
</htmlb:content>
There are two important changes made to your example. First the form was given an ID, so that we know this value. Next the Exit button was given an onClientClick event. This is a piece of JavaScript that fires in browser first. All it does it overwrite the predefined validate method for this form will a null method.
++bcm
Yes, I have an idea. It will be some work from yourside.
Why not read all the appends in this forum for the last week or so? Somewhere there is a series of appends that describe how to intercept Javascript functions. What you want to do, is to intercept the htmlbSubmit function, and then do this same trick there. For signature, etc of this htmlbSubmit you will have to read the .js file we render.
My personal opinion: this is becoming messy. Remove all this client-side validation. Just do it at the server, and if the values are not ok, return page with error message. The extra roundtrip is no problem, it is only in error case.
++bcm
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.