on 08-31-2006 8:59 PM
Hi,
For a table, I want to take input from user to display the no.of rows in the table like in yahoo, or g-mail. So, for that I am taking input and allowing a button.
Can somebody tell what I need to do in the onActionEnter ?
How to refresh our own view with latest no.of visible row count?.
I wrote the following code
IWDTable tablle = (IWDTable)view.getelement("POListTable");
table.setVisibleRowCount();
Thanks,
Raj.
You can create an integer context attribute and bind the VisibleRowCount property to that. Then you can adjust the number of visible rows by setting this value in the action handler for your button.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bind property Table.visibleRowCount to context atribute "NumRows" of type integer.
Bind InputField.value to the same attribute.
Assign an action to the InputField.onEnter event or to some Button.onAction event.
Then the visibleRowCount is changed as soon as you press the ENTER key inside the input field or press the button.
Armin
Post the exact error stack trace.
What do you mean by <i>It gives NullPointerException since there are two values for visiblerowcount.</i>. Are you using two different attributes for doing this?
As already mentioned, no need to do anything in the onActionEnter as just a server round trip takes care of updating the context attribute with the recent value.
Hi,
Your context structure should look like this:
-Root
--TableData (node bound to datasource property of table)
--VisibleRowCount (value node of type integer)
Bind this VisibleRowCount node to both visibleRowCount property of table and also value property of the inputfield.
In wdDoInit()
wdContext.currentContextElement().setVisibleRowCount(10);
Create the event handler for the click event of the button. Keep it empty, i.e. you don't need to write any code.
You don't need to do anything in wdDoModifyView().
Regards,
Satyajit.
Hi Raj,
create one integer type value attribute in the context(ex: rowTable).
Then bind this attribute to the visibleRowCount property of the table.
and also create another one integer type value attribute(ex: rowInput), bind it to the value property of the inputfield.
in the doInit() method, insert the following code.
wdContext.currentContextElement().set<rowTable>(10);
put the following code in the onActionEnter() method,
int rows=wdContext.currentContextElement().get<rowInput>();
wdContext.currentContextElement().set<rowTable>(rows);
regards
karthik
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.