cancel
Showing results for 
Search instead for 
Did you mean: 

VisiblerowCount

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi david,

I am taking the input from the user, after he press enter button, then I need to show the visiblerowcount to the number he entered. So, How do I set it in the onActionEnter() ?

Thanks,

Raj.

Former Member
0 Kudos

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

Former Member
0 Kudos

Armin,

Thanks for reply. I did that. In the onActionEnter button, can u tell me what to write in the onActioEnter method().

Thanks,

Raj.

Former Member
0 Kudos

If you have bound the properties as described the action handler may be empty.

Armin

Former Member
0 Kudos

Armin,

Initially its showing no rows at all. How can I set default rows?.

Thanks,

Raj.

Former Member
0 Kudos

Initialize the context attribute with some useful value, e.g. 10.

You can do this in wdDoInit() with code like

wdContext.currentContextElement().set<attribute-name>(10);

Armin

Former Member
0 Kudos

Armin,

It gives NullPointerException since there are two values for visiblerowcount. I think we need to assign the value from onActionEnter(). I couldnt assign from this method, but I could assign it through wdDoModifyView().

Any leads?

/Raj.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

Thanks All, The Problem was I was setting the default rows in the cust controller instead of View. So that was the problem, anyways its working now. All the above mentioned answers are correct and somebody can refer (for late users).

/Raj.

Answers (0)