spacer
cornerspacercorner
Reply
Advisor
Tworld
Posts: 22
Registered: 06-21-2010
0 Kudos
Accepted Solution

populate values in grid on a button click

Hi…All,

Can it be possible to populate grid with some values when we click on a command button?

 

Ex: I have one database which contains some data.I have to fetch that data in to business object basing on two or more search criterias(ex:name,starting letter….etc).That data should be assigned to grid when we click on a command button.The grid should be empty before button click and the data should be populated on to the grid after button click. I have done with process variables and local variables.I get find them in the todolist.But it is not possible in blank forms itself.

Please let me know where I am doing wrong…..

Please put one solution which will be useful to me……

 

Thanks,

Thiru

Regular Advisor
BMellert
Posts: 153
Registered: 05-21-2010
0 Kudos

Re: populate values in grid on a button click

Just guessing based upon the screen print and what I believe you are looking to accomplish.

Is your BO using parameters?  And are your local variables being passed in as the parameters to your BO?

Employee
klewis
Posts: 109
Registered: 05-17-2010

Re: populate values in grid on a button click

Firstly -- yes -- populating a grid with a button click is very possible (in fact, frequently done).

 

I'll throw together a sample solution and will post it here but wanted to quickly reply with two "gotchas" to watch out for.

 

1.  Make sure that your grid's properties are set to "be dependent"

 

2.  Make sure that the Business Object that your grid is populated from is a "Query" type BO and that it is set to "Always Refresh" -- this is done from the Data Access dialog for your form.  Right click on the BO and select Always Refresh.

 

With those two things done, the only other thing to be sure of is that your command button is successfully inserting data into the table that the Bus Object is querying.

 

Sample coming soon...

Employee
klewis
Posts: 109
Registered: 05-17-2010
0 Kudos

Re: populate values in grid on a button click

Here is the sample I promised...

Advisor
Tworld
Posts: 22
Registered: 06-21-2010
0 Kudos

Re: populate values in grid on a button click

simply superb klewis.

It's working good.

Thank you klewis.....Thank you very  much..

Visitor
MSNewbie
Posts: 3
Registered: 01-25-2011
0 Kudos

Re: populate values in grid on a button click

Hi,

 

I'm fairly new to Metastorm and i'm stuck on a similar issue. 

 

What I am trying to do is create an admin form where you can display archived forms.  (see attached image).  I want the results to be displayed in a grid and filtered depending on what the user selects in the two fields on the form.

 

You mentioned: "...is that your command button is successfully inserting data into the table that the BO is querying.."  Can you refresh the results the BO returns without having to insert into a table that the BO is querying?

 

My BO queries the eFolder table and I dont really want to be inserting/updating into that.

 

 



Regular Advisor
BMellert
Posts: 153
Registered: 05-21-2010
0 Kudos

Re: populate values in grid on a button click

Make the instance of the BO on the form (the one tied to your grid) to be always refresh.  Its parameters should be those on the form (the date an drop down).  You should also check the "Field is dependent on another" setting on the grid itself.

 

Once those are done, any time the refresh button is pressed, the grid contents will refresh.

Visitor
MSNewbie
Posts: 3
Registered: 01-25-2011
0 Kudos

Re: populate values in grid on a button click

Thanks! that worked, however if the parameter is blank then the results returned are not correct. I guess i'll have to work on the SQL query and maybe do a few IF checks... is this the best way?
Regular Advisor
BMellert
Posts: 153
Registered: 05-21-2010
0 Kudos

Re: populate values in grid on a button click

Guess that depends on how they are wrong.  It could be done with IF or possibly CASE or LIKE in the SQL itself depending on the results you are expecting with no values.  It is also possible to create "dynamic" SQL where the whole or part of the where clause is dynamic, but that is much more complicated to do in v9 than it was in v7.  (I do with dynamic SQL and default order by would be more easily supported in v9 within BOs.)

Visitor
MSNewbie
Posts: 3
Registered: 01-25-2011
0 Kudos

Re: populate values in grid on a button click

Thanks, I did manage to get it to do what i wanted in the end.  I tried dynamic SQL but it seemed a little long winded - you're right - not as easy as V7!

 

Thanks for your help!

line spacer line
spacerFollow Metastorm on:
spacer Twitter YouTube Blog iTunes LinkedIn Metastorm Community Central, MC2
spacer Copyright © 2011 OpenText Corporation. All Rights Reserved.spacer About Metastormspacer Privacyspacer Legalspacer Site Mapspacer RSSspacer Contact Us
Microsoft Gold Certified Partner
Powered by Windows Azure
line spacer line