on 04-29-2007 1:34 PM
Hi all,
In footer of WD table, there is an input field, where user can specify number of record, which will be shown in first visible line.
I need to automatically select this line as lead selection. How can I achieve this behaviour? ( I'm using NW 2004 SP 19)
Thanks for any answer.
Regards,
Juraj
Juraj,
Try the following:
1. In root context node create "integer" attribute FirstVisibleRow
2. In root context node create "integer" attribute FirstVisibleRowCalc, make it "calculated" and NW IDE will generate getter/setter
3. Bind "firstVisibleRow" property of table to FirstVisibleRowCalc attribute.
4. Write the following in generated "getter" method (get*FirstVisibleRowCalc):
return element.getFirstVisibleRow();
5. Write the following in generated "setter" method(set*FirstVisibleRowCalc):
element.setFirstVisibleRow( value );
wdContext.node<TableNodeName>.setLeadSelection( value );
In theory this should work, though I've never checked this in practice
Valery Silaev
SaM Solutions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's not possible with the standard footer.
As workaround, you can
- set the standard footer to invisible
- place an input field below the table with an action assigned to onEnter
- on the action handler, change the firstVisibleRow and the lead selection as needed
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Juraj,
Assuming that when first time the view containing the table is loaded their is no changes required.
Only when you enter some value in the input field then that record should be shown as first visible row ans should be lead selected.
Now,
1. Create a context attribute ctx_rowinput.Bind this context to the input field.
2. Create a action say onInputShow and associate this with the input field.
Either use a button and associate the action to the button or OnEnter event of input field.
3. In your action onInputShow();
public void onActionInputShow(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
int i = wdContext.currentContextElement().getctx_rowinput();
wdContext.node<table node>().setLeadSelection(i);
}
4. In your wdDoModifyView add the following code
public static void wdDoModifyView(IPrivateTest_Table_View wdThis, IPrivateTest_Table_View.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
//@@begin wdDoModifyView
if(!firstTime)
{
IWDTable table =(IWDTable)view.getElement("Table");
table.setFirstVisibleRow(wdContext.currentContextElement().getctx_rowinput());
}
//@@end
}
<b>Note: If you enter 3 in the input field it will show 2 record as the node index
starts from 0.And also before setting the leadselection and visible row check if
the input value exceeds the nuber of rows in the table.</b>
This has worked for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Juraj,
Any UI element if gets embedded in any other UI element, even then the embedded UI
element has its propertiese. Check in the outline view of your NWDS.
If you can get the propertiese of the input field then check if their are any events associated with that.In case events exists then you can
associate the action with this event.If not then you have to declare a button or something with
which you can associate the action.
Hi Abhijeet,
no, field is not from toolbar.
When I set property of table footerVisible = visible, in runtime I get footer of table with buttons {Next, NextPage, End, Previous, PreviousPage, Begin} and one input field for row specification. So that's input field a want to access.
My previous descriptions probably wasn't so clearly, sorry for them.
Regards,
Juraj
Hi Juraj,
Thats not possible. I tried to check but nothing.
You cannot that input field atleast presently.May be future versions
may have that implementation.
But for now if its that needed then you have to go for a workaround.
@ Armin,
can you just go through the follwoing thread. I need you views on that.
Hi Juraj,
okay so you want to display, whichever no is enterd, as a lead selected first line in a table.
find the <b>dataSource</b> bound to the table and simply write this line on the action in which you want to acieve above result;
wdContext.node<node of dataSource bound to the table >.setLeadSelectionwdContext.currentContextElement().get<context element where you wil get the no.>);
this will select the corresponding row and also set it as lead selected.
hope it helps
let me know if you have any problem
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If the table bind to node that initialize lead selection is defaultly true. That means your initial first record is selected defaultly.
After clicking the first record the second time it is not clickable.
and one more thing when move to another view from the firstview table to another view if you come back from another view to table view first record is not clickable.
For this u need to do the make initilize lead selection is set to false and come back from another view to table view on the second view action u need to add this condition.
wdContext.node<tableNode>().setLeadSelection(-1);
Thanks,
Lohi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai,
Create a context attribute of type integer bind it to inputfield value and bind it to the table property firstVisibleRow.
Regards,
Naga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Juraj,
See the javadoc for <a href="https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/clientserver/uielib/standard/api/WDTableSelectionChangeBehaviour.html">WDTableSelectionChangeBehaviour</a> and try to set this.
Regards,
Sudeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.