cancel
Showing results for 
Search instead for 
Did you mean: 

Enable caption in WD4A

Former Member
0 Kudos

Hi ,,

In Login screen i have id and pass and button and caption also.But the caption will be disable...If the login fails it back to Login screen,at that time only the caption will be enable.How can i do this any sample related link is helpful????

Thanks in advance.....

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

To do this create a context attribute of type WDUI_VISIBILITY and Bind it with the Visible Property of the UI element. Then set the visibleity on the basis of your requirement.

Former Member
0 Kudos

Hi Sethi,

I done it as u said...But how can i set the attribute either true or X for enabling...

Thanks in Advance...

Edited by: Chandramohan2501 on Jun 11, 2010 11:59 AM

Former Member
0 Kudos

As I mentioned in earlier Post that you need to declare a context attribute say VISIBLE of type WDUI_VISIBILITY. Then bind this with your UI Property and use the below code to get/set the VISIBLE attribute:

DATA lo_nd_visible TYPE REF TO if_wd_context_node.

DATA lo_el_visible TYPE REF TO if_wd_context_element.

lo_nd_visible = wd_context->get_child_node( name = wd_this->wdctx_visible ).

lo_el_visible = lo_nd_visible->get_element( ).

lo_el_visible->set_attribute(

name = `VISIBLE`

value = abap_true).

Hope it works for You.

Former Member
0 Kudos

Thanks buddy..

I solved it by my own...But this also very helpful..in value Instead of abap_true i give WDyn_ui_VISIBILITY_visible.It works fine..

Thanks............

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Caption has a property called "Enabled". Bind this propert to some attribute in the context of type wdy_boolean.

Initially i would be false so ur Caption will be disabled and than according to ur need

set this flag true or false to enable and disable the caption..

DATA lo_nd_node1 TYPE REF TO if_wd_context_node.

DATA lo_el_node1 TYPE REF TO if_wd_context_element.

lo_nd_node1 = wd_context->get_child_node( name = wd_this->wdctx_node1 ).

lo_el_node1 = lo_nd_node1->get_element( ).

IF lv_flag = abap_true.

lo_el_node1->set_attribute(

name = `FLAG`

value = abap_true).

ELSE.

lo_el_node1->set_attribute(

name = `FLAG`

value = abap_false).

ENDIF.

where

node1: is the node in the context.

Flag : is the attribute isnide the node of type WDY_BOOLEAN.

lv_flag : is the indicator when u have to ea=nable or disable the caption.

Hope this will help you.

Thanks & Regards,

Arvind

Former Member
0 Kudos

Thx for ur reply..

For lv_flag type may be wdy_boolean..

Or how can i declare??

I066686
Participant
0 Kudos

Hi,

In context of that view create one attribute(Type Char1) , and bind it to the visible property of the caption (Bind directly to the selected attribute)

If login fails set the attribute 'X' else blank.so caption will be visible only if login fails. I hope it solves your problem.

With Regards,

Kiruba