cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering OnBlur of <PHMLB:formlayoutInputField>

Former Member
0 Kudos

Hi,

I want to trigger a Javascript function onBlur of an inputfield.

With HTMLB inputfield I use the following as a wrapper around my inputfield.

<bsp:findAndReplace find = "<input"

replace = "<%= tmp_string %>" >

What should I use in case of PHTMLB formlayoutInputfield?

Thanks & Regards

Tejaswini

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

A simple phtml:formlayoutinputfield is rendered as

a lot of lines of code, addtionally it offers no place to have your own onblur declaration.

The renderign of the Input tag occurs after the formlayout has been rendered therefor the bsp directive to find and replace should be placed out side the formlayout

***************************

<bsp:findAndReplace find = "<%= replace_txt %>"

replace = "<%= tmp_string %>" >

<phtmlb:formLayout>

<phtmlb:formLayoutInputField id = "firstName"

label = "First Name"

value = "Mary"

required = "true" />

</phtmlb:formLayout>

</bsp:findAndReplace>

***********************

More over there may be more than one imput field in teh formlayout therefore i had to use teh following replace_txt and tmp_string

****************ABAP***********

concatenate '<input type="Text" ' ' class="urEdfTxtEnbl"'

' autocomplete="off"' ' showlength="true" '

' id="firstName" ' into replace_txt.

concatenate '<input type="Text" ' ' class="urEdfTxtEnbl"'

' autocomplete="off"' ' showlength="true" '

' id="firstName"' ' onblur="alert(''BLUR'')"'

into tmp_string.

*************************************

I am not sure if the way of rendering for you will change could check it out, but this type of conversion will be potentially a high risk change given that the rendering may change.

Regards,

Aniruddha

Answers (2)

Answers (2)

former_member181879
Active Contributor
0 Kudos

The formLayout also has a <phtmlb:formLayoutItem> tag. This is a generic tag where you can place anything into one specific cell. This tag will take a body. The idea is that our <phtmlb:formLayoutInputField> has 20% functionality and solves 80% of the problems. If not enough, you use the item.

Typical example, somebody wanted in one cell two input fields next to one another.


<phtmlb:formLayoutItem label = "Surname,Name">
  <htmlb:inputField .../>
  <htmlb:inputField .../>
</phtmlb:formLayoutItem>

brian

maximilian_schaufler
Active Contributor
0 Kudos

You should be ok using the same find/replace strings ...

In the end it's always the HTML <input> tag that is rendered, no matter if you use HTMLB or PHTMLB.

Max