cancel
Showing results for 
Search instead for 
Did you mean: 

Population of two rows into a table

Former Member
0 Kudos

Dear Forum,

Please have a look into the following problem.

The Criteria is -


In the view there will be a table with 2 columns. Whenever the application will run it will populate two rows. How to do this?

Plesae help me out.

Thanks & Regards,

Anindita

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hii,

Is your application fetching data from backend into table or you are simply populating it by coding.

Please make your requirements very specific so that i can help you out.

Former Member
0 Kudos

Hi,

In the table there are 2 columns (Name & Phone No.).

Two rows have to be populated through coding not from the backend.

Thanks & Regards,

Anindita

Former Member
0 Kudos

Hi anindita..

no problem

in view

in WdDoinit()

{

wdContext.currentContextElement().setSizeTable(2);

}

SizeTable should bind in Visiblerowcount property of Table.

are you getting or clarify more

Edited by: sudhir kumar on Mar 25, 2009 12:08 PM

pravesh_verma
Active Contributor
0 Kudos

Hi Anindita,

In wdDoint() write this code:


IPersonElement ele1 =  wdContext.nodePerson().createAndAddPersonElement();
ele1.setName("Anidita");
ele1.setPhoneNumber(1111111);
	  
IPersonElement ele2 =  wdContext.nodePerson().createAndAddPersonElement();
ele2.setName("Anidita 2");
ele2.setPhoneNumber(2222222);

I am assuming that the node name is Person and attribute names are:

1) Name

2) PhoneNumber

and Collection cardinality :0:n

Why I have asked you to write this code in wdDoInit() methos is because that will be called only once. In other case you can write this code in wdDoModify() as well, however in that case you have to write this code in firstTime check.



if(firstTime){
// same code as above
}

I hope this solves the issue. If you have any further issues please let me know.

Thanks and Regards,

Pravesh

Former Member
0 Kudos

suppose you have a

cardinality should be--0:n

value node---AndAddPerson.

value attribut--phonenumber,name.

WddoInit(){

IPersonElement ele1 = wdContext.nodePerson().createAndAddPersonElement();

ele1.setName("Anidita");

ele1.setPhoneNumber(111111222221);

wdContext.nodePerson().addElement(ele1);

ele1 = wdContext.nodePerson().createAndAddPersonElement();

ele1.setName("Anidita 2");

ele1.setPhoneNumber(22222222222);

wdContext.nodePerson().addElement(ele1);

//aslo put table size .what i given previous

//sizetable must be binding VISIBLEROWCOUNT property of table

wdContext.currentContextElement().setSizetable(2)

}

hope it will work

Edited by: sudhir kumar on Mar 25, 2009 12:33 PM

Edited by: sudhir kumar on Mar 25, 2009 12:35 PM

Former Member
0 Kudos

Hi Pravesh,

Thanks a lot.Ur answer has solved my problem.

Thanks & Regards,

Anindita

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Experts,

I have crated a table with 2 rows and Check box.

Now if I click the check box, the corresponding values(name & phone number) of that particular row will be shown on that page.

How to do? Please help.

Thanks & Regards,

Anindita

Former Member
0 Kudos

Hi

I hope you have written the code in the init() method , copy the code and paste it in the

onselect() event of the CheckBox. your problem gets solved .

murali

Former Member
0 Kudos

Hi anindita,

you ahve to crate one value attribut as sizetable should be integer

value node table--should binding your table source

direct created in view context -value attributesizetable

value attribute--sizetable

sizetable should binding to VISIBLEROWCOUNT property table in view

int size=wdContext.nodeTable().size(); as 2 your case

if(size=2)

wdContext.currentContextElement().setSizetable(2);

else

{

wdContext.currentContextElement().setSizetable(size);

}

thanks

jati

Edited by: sudhir kumar on Mar 25, 2009 11:55 AM