Page 1 of 2 1 2 >
Topic Options
Rate This Topic
#135205 - 08/23/06 08:45 AM Refreshing field after dialog window closes
remedybuff Offline
Stealth Member

Registered: 05/05/06
Posts: 76
Loc: New Jersey, USA
Hi,

I have a button on a form which opens up a dialog window and the fields in the dialog window are filled from the form which has the button. One of the fields in both the forms is a date/time field.

When I change the date/time field in the dialog window (and click OK in dialog window), I need those changes to be reflected in the form from which the dialog was invoked, as soon as the dialog window is closed.

Passing events is not working with 6.3 (Also, I think passing events is not supported with dialog windows as they are modal).

Any other way, that I could refresh the field in my main form as soon as the dialog window is closed? Any workarounds?

Any suggestions would be appreciated.

Thanks,

Anuj.

Top
#135206 - 08/23/06 08:51 AM Re: Refreshing field after dialog window closes [Re: remedybuff]
Vincent_RIEDWEG Offline

Old Hand
****

Registered: 05/24/05
Posts: 1454
Loc: France
Hi,

You can use On Close mapping in the Open Window action associated with Commit.
_________________________
Vincent.

Top
#135207 - 08/23/06 08:59 AM Re: Refreshing field after dialog window closes [Re: Vincent_RIEDWEG]
remedybuff Offline
Stealth Member

Registered: 05/05/06
Posts: 76
Loc: New Jersey, USA
Hi Vincent,

I think that will refresh the contents in the dialog window...

I would like to refresh the contents in the window from which the dialog was invoked...

Anuj.

Top
#135208 - 08/23/06 09:11 AM Re: Refreshing field after dialog window closes [Re: Vincent_RIEDWEG]
Vincent_RIEDWEG Offline

Old Hand
****

Registered: 05/24/05
Posts: 1454
Loc: France
Quote:
You can use On Close mapping in the Open Window action associated with Commit.


Try it and enjoy
_________________________
Vincent.

Top
#135209 - 08/23/06 09:12 AM Re: Refreshing field after dialog window closes [Re: remedybuff]
remedybuff Offline
Stealth Member

Registered: 05/05/06
Posts: 76
Loc: New Jersey, USA
From the dialog window, I do a push fields, commit changes and a close window action...

But after pushing the fields to the main form from the dialog window, how do I refresh the field on the main form..

I want to see the reflected changes in the main form as soon as the dialog window is closed...

Any help would be appreciated..

Thanks,

Anuj.

Top
#135212 - 08/23/06 09:39 AM Re: Refreshing field after dialog window closes [Re: remedybuff]
thwe Offline
Stealth Member

Registered: 03/11/04
Posts: 188
Loc: Germany
If you do not have the need to save the data to database then remove the push fields and define a mapping for "On Close" in your Window Open action as Vincent sayed.

If the push fields is necessary and the data you need is not fully aviable in the dialog include a set field after the window open action (on the form where you invoke the window open action).

Top
#135214 - 08/23/06 10:24 AM Re: Refreshing field after dialog window closes [Re: thwe]
remedybuff Offline
Stealth Member

Registered: 05/05/06
Posts: 76
Loc: New Jersey, USA
Vincent and thwe, thanks for the replies..

Now, I need to do a run process action on the field that is modified... for. eg. if i modified the date/time field in the dialog window, the changes will be seen in the parent window, if I open the parent window in the 'on close' active link of the dialog (as mentioned in the replies).. But how do i detect that there was a change in the date/time field in the parent window so that I can do the 'run process' action?

On what active link do I call a run process action...

I would appreciate your reply..

Thanks,

Anuj.

Top
#135216 - 08/23/06 10:36 AM Re: Refreshing field after dialog window closes [Re: remedybuff]
Vincent_RIEDWEG Offline

Old Hand
****

Registered: 05/24/05
Posts: 1454
Loc: France
Hi,

Use a temporary Date/Time field in your parent Window and use this field in the On Close mapping instead of the original Date/Time field.

Then, after you Open Window action in your parent form verify if the original Date/Time field is different than your temporary Date/Time field.

If it's different, copy the new value in your original Date/Time field and run your process...
_________________________
Vincent.

Top
#135218 - 08/23/06 11:58 AM Re: Refreshing field after dialog window closes [Re: Vincent_RIEDWEG]
remedybuff Offline
Stealth Member

Registered: 05/05/06
Posts: 76
Loc: New Jersey, USA
Vincent, thank you very much for the reply.

I did as u suggested, and now i have a temporary date/time field..

I have an active link which check if the temporary field is different from the original date/time field which executes on display. If different, i use a set fields, commit and run process actions.

But the thing is that when I use the run process action, it takes the old value from the original date/time field, not the new value that I set from the temporary field using the set fields action, even when I commit the changes after the set fields.

Any suggestions?

Thanks,

Anuj.

Top
#135219 - 08/23/06 12:00 PM Re: Refreshing field after dialog window closes [Re: remedybuff]
Vincent_RIEDWEG Offline

Old Hand
****

Registered: 05/24/05
Posts: 1454
Loc: France
Which process do you run?
_________________________
Vincent.

Top
#135220 - 08/23/06 12:03 PM Re: Refreshing field after dialog window closes [Re: Vincent_RIEDWEG]
remedybuff Offline
Stealth Member

Registered: 05/05/06
Posts: 76
Loc: New Jersey, USA
Its a java process, that I call using the bat script by providing the path in the command line..

