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

Tagged:

Comments

  • 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?

  • 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...

  • Here is the sample I promised...

  • simply superb klewis.

    It's working good.

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

  • 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.

     

     

    

  • 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.

  • 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?

  • 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.)

  • 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!

  • Hi,

    i have the similar problem then Thiru but in my case i would like to display data on my Grid with some data.
    In my form i have field, button and grid.
    Now i would like to display data when the user enters text (text is then stored in local variable) and when the user press button Find. In that instance the grid should display data.

    My property on BO which grid uses is on "Always refresh", grid has set "field is dependants on another", the text field where the user write some text is set to "field has dependants of its own".

    When i run the form and enter the text, my Grid doesn't fill with data. I'm using v9.3.2.

  • Hi Damjan,

    I've created a solution named GridParamTest which has a form with a field, button and grid as you described. I've been able to populate the grid successfully. I tested this using MBPM version 9.4 and I hope that it helps you.

    It requires the following table definition:

    CREATE TABLE GridTestTable ( ColOne NVARCHAR(250) NULL, ColTwo NVARCHAR(250) NULL );

    Of course Oracle would use NVARCHAR2 instead.

    The solution has been copied to the Open Text Knowledge Center:

    http://mimage.opentext.com/support/ecm/secure/patches/bps/bpm/special/communnity/gridparamtest.zip

    If you don't already have a log in for the KC, I think it's possible to create one. Please let me know if you have any problems.

    Thanks very much, best wishes,

    Louise.