cancel
Showing results for 
Search instead for 
Did you mean: 

Oninput processing event on "onchange" of input field

HariCS23
Contributor
0 Kudos

Hello guys -

i have a requirement that i have to call oninputprocessing event on "onchage" of one input filed.

I am doing some validation on itby using <bsp:findandreplace> but at the same time i want to call a server event on it

Any ideas?

thanks

Hari

Accepted Solutions (1)

Accepted Solutions (1)

former_member233090
Active Contributor
0 Kudos

Hi Hari,

Look at this thread which is similar to your question,

cheers,

Bhavana

HariCS23
Contributor
0 Kudos

Hi Bhavana -

I had that javascript functionality already implemented.

I want to trigger oninoutprocessing from javascript. is it possible?

thanks

Hari

former_member233090
Active Contributor
0 Kudos

Hi Hari,

You mean to say that on one input field if you enter something and onchange of that input field you want to add some javascript code rite???? if this is ur question then yes we can do javascript code on that input field.

cheers,

Bhavana

HariCS23
Contributor
0 Kudos

Thats not my question.

I want to call a SERVER EVENT which is oninputprocessing. in another words onclick event. ( not onclientclick event ) .

Any idea ?

Thanks

Hari

former_member233090
Active Contributor
0 Kudos

Hi Hari,

Can you post your code here...... so that i can have a clear picture of what exactly you need to.

Bhavana

MarcinPciak
Active Contributor
0 Kudos

>

> Hi Bhavana -

>

> I had that javascript functionality already implemented.

>

> I want to trigger oninoutprocessing from javascript. is it possible?

>

> thanks

> Hari

Yes, that's possible. You can do it in two ways

1) directly from JS (not recommended)


function some_function(){
    self.htmlbSL(this,2,'submit:doSubmit' ). "trigger the server event for current controller with Submit id and doSubmit action
}

2) make browser generate JS function for server event for you (recommended). For this use bsp:htmlbEvent . For detials refer documentation or [Thomas Jung answer|;.

I found the first one more useful as you can perform some checking before triggering the server event. The second approach is however less error-prone as the browser generates the JS function for you while page is rendered. Anyhow here you can't put your custom code. At least I was not able to.

Regards

Marcin

HariCS23
Contributor
0 Kudos

Hi Marcin -

I understood the second way ..and implemented.

But i didn't get first approach .(it would be easy for me since i am doing some validations in the javascript method .after validations i want call oninput processing. )

Can you give some code snippet. ( more detailed )

i want some thing like this. I am not using controller. i am using page with flow logic.

function myjsmethod()

{

do validation s

if ( validated )

{

call oninput processing event.

}

}

Thanks and appreciate your help.

Thanks

Hari

Edited by: Hari on Jun 24, 2010 8:34 AM

HariCS23
Contributor
0 Kudos

I got it Marcin.

Sever event is doSubmit.

ID is submit.

( there is dot in the java script function code you posted. so i though its the pseudo code. But it seems to be working after replacing "." with ";" )

Wonderful. thanks for the help.

-Hari

MarcinPciak
Active Contributor
0 Kudos

Hari,

Indeed, sorry I must have placed it there as a habit to ABAP

I am glad you were able to solve it.

Regards

Marcin

Answers (0)