for eg. C:/j2sdk1.4.2_11/bin/...... (arguments)

Top
#135221 - 08/23/06 12:16 PM Re: Refreshing field after dialog window closes [Re: remedybuff]
Vincent_RIEDWEG Offline

Old Hand
****

Registered: 05/24/05
Posts: 1454
Loc: France
Ok, your process isn't an internal one's. Then, you need to save the new value to the database after you Set Field and before your Run Process. You can do the following's :

1 - Update just the Date/Time field by an update in Direct SQL.
2 - Push just this Date/Time field using a Push Field. This will update too the system fields modification date and modified by.
3 - Use a Commit (your choice) to update all modified values in the database.
_________________________
Vincent.

Top
#135222 - 08/23/06 01:09 PM Re: Refreshing field after dialog window closes [Re: Vincent_RIEDWEG]
remedybuff Offline
Stealth Member

Registered: 05/05/06
Posts: 76
Loc: New Jersey, USA
Are you saying i push the values to the same form? Also, should I push the same field to itself?

Also, could you please give me some idea as to how the update statement will look like?

Thanks

Top
#135223 - 08/23/06 01:43 PM Re: Refreshing field after dialog window closes [Re: remedybuff]
Vincent_RIEDWEG Offline

Old Hand
****

Registered: 05/24/05
Posts: 1454
Loc: France
Yes, you need to push this field into itself in the same form and in the same record. You push this field to modify the current record.

SQL example :
update view_name_of_the_form set name_of_date_time_field_in_view=$temp_integer$ where request_id='$Request ID$'

But, you need to set the Date/Time field in a temporary Integer field before the SQL.
_________________________
Vincent.

Top
#135232 - 08/24/06 08:57 AM Re: Refreshing field after dialog window closes [Re: Vincent_RIEDWEG]
remedybuff Offline
Stealth Member

Registered: 05/05/06
Posts: 76
Loc: New Jersey, USA
Hi,

I am now able to achieve what I wanted to,but I did it a different way. I tried using the SQL statement, but I think I was doing something wrong..Here is the Direct SQL statement I used,

update Default_Admin_View set Schedule_time = $temp_Schedule$ where request_id='$Request ID$'

But I get the error saying, "error near the end of SQL statement". I didnt quite get it.

Anyway, I used another hidden field as a qualification for my workflow, instead of using the original date/time field. So, instead of checking for modifications in the original date/time field, I check this new hidden field for qualification.

But here is the thing, when I close the dialog box and everything runs OK, I still have to click "Save" on the main form to store the changes that have happened.

For eg. the new qualification field is set to 1 if there was a change in the original date/time field else 0. Now, if I make a change in the dialog window, and close the window, the original date/time field is updated and the qualification field is set to 1. But if I do not "Save" the updated record in the main form and log back in again without saving, the original date/time field is set back to the old value, not to the new value that was updated in the dialog window last time..

Is there any way by which I could automatically save when I close the dialog window..?? (Commit doesnt seem to work here)

Thanks,

Anuj.

Top
#135233 - 08/24/06 09:01 AM Re: Refreshing field after dialog window closes [Re: remedybuff]
Vincent_RIEDWEG Offline

Old Hand
****

Registered: 05/24/05
Posts: 1454
Loc: France
Originally Posted By: anujtuli
update Default_Admin_View set Schedule_time = $temp_Schedule$ where request_id='$Request ID$'


it isn't Default_Admin_View, but the name of the view associated with this form in the database...
_________________________
Vincent.

Top
#135234 - 08/24/06 09:03 AM Re: Refreshing field after dialog window closes [Re: Vincent_RIEDWEG]
remedybuff Offline
Stealth Member

Registered: 05/05/06
Posts: 76
Loc: New Jersey, USA
oops sorry.. but I do not have access to the database on the server....

Is there any other way to know the view name apart from going to the database?

Top
#135235 - 08/24/06 09:11 AM Re: Refreshing field after dialog window closes [Re: remedybuff]
Vincent_RIEDWEG Offline

Old Hand
****

Registered: 05/24/05
Posts: 1454
Loc: France
Yes,

You replace all not a-z or not 0-9 characters by _.

Then you need to truncate the result to just the first 30 characters.

In some cases (for similar and long forms names), you need to specify the schemaid at the end.
_________________________
Vincent.

Top
#135236 - 08/24/06 09:14 AM Re: Refreshing field after dialog window closes [Re: Vincent_RIEDWEG]
remedybuff Offline
Stealth Member

Registered: 05/05/06
Posts: 76
Loc: New Jersey, USA
So, if my form name was CHG:MyForm, it will become CHG_MyForm, right?

Will try it out...

One other thing I mentioned in my previous post was the ability to save automatically..

Any ideas for that?

Thanks,

Anuj.


Edited by anujtuli (08/24/06 09:16 AM)

Top
#135237 - 08/24/06 09:26 AM Re: Refreshing field after dialog window closes [Re: remedybuff]
Vincent_RIEDWEG Offline

Old Hand
****

Registered: 05/24/05
Posts: 1454
Loc: France
Originally Posted By: anujtuli
Is there any way by which I could automatically save when I close the dialog window..?? (Commit doesnt seem to work here)


Yes, using SQL or Push Field...

yes, it's chg_myform...

It's the same rule used for field names in the view...
_________________________
Vincent.

Top
Page 1 of 2 1 2 >