on 02-22-2011 6:18 PM
Hello Friends,
This is the first time i am using view switch....now when i am clicking on view switch say 'Genaral'.....i have written the code in action event of general but stilll its not triggering...can you pls tell me any specific thing is needed for this UI element to work.
I have binded the property itemSource with corresponding node.
Thanks
Kiran
Hi Kiran,
i assume you have written your code onselect event handler method.
which context node is binded to the itemSource property of the viewSwitch ?. how many elements are there ?
is itemenabled property also binded ? or is it default enabled ?.
see the help here [http://help.sap.com/saphelp_nw70ehp1/helpdata/en/28/fe5a42091de32ce10000000a1550b0/content.htm|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/28/fe5a42091de32ce10000000a1550b0/content.htm]
The view switch is not automatically toggled. There is an INDEX parameter containing the index of the selected view switch
also see the example WDR_TEST_EVENTS in the view ContextualPanel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
on_select event handler, you can insert INDEX type i as importing parameter.
data node type ref to if_wd_context_node.
" This has so to be done manually
node = wd_context->get_child_node( wd_this->wdctx_yournodename ).
node->set_lead_selection_index( index ).
This should work, but you said that the action itself is not triggerred. Try this code if this is still not working then you should check the node which you bind to itemSource if there is any restriction in cardinality,selection etc.
You should also check the enabled property of the view switch if it true.
>
> Hi Baskaran,
>
> still not working.
> node properties are:
>
> Cardinality: 1..1
> Selection: 0..1
> Init. LS : yes
Ok, i see it. it wont work. ViewSwitch is already selected if you are having cardinality 1..1 and init.LS TRUE.
The business case is to use 0..n or 1..n cardinality to have a viewSwitch and on_select event to trigger.
Since in your case, 1..1 and initial lead selection is true, you would not get this event triggered. You could set init.LS to false to get this on_select event to trigger but this will work once until you set the lead selection to no_selection.
>
> Hello Baskaran,
>
> I tried it also but while i am testing the application i am getting this error:'The ASSERT condition was violated'
Hi,
Please write always more detail so that we do not misunderstand. It could be because you might have changed the Initialize lead selection. Change that back and test if it works.
If your concern here is to still keep 1...1 node binded to view switch and trigger event then you have to find another way to trigger the server round trip (button, etc ).
ok
put a breakpoint in the eventhandler and check.
it should be going there or you might have given the name of some other action.
thanks
sarbjeet singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
when the screen is coming up how many elements are there in the viewswitch ? the action is not triggered only when the itemEnabled property is false.
I have just executed a test, it is working perfectly. So you have to go through your code and layout to check if you have done everything right.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.