cancel
Showing results for 
Search instead for 
Did you mean: 

onblur in htmlb input field

Former Member
0 Kudos

Hi,

We have a HTMLB input field on a BSP page. We need to fill another field based on the value entered in the first input field. For that I can fire onblur event using the following Java script, but I don't know how to capture the value in the input field and call a function module to get some values based on the given input field value. Any help?

<script for="INPUTFIELDID" event=onblur type="text/javascript">

</script>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Raja,

I implemented the same code mentioned by you in oninputprocessing, still I am getting the same error.

Error message: Access not possible using 'NULL' object reference. ( type of termination: RABAX_STATE ).

I tried the option(htmlbSL) mentioned by Rohit also. But using that also, I am getting the same error. I don't know what code I missed. Any idea what causing the error.

athavanraja
Active Contributor
0 Kudos

the code i have given is tested and it works fine.

to resolve your issue.

1. debug and identify which part of the code the error happens and post the same code here for fixing.

2. or post the entire oninputprocessing code here (if its small) then we can have a look at it.

Regards

Raja

Answers (8)

Answers (8)

Former Member
0 Kudos

Hi,

To call onInputprocessing on the firing of the event, you can use the following code in your javascript:

htmlbSL (this , 2 , 'SUBMITVALUES:onInputProcessing(submit)');

The event can be captured in onInputProcessing with value of event->id as 'SUBMITVALUES'.

I hope it helps.

regards,

Rohit

PS: I have searched for help on htmlbSL but couldnt find any.

athavanraja
Active Contributor
0 Kudos

use the following code in oninputprocessing to determine the event

data: event1 type ref to if_htmlb_data.

event1 = cl_htmlb_manager=>get_event_ex( runtime->server->request ).

  • event1->EVENT_SERVER_NAME will hold the event name (myonclick)

  • event1->EVENT_ID will hold the eventid(myid)

Regards

Raja

Former Member
0 Kudos

Hi Raja,

I am using the following code as said by you.

<bsp:htmlbEvent id = "myid"

onClick = "myonclick"

name = "ValueChanged"/>

<script for="IP1" event=onblur type="text/javascript">

ValueChanged();

</script>

when ever focus is changed from input field "IP1",I assume it will fire event mentioned in onClick, that is "myonclick".I am trying to capture the same event"myonclick" in oninputprocessing code. It's firing an event and it's taking me to onInputprocessing event. In debugging when I check the value of the event, it's showing value "**Illegal reference**" and upon executing this, I am getting the follwoing error in BSP page.

Error message: Access not possible using 'NULL' object reference. ( type of termination: RABAX_STATE )

Former Member
0 Kudos

Hi Raja,

I used the same code mentioned by you. It's firing onInput processing event, but it's firing with empty or NULL value, which I am not able to capture in onInputprocessing and giving error saying that cannot access NULL reference.

athavanraja
Active Contributor
0 Kudos

<i>but it's firing with empty or NULL value</i> whats empty or null?

what value do you want to get it in oninputprocessing?

Regards

Raja

Reward points for helpful asnwers by choosing appropriate radiobuttons in the answer

Former Member
0 Kudos

Hi Rohit,

Yes, If I am able to call onInputprocessing when onblur is fired, that will be helpful to get the required values using the value entered in the input field. And also page need to be refreshed with retrieved values.Please let me know how to call onInitialization when onblur is fired.

athavanraja
Active Contributor
0 Kudos

place the following code just above </htmlb:form

<bsp:htmlbEvent id = "myid"

onClick = "myonclick"

name = "ValueChanged"/>

<script for="IP1" event=onblur type="text/javascript">

ValueChanged();

</script>

this will trigger oninputprocessing for onblur on inputfield id IP1

Regards

Raja

athavanraja
Active Contributor
0 Kudos

<script for="INPUTFIELDID" event=onblur type="text/javascript">

document.<form id>.<inpufieldid>.value = this.value

</script>

Regards

Raja

Former Member
0 Kudos

Hi Raja Sekhar,

I don't think so we can get this reqirement by using input field but we can get it by using dropdownlistbox.

Regards,

Azaz Ali.

Former Member
0 Kudos

Hi,

Do you want to call the OnInputProcessing when the oblur event is fired?

Former Member
0 Kudos

Hi,

you can look in the sourcecode of the html page in your browser.

However you can use javascript with "document.forms[x].elements[y].value" .

In the document object there is an array with all forms and there you can find an array with all html objects like input or button.

Maybe you have to try it out what x and y you have to use.

Best regards,

Nils