cancel
Showing results for 
Search instead for 
Did you mean: 

Property for fields not working properly.

Former Member
0 Kudos

Hi

I am doing some validation on tab strip.

initially on some value my tab strip is coming,due to visibility binding property.

now i am trying to do visibility binding on individual tabs of tab strip on user based,which is not working.

is there any way to make it work out.

my code:

call method wd_context->set_attribute

EXPORTING

name = `PROP_CREDIT` "Context attr name

value = space.

to hide a credit view, i had attached a attr to its transparent cont.,& have passed the value space to make it non visible.

but it not working,i am doing this like enabled,visible on 3-4 tables,but noting happening.

pls let me know how to make it work.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Just check whether you are changing the properties of TAB on ONSelect event of Tabstrip.

Because , everytime you navigate to other TAB, these properties have to be set.

Former Member
0 Kudos

i am observing i thing,that my enable/disable property is not working on TC,its always showing fields,same in read only property,if its 'X',not showing any fields,& if its ' ',its again not showing all fields.

so mainly,if any property is assigned to TC,its do the fucn irrespective of its value 'X' or ''.

Former Member
0 Kudos

Hi,

Do one thing, donot bind any attribute to the TC. Just uncheck the ENABLED proeprty N test it..

Ok

Regards,

Lekha.

Former Member
0 Kudos

Hi

I found 1 isue with the code,whatever the property i assign with the attr to the TC or to the feild elements inside the TAB,its working irrespective of the code to set it 'X' or ''.How this is happening?

I think due to this issue,i am not able to the fields disable or non-readable ,as I am not able to set the value for the second time,its not making it work.I had commented the code,but the display is coming accd to the assigned property,if its enable all fields are coming,if its read only no fields are coming.

do you have any idea on this,why this happening.

Former Member
0 Kudos

Hi,

Have you bound the same context attribute to any other UI element.

Have you wriiten the code in MODIFYVIEW or some where else. Have you written it twice.

Regards,

Lekha.

Edited by: Lekha on Oct 16, 2009 3:05 PM

Former Member
0 Kudos

Lekha

i have written the code in modify view only,& its not written twice,just once only.

but i m only not able to understand ,y my code is not working for TC or for TC's element,as irrespective of code,its calling the property of attr,like if its read only,its making the TC read only,if enabled,its making the TC all fiends as enable.

ok tell me 1 more things,is it required to have data in fields to make it readable only,i hope this is not the reason,as i had seen the fields as non editable without data too.

my just confusion is with te code,its not triggering up.

i have 1 TAB,than 1 TC,than inside this 1 more TC,than 1 Text view,final TC containing all fields.

Former Member
0 Kudos

Hi,

Is it mandatory for you write it in MODFIYVIEW. Check out by writing the code in any other event/plugs.

i have 1 TAB,than 1 TC,than inside this 1 more TC,than 1 Text view,final TC containing all fields.

Why have you taken MAIN TC again whcih is not required right.

For the better desgin,

Have a TCO, Inside this TBSTRIP, Under this, TABS Have a TC which have other UI elements right.

Are you getting the refrence of this TC in MODIFYVIEW then setting the proeprties.

Regards,

Lekha.

Edited by: Lekha on Oct 16, 2009 3:24 PM

Former Member
0 Kudos

LeKha

I have to write the code in modify view only,due to my req.,for initial screen.

in side the TC,i have the 2,3 TC as each TC have its textview element & fields,as in tab i have to show the fields under different heading,liks general data,sales data....etc.

so i have taken the TC accord to my layout.,as inside the 1st TC i am suppose to make fields of 1 TC non modifiable,fields of 1 TC as editable based on user,due to this only i have taken the TC to bind the property with TC only.

I hope u r clr with my req now.

but not sure,may be due to this only thing,the property inside the Tc are not triggering up through the code.as outside the all TC,if the property is on TAB,its working fine.

Former Member
0 Kudos

Hi,

I have to write the code in modify view only,due to my req.,for initial screen.

MODIFYVIEW is mainly used to get teh UI element references and do some setttings for those UI elements.

Initial screen....Can you be more clear on this requriement. What you want to dispaly ....

Are you getting the TC reference in MODIFYVIEW.

Regards,

Lekha.

Former Member
0 Kudos

as of req., i am suppose to display a filed acct grp,on a view,which consist of a tab strip,than if the acct grp is initial,the tab strip shd not be hidden,& if user enter any value thru F4,it shd display the tab strip,for which i have done the code inside the modify-view.which is working fine.

now my nxt step is to make the fields of tab strip editable,non editable,tab hidden accord to the user,which i am trying to do.

so in my 3 tab,i am struck,where i am suppose to make the fields inside the tab as readable only.

this is my whole req.till now,than i have to do various acton based on value in tabs,but let this tab thing to wokr first,accord to user.

Former Member
0 Kudos

HI Vipin,

I have tested ouy this way...

Ihave a TB with 3 tabs, Last tab has got One TC inside which there are 2 other TCs(TC2,3) with Input fields inside them.

I bound the ENABLED property of TC2 to the ENABLE(wdy_boolean) property and coded in DOINIT of view.

I didnt code it in modifyview.

Its working fine for me..

Please test it in some demo application you will get to know the errors.

DATA lv_enable TYPE wd_this->element_context-enable.

* get element via lead selection
  lo_el_context = wd_context->get_element( ).

* @TODO handle not set lead selection
  IF lo_el_context IS INITIAL.
  ENDIF.

* @TODO fill attribute
lv_enable = abap_false.
* set single attribute
  lo_el_context->set_attribute(
    name =  `ENABLE`
    value = lv_enable ).

I guess, there is some thing going wrong in MODIFYVIEW. for every event this gets triggered right.

Now the TC2 got disabled also the Inoutfield inside it got disabled.

Regards,

Lekha.

Edited by: Lekha on Oct 16, 2009 4:08 PM

Former Member
0 Kudos

Hi Lekha

I am also thinking there is some issue with the modify view only,as its suppose to work.but the code u tested is doing in init view,where i can't code,as in initialization i have coded to hide the tabstript,& than its visible on account group value,for which i have coded in modify view,& rest all coding for enable/disable i am trying to do there only,so i m not sure,if i do this validation in init view,how its going to work.

lastly,still i am not done with this,but greatly appreciate your kind efforts & all communications for all ur support.

heartily thanks to you!!!!

regds

vipin sharma

Former Member
0 Kudos

Hi Vipin,

One thing you check, FIRST_TIME attribute of MODIFYVIEW. Try to use it. I guess the conditions that you are using in MODIFYVIEW is getting executed everytime......As you know that this event gets triggered on every action on the view.

Yes, I tested it in DOINIT....Based on some conditions I can also have it in MODIFYVIEW......

Regards,

Lekha.

Former Member
0 Kudos

Hi,

Let me have some clear unsderstanding on your requriement....so that I can replicate the same...

Which transation/BAPI your are using....

Regards,

Lekha.

Former Member
0 Kudos

Hi Lekha

Just to tell you that,the problem have been resolved,now everything thing is working accod to me & with the code in modify-view only,I had now tagged the prop with the TC just below the tabs,so till now things are fine.

thanks...

Answers (3)

Answers (3)

Former Member
0 Kudos

To hide a Table inside a TAB or to hide a Transparent Container inside a TAB,

Make an Attribute of type WDUI_VISIBILITY and bind it with visible property.

Set 01 : For Invisible and 02 for making it Visible.

Former Member
0 Kudos

Hi,

One thing you tell me.....

How many tabs are inside tabstrip.

Are they static ones.....Cna you expalin your layout once...I mean inside each tab do you have transaparnt container....To which visible propperty of TCO/Tab you have bound to...

Regards,

Lekha.

Former Member
0 Kudos

Hi lekha

I am having a transparent cont,inside which i have a tab stript,on this initial TC i had attached a visible prop type wd_visibilty,on some validation its visible,its working fine,now inside it i have 5 tabs,inside each tabs,i have individual tab;s TC,which consist of fields,now on these TC i need to specify the hide,enable property,based on each user,which i have done with 3 attr,but now att is of type wd_Boolean,& i am using the same code for this,once it also worked & have hided a tab,but not making a tab disable,so i was trying with few diff values,but it only happened once,thereafter it not making it work.

ps let me know how to do this.

inside each TAB,i have individual TC,on which i have attached the property.

Former Member
0 Kudos

Hi,

For visibility you have to use WDUI_VISIBILITY(01-None, 02-Visibile), for enable/didsbale you have to use WDY_BOOLEAN.

I you want to comepletely hide the tab, then bind the visible proeprty of each tab to this visible attribute.

I you want to enable/disbale it based on data then use the ENABLED proerty..Hope this is clear of TAB not to the TC thats inside each TAB.

Regards,

Lekha.

Former Member
0 Kudos

hi Lekha,

you want to comepletely hide the tab, then bind the visible proeprty of each tab to this visible attribute.

For hinding a TAB , we have to bind visible property of TAB with wdy_boolean.

Refer this SAP Online Help for Clarification: http://help.sap.com/saphelp_erp2005/helpdata/EN/df/5c9041d3c72e7be10000000a1550b0/frameset.htm

Former Member
0 Kudos

Hi Saurav,

Thanks Much for sharing info.

Vipin: You can have 2 attributes one for enable(WDY_BOOLEAN, visible(WDY_BOOLEAN) and bind them to the respective properties of TAB based on your requirement.

Regards,

Lekha.

Former Member
0 Kudos

Hi Lekha

tell me one thing,the tab i had disabled,is not showing any fields,juts tab name is coming,but i can;t see the insdie fields,but in my case i want to see the fields inside this tab,& in non editable mode,so how to put read only property with this tab.

Former Member
0 Kudos

Hi,

In your case, you have TAB as always enabled. As you have the TC inside this TAB, You can have the ENABLED property of this.

What are the UI eelemtns inside this TC. Is it a table/other UI elements.

Or

Else, Inside the TC as yuo have other UI elements, you can either bind the properties of READ_ONLY/ENABLED based on the UI element.

Regards,

Lekha.

Former Member
0 Kudos

hi Vipin,

If you dis-able your Tab , then you will see all the fields only once that too when you run your application and default TAB is the one which is disable.

After you navigate to other Tabs, default TAB which you have disable wont be showing any fields.

Suppose:

You disable TAB1 in your code before running the application.

Now if your Default Tab selected is TAB1 , then you will see all the fields in Tab1 . All fields will be disabled.

When you navigate from TAB1 to TAB2 and return to TAB1 ,then you will see only name of TAB1 and nothing inside that.

Edited by: Saurav Mago on Oct 16, 2009 12:15 PM

Former Member
0 Kudos

hi ,

To avoid such a situation, dont enable/disable your TAB. Rather inside TAB1 , you have TC1.

So it would be better to enable/disable your Transparnent container(TC1).

Then it would work fine. I have tried it. Its working.

Only thing will be your TAB wont be disabled but field inside tab will be disabled.

Former Member
0 Kudos

Lekha

this is my 3 tab,which is not default,& will be always enables,& inside this tab's TC i have made enabled to work with its property,still is fields in enable mode & not in display only mode,if the bind read only mode,than tab is there,but fields are not there.

Simply i just want the fields shd be there in display only mode for thsi particular tab.

Former Member
0 Kudos

hi,

Just bind the Enable property of Transparent container inside TAB3.

Set its value ' ' : Invisible.

It will work.

All fields will be coming as disabled.

Please check whether you havnt done anything wrong in your code because it is working perfectly fine for me.

Former Member
0 Kudos

Hi,

What are UI elements that you are using inside this TC.

Have you checked in debugging whether you are enabling them right...

Please paste your code....

Let me also check it out...

Regards,

Lekha.

Former Member
0 Kudos

below is my code,in my TC the individual att are there in a node,no table.

elseif lv_AUTHORIZED = 'X'. -


>enable/disable -


on TAB

lo_el_context->set_attribute(

name = `PROP_INITIATOR`

value = 'X' ).

lo_el_context->set_attribute(----


>read only on TC,which consists 5-6 fields ---on TC inside TAB

name = `PROP_FD32`

value = 'X' ).

lo_el_context->set_attribute(--


>hide--


on tab

name = `PROP_CREDIT`

value = '' ).

i had checked this with enable it,its showing all fields or if disabled,nothing,but read only is not working.

Former Member
0 Kudos

Hi,

For testing purpose do one thing,

For the 3rd tab, TC donot bind to any ENABLED property of TC, Just uncheck the ENABLED property. Then test it.

If here everyting is working fine then it would be a problem with your code.

Where have you writen that code.....I guess...somewhere your code is getting bypassed.

For disbaling the TC, you have to pass the SPACE right....

lo_el_context->set_attribute(------------>read only on TC,which consists 5-6 fields ---on TC inside TAB
name = `PROP_FD32`
value = ' ' ).

Regards,

Lekha.

Edited by: Lekha on Oct 16, 2009 12:45 PM

Former Member
0 Kudos

hi,

To Hide the TAB, make an Attribute of type WDY_BOOLEAN not wdui_visibility.

For Invisible : give space like this : ' '.

For Visible : give X like 'X'.

For Tab it will work.