cancel
Showing results for 
Search instead for 
Did you mean: 

value help for read-only field

Former Member
0 Kudos

Hello,

I have a field with a value help assigned to it, and I want to prevent the users from entering any text manually, and to only be able to select a value from the search help.

When I set the field to be read-only from the I-getter, the value help becomes disabled.

I know there's an option to make the value-help appear from a button or link to event, instead of the standard button of F4, but this is not the solution I'm after.

How can I enable a value help for a read-only field?

Best regards

Accepted Solutions (1)

Accepted Solutions (1)

ashik_k2
Contributor
0 Kudos

Hello,

Try with this in htm page of the view

<thtmlb:inputField id               = "MEMBER_ID"

                    helpId           = "CRMSH_PRIL_BUPAP"

                    helpInputFields  = "MEMBER_ID=PARTNER"

                    helpOutputFields = "MEMBER_ID=PARTNER"                   

                    readOnly         = "TRUE"

                    value     = "//PARTNER/STRUCT.NAMCOUNTRYISO"/>

Former Member
0 Kudos

Thank you, that seems to be working well!

Now I have to do the same for fields that are created by configuration, and not with BSP extension tags.

I thought about accessing the field using javascript (if I manage to do that) and add the attribute readOnly="readonly" to it, that would be one possible way to do that, can anyone think of a better way to do so?

ashik_k2
Contributor
0 Kudos

Hello ,

Other way is to implement in GET_P_.. method of the attribute..

Eg:

CASE iv_property.

WHEN if_bsp_wd_model_setter_getter=>FP_INPUT_HELP_MANDATORY.

      rv_value = 'TRUE'.


ENDCASE.



Former Member
0 Kudos

Thanks,

I tried that, but the GET_P method wasn't called with the FP_INPUT_HELP_MANDATORY parameter.

I did however manage to solve this with javascript, here's the code if it helps anyone: (placed at the view's .htm page)

<script type="text/javascript" language="javascript">
var inputs = document.getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) {
if(inputs[i].id.indexOf(
"[field_name]") >= 0)
inputs[i].readOnly =
"readonly";
}

</script>

Former Member
0 Kudos

Hi Arik,

We have a similar requirement. The only difference is that the field is in a table. Could you explain the javascript code so that we can map the logic for our field.

Thanks in advance,

Sayan

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Just make it a drop down pick list.

Use the P getter for it

CASE iv_property.

     WHEN if_bsp_wd_model_setter_getter~fp_fieldtype.

       rv_value = cl_bsp_dlc_view_descriptor=>field_type_picklist.

ENDCASE

-

Anish

Former Member
0 Kudos

Thanks for the response,

I thought about it, but I can't use it as a drop-down because there are too many possible values, and because I still want the value-help's selection screen to be used.