cancel
Showing results for 
Search instead for 
Did you mean: 

Table Refresh

Former Member
0 Kudos

I want to refresh the UI table which holds the data from the model.

Each time I reenter the View I want it to be refreshed.

Can someone tell me how to do that?

This could be simple,but I am absolutely new to Java.

Please Help.

Thanks,

Supriya Manik.

Accepted Solutions (1)

Accepted Solutions (1)

venkatakalyan_karanam
Active Contributor
0 Kudos

Hi Supriya

Write the Table population in wdModify method,So that thye table is refreshed when ever the screen is going to render or refresh .

Regards

Kalyan

Answers (6)

Answers (6)

venkatakalyan_karanam
Active Contributor
0 Kudos

Hi

In this case extract the element to element data of the model node in a for loop

Get the data and create a element in the Value node and set the data in the element of the value node.Dont use that wdCopy service if you dont have the same structure. for more clarifications

mail me venkatakar@intelligroup.com

Regards

Kalyan

venkatakalyan_karanam
Active Contributor
0 Kudos

Hi

1. First create a value node and bind it to the dataSource of the table

2.Populate the data from the model node to value node in init method of view controller

3. In the Action of the button delete the elements of the value node

4. Then the table will not contain any data.

Regards

Kalyan

Former Member
0 Kudos

can u send me some sample code for that please??

Former Member
0 Kudos

Hi Supriya,

You can remove the elements and make it empty like this:

for(int i=wdContext.node<nodename>().size()-1;i>0;i--)

{

IPrivate<viewname>.I<nodename>Element ele = wdContext.node<nodename>().get<nodename>ElementAt(i);

wdContext.node<nodename>().remove<nodename>Element(ele);

}

To Copy data from one node to another:

for(int i=0;i<wdContext.node<nodename>().size();i++)

{

IPrivate<viewname>.I<targetnodename>Element tar = wdContext.node<targetnode>().create<targetnode>Element();

tar.set<attribute>(wdContext.node<sourcenodename>().get<sourcenodename>ElementAt(i).get<attribute>());

wdContext.node<targetnode>().addElement(tar);

}

Warm Regards,

Murtuza

former_member751941
Active Contributor
0 Kudos

Hi Supriya,

Try this steps.

1> Take a ValueNode cardinality 0..n.

2> Bind this value node in the View datasource.

3> Take 2 buttons (Reset and Display)in view layout.

4> Inside the acion of Display button populate the ValueNode with the ModelNode Data.

Inside the action of Display button use this code according to your node name.

for(int i=0;i<wdContext.nodeModelNode().size();i++)

{

IPrivate<Put View Name>.IValueNodeElement valueElm = wdContext.createValueNodeElement();

valueElm.setAttr1(wdContext.nodeModelNode().getModelNodeElementAt(i).getAttr1());

valueElm.setAttr2(wdContext.nodeModelNode().getModelNodeElementAt(i).getAttr2());

valueElm.setAttr3(wdContext.nodeModelNode().getModelNodeElementAt(i).getAttr3());

valueElm.setAttr4(wdContext.nodeModelNode().getModelNodeElementAt(i).getAttr4());

wdContext.nodeValueNode().addElement(valueElm);

}

5> Inside the action of Reset button write

wdContext.nodeValueNode().invalidate();

{Assumming Value node name ValueNode and Model node name ModelNode }

Regards,

Mithu

venkatakalyan_karanam
Active Contributor
0 Kudos

Hi Supriya

This thread explains how a model node can be copied to the value node.

Regards

Kalyan

Former Member
0 Kudos

The 2 nodes I have are dissimilar to each other.

They have different fields in it.Can we still use the same??

venkatakalyan_karanam
Active Contributor
0 Kudos

Hi

The data population is Simple

You can use WDCopyService

Go through these links

======================================================

One more doubt i have in your reply.Where is the Reset Button is it browserd Refresh button or may a button you added.

You are saying that the model data is not going to be changed ,Then what is the requirement in refreshing the table data,i mean the situation.You want to sort the back end data according to the user events.

Regards

Kalyan

Former Member
0 Kudos

reset button is the one I added.

When I click on that button the whole data must be cleared from the Table.

The table must not have any data.

venkatakalyan_karanam
Active Contributor
0 Kudos

Hi Supriya

What is the meaning of re enter in to the view.You mean initially you want to show the details in the table.Then on what action the table data is going to refresh.Is the back end model node data is refreshing /changing every time.Can you please come again with your exact requirement,So that i can help you.

Regards

Kalyan

Former Member
0 Kudos

the backend model node is not getting getting refreshed.

But when I press in reset, the table must get refreshed.

How can we do that??

And how can we pass the data from one node to another??

venkatakalyan_karanam
Active Contributor
0 Kudos

Hi

How you binded the table data source if you bind the table dataSource property to the node which directly refers to the Model Node then the data automatically refreshes.If you binded the table data Source to a context node which does not refers to ModelNode then populate the Data in to the context node after extracting from the model node(Before that ensure model is executed correctly).Do this population in wdModify() method of View Controller.

Regards

Kalyan

Former Member
0 Kudos

Venkat,

I want the table to be empty when I reenter the View.

I am binding the table to the Model node.