Implementation Ideas on using Popups Return Value

84 views
Skip to first unread message

sebth

unread,
Apr 13, 2012, 11:32:31 AM4/13/12
to InterSystems: Zen Community
Hi everybody,

I have a popup which is displayed under different circumstances. This
Popup return a Value of a user taken action. I´ve already
"implemented" the onPopupAction(popupName, action, value). This works
but setting a value into a page component is not that what i´d like to
do.

Event occurs -> Popup is Displayed -> User click on Button in the
Popup -> the parent Window is notified on the PopupAction -> Capture
the Value... here is an example of what i am think about.

Method zenDoSomeThing() [ ZenMethod ] {

If condition = true {
&js<zenPage.jsOnShowDialog(evt);>

}

}

/// Display our own Dialog pass an Event
ClientMethod jsOnShowDialog(evt) [ Language = javascript ]
{
var parms = new Object();
parms.EVENT = 'FORMSAVECONFLICT';
zenPage.launchPopupWindow(zenLink('nwP.ZEN.Dialog.UserDialog.cls'),

'FORMSAVECONFLICT','status,scrollbars,resizable,width=500,height=300',parms);
}

/// if the event is received
ClientMethod onPopupAction(popupName, action, value) [ Language =
javascript ]
{
/// I dont want to call different methods based on the value wich is
returned on the popupvalue
}

Is it possible to gather the Information onPopupAction() and use it
direct in zenDoSomeThing()?

Regards, Sebastian

Vlado

unread,
Apr 13, 2012, 1:11:40 PM4/13/12
to intersys...@googlegroups.com
Although it is not fully clear for me what you are trying to do here is an example
which maybe will help you something.Generally in  onPopupAction method
you can do what you want:
==========================================================================
ClientMethod onPopupAction(popupName, action, value) [ Language = javascript ]
{
  switch(popupName) {
case 'Klienti':
if (action == "ok") this.showDetailsKlienti(value);
break;
case 'NDok':
if (action == "ok") this.showDetailsNDok(value);
break;
case 'Izdeliq':
if (action == "ok") this.showDetailsIzdeliq(value);
break;
  case 'Ambalaz':
if (action == "ok") this.showDetailsAmbalaz(value);
break;
  case 'Material':
if (action == "ok") this.showDetailsMaterial(value);
break;
case 'Usluga':
if (action == "ok") this.showDetailsUsluga(value);
break;
  }
}
----------------------------------------------------------------------------------------------------------------------------
ClientMethod showDetailsKlienti(id1) [ Language = javascript ]
{
var controller zen('ctrlParent');
var controller1 zen('source1');
controller1.setProperty('modelId',id1);

var nomer=controller1.getDataByName('Nomer');
var name=controller1.getDataByName('Name');
var danachenNomer=controller1.getDataByName('DanachenNomer');

zen('NomerKlient').setValue(nomer);
zen('NameKlient').setValue(name);
zen('DanachenNomer').setValue(danachenNomer);

controller.setDataByName('Klient',id1);
controller.setDataByName('NomerKlient',nomer);
controller.setDataByName('NameKlient',name);
controller.setDataByName('DanachenNomer',danachenNomer);
}

ClientMethod showDetailsNDok(id1) [ Language = javascript ]
{
var controller zen('source11');
controller.setProperty('modelId',id1);

var nomerNEK=controller.getDataByName('NomerNEK');
var dataNEK=controller.getDataByName('DataNEK');
zen('NomerDokument').setValue(nomerNEK);
zen('DataDokument').setValue(dataNEK);

var controller1 zen('ctrlChildren3');
controller1.setDataByName('IdNDok',id1);
alert('id1='+id1);
alert('ctrl1='+controller1.getDataByName('IdNDok'));
controller1.setDataByName('NomerDokument',nomerNEK);
controller1.setDataByName('DataDokument',dataNEK);
}
---------------------------------------------------------------------------------------------------------------------------------------- 

Here I call different methods like  this.showDetailsKlienti(value); 
but they could be implemented in  onPopupAction :

----------------------------------------------------------------------------------------------------------------------------------------
ClientMethod onPopupAction(popupName, action, value) [ Language = javascript ]
{
  switch(popupName) {
case 'Klienti':
if (action == "ok")
{var controller zen('ctrlParent');
var controller1 zen('source1');
controller1.setProperty('modelId',value);

var nomer=controller1.getDataByName('Nomer');
var name=controller1.getDataByName('Name');
var danachenNomer=controller1.getDataByName('DanachenNomer');

zen('NomerKlient').setValue(nomer);
zen('NameKlient').setValue(name);
zen('DanachenNomer').setValue(danachenNomer);

controller.setDataByName('Klient',value);
controller.setDataByName('NomerKlient',nomer);
controller.setDataByName('NameKlient',name);
controller.setDataByName('DanachenNomer',danachenNomer);}
break;
case 'NDok':
if (action == "ok" {....}
........
------------------------------------------------------------------------------------------------------------------------------
=============================================================== 
Also you can use ZenProxy Object to transfer all the data.

**Владо

sebth

unread,
Apr 13, 2012, 1:52:27 PM4/13/12
to InterSystems: Zen Community
Hey Vlado thanks for the samples,

in my Case the Popup will be shown if a Event occurs. So i need to
call the jsOnShowDialog() first. The Popup open, the user click a
button (which is the popups event).The parent page (who called the
popup) received the event via onPopupAction(). This is a JS Method -
now I need to call a zenmethod and pass the received event - this
method (zenAnalyzeEvent) need this event parameter and another one
which can only be passed by zenDoSomeThing() method which originally
call the popup... i think this is a bad behaviour,

Based on the above explanation i hope it is clear what i mean. What
would be the best design to have not 3 methods to gather and process
the single value passed from the popup. I need the event value from
the Popup in the zenDoSomeThing() method.

Regards, Sebastian

Vlado

unread,
Apr 13, 2012, 3:13:09 PM4/13/12
to intersys...@googlegroups.com
It should be:

&js<var value=zenPage.jsOnShowDialog('#(evt)#');
 
and 
ClientMethod onPopupAction(popupName, action, value) [ Language = javascript ]
{
.......

return value;
}
but you will have problem with the  synchronizing.

The other way is to use event value(evt) as  popupName :

zenPage.launchPopupWindow(zenLink('nwP.ZEN.Dialog.UserDialog.cls'), evt,'status,scrollbars,resizable,width=500,height=300',parms); 
}  
(changed  'FORMSAVECONFLICT'  with evt)
and go with my example where you will do everything in  onPopupAction 
So:

switch(popupName) {
case 'Event1'
case 'Event2'
.... 

**Владо

Sebastian Thiele

unread,
Apr 13, 2012, 3:35:54 PM4/13/12
to intersys...@googlegroups.com

Ah ok but using the var value = ... only may it available in ethisch block but i News it in the enclosing zenmethod

Erhards Sebastian

--
You received this message because you are subscribed to the Google Groups "InterSystems: Zen Community" group.
To post to this group, send email to InterSys...@googlegroups.com
To unsubscribe from this group, send email to InterSystems-Z...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/InterSystems-ZEN?hl=en
Zen Community Terms and Conditions: http://groups.google.com/group/InterSystems-ZEN/web/community-terms-and-conditions

Sebastian Thiele

unread,
Apr 13, 2012, 3:42:29 PM4/13/12
to intersys...@googlegroups.com

Ahh using smarthone Keyboard isnt that easy. Whatever i do i Need this mentioned zenmethos. But maybe this is the only way. One Idea... maybe onpopupaction could set a page property.

Sebastian

sebth

unread,
Apr 13, 2012, 3:53:26 PM4/13/12
to InterSystems: Zen Community
Consider this code:

Method zenSaveForm() [ ZenMethod ]
{
#Dim tRs As %ResultSet = ##class(%ResultSet).%New()



Set tQueryName= $CASE(..ReportParts,
"A":"QGetANormItems",
"B":"QGetBNormItems",
"C":"QGetCNormItems",
"A+B":"QGetABNormItems",
"A+B+C":"QGetABCNormItems",
"A+C":"QGetACNormItems",
"":$$$OK)

Set tStatement = ##class(%SQL.Statement).%New()
Set status = tStatement.
%PrepareClassQuery("nwP.MMR.Form.Item",tQueryName)
Set tRs = tStatement.%Execute(..Year,..CurrentForm)

Set tStorage = ##class(nwP.MMR.Data.Storage).
%OpenId(%session.Data("StorageID"))

While tRs.%Next(){
Set tItemId = tRs.%Get("ID")
Set ft = tRs.%Get("FieldType")
If ft="text"{ //nur normale Textwerte formatieren
Set tValue = ..getLogicValue(%page.
%GetComponentById(tItemId).value, tRs.%Get("ValueType"))
} Else {
Set tValue = %page.%GetComponentById(tItemId).value
}
Do tStorage.Content.SetAt(tValue, %page.
%GetComponentById(tItemId).id)
} Do tRs.%Close()

If $ZSTRIP(..SNAPSHOT,"*P") <
$ZSTRIP(tStorage.UpdateTSs.GetAt(..CurrentForm),"*P"){

/// At this point I call the show Dialog

&js<zenPage.jsOnShowDialog('FORMSAVECONFLICT');>

//// At this point I need the Action User choose
from the Dialog and distinguish the cases of the event


} Else {

Set ..SNAPSHOT = $ZDT($NOW(0),3,,6)
Do tStorage.UpdateTSs.SetAt( ..SNAPSHOT,..CurrentForm)
Set sc = tStorage.%Save()
&js<alert('Das Formular wurde erfolgreich zwischengespeichert!');>
}


For i=1:1:$L(..ComplexItemIDs,","){
Set componentID = $P(..ComplexItemIDs,",",i)
&js<

zenPage.getComponentById('#(componentID)#').getPage().zenSaveRecords();
>
}
Quit $$$OK
}

I hope i give you a better understanding of what i mean by pasting the
above code,

br,
Sebastian

On 13 Apr., 21:42, Sebastian Thiele <sebastian.thi...@live.de> wrote:
> Ahh using smarthone Keyboard isnt that easy. Whatever i do i Need this
> mentioned zenmethos. But maybe this is the only way. One Idea... maybe
> onpopupaction could set a page property.
>
> Sebastian
> Am 13.04.2012 21:36 schrieb "Sebastian Thiele" <sebastian.thi...@live.de>:
>
>
>
>
>
>
>
> > Ah ok but using the var value = ... only may it available in ethisch block
> > but i News it in the enclosing zenmethod
>
> > Erhards Sebastian
> > Am 13.04.2012 21:13 schrieb "Vlado" <viliyc...@earthlink.net>:
>
> >> It should be:
>
> >> &js<var value=zenPage.jsOnShowDialog('#(evt)#');
>
> >> and
> >> ClientMethod onPopupAction(popupName, action, value) [ Language =
> >> javascript ]
> >> {
> >> .......
>
> >> return value;
> >> }
> >> but you will have problem with the  synchronizing.
>
> >> The other way is to use event value(evt) as  popupName :
>
> >> zenPage.launchPopupWindow(**zenLink('nwP.ZEN.Dialog.**
> >> UserDialog.cls'), evt,'status,**scrollbars,resizable,width=**
> >>> > ==============================**==============================**==============
>
> >>> > ClientMethod onPopupAction(popupName, action, value) [ Language =
> >>> > javascript ]
> >>> > {
> >>> >   switch(popupName) {
> >>> > case 'Klienti':
> >>> > if (action == "ok") this.showDetailsKlienti(value)**;
> >>> > break;
> >>> > case 'NDok':
> >>> > if (action == "ok") this.showDetailsNDok(value);
> >>> > break;
> >>> > case 'Izdeliq':
> >>> > if (action == "ok") this.showDetailsIzdeliq(value)**;
> >>> > break;
> >>> >   case 'Ambalaz':
> >>> > if (action == "ok") this.showDetailsAmbalaz(value)**;
> >>> > break;
> >>> >   case 'Material':
> >>> > if (action == "ok") this.showDetailsMaterial(**value);
> >>> > break;
> >>> > case 'Usluga':
> >>> > if (action == "ok") this.showDetailsUsluga(value);
> >>> > break;
> >>> >   }}
>
> >>> > ------------------------------**------------------------------**
> >>> ------------------------------**------------------------------**----
> >>> > ClientMethod showDetailsKlienti(id1) [ Language = javascript ]
> >>> > {
> >>> > var controller = zen('ctrlParent');
> >>> > var controller1 = zen('source1');
> >>> > controller1.setProperty('**modelId',id1);
>
> >>> > var nomer=controller1.**getDataByName('Nomer');
> >>> > var name=controller1.**getDataByName('Name');
> >>> > var danachenNomer=controller1.**getDataByName('DanachenNomer')**;
>
> >>> > zen('NomerKlient').setValue(**nomer);
> >>> > zen('NameKlient').setValue(**name);
> >>> > zen('DanachenNomer').setValue(**danachenNomer);
>
> >>> > controller.setDataByName('**Klient',id1);
> >>> > controller.setDataByName('**NomerKlient',nomer);
> >>> > controller.setDataByName('**NameKlient',name);
> >>> > controller.setDataByName('**DanachenNomer',danachenNomer);
>
> >>> > }
>
> >>> > ClientMethod showDetailsNDok(id1) [ Language = javascript ]
> >>> > {
> >>> > var controller = zen('source11');
> >>> > controller.setProperty('**modelId',id1);
>
> >>> > var nomerNEK=controller.**getDataByName('NomerNEK');
> >>> > var dataNEK=controller.**getDataByName('DataNEK');
> >>> > zen('NomerDokument').setValue(**nomerNEK);
> >>> > zen('DataDokument').setValue(**dataNEK);
>
> >>> > var controller1 = zen('ctrlChildren3');
> >>> > controller1.setDataByName('**IdNDok',id1);
> >>> > alert('id1='+id1);
> >>> > alert('ctrl1='+controller1.**getDataByName('IdNDok'));
> >>> > controller1.setDataByName('**NomerDokument',nomerNEK);
> >>> > controller1.setDataByName('**DataDokument',dataNEK);}
>
> >>> > ------------------------------**------------------------------**
> >>> ------------------------------**------------------------------**----------------
>
> >>> > Here I call different methods like  this.showDetailsKlienti(**value);
> >>> > but they could be implemented in  onPopupAction :
>
> >>> > ------------------------------**------------------------------**
> >>> ------------------------------**------------------------------**----------------
>
> >>> > ClientMethod onPopupAction(popupName, action, value) [ Language =
> >>> > javascript ]
> >>> > {
> >>> >   switch(popupName) {
> >>> > case 'Klienti':
> >>> > if (action == "ok")
> >>> > {var controller = zen('ctrlParent');
> >>> > var controller1 = zen('source1');
> >>> > controller1.setProperty('**modelId',value);
>
> >>> > var nomer=controller1.**getDataByName('Nomer');
> >>> > var name=controller1.**getDataByName('Name');
> >>> > var danachenNomer=controller1.**getDataByName('DanachenNomer')**;
>
> >>> > zen('NomerKlient').setValue(**nomer);
> >>> > zen('NameKlient').setValue(**name);
> >>> > zen('DanachenNomer').setValue(**danachenNomer);
>
> >>> > controller.setDataByName('**Klient',value);
> >>> > controller.setDataByName('**NomerKlient',nomer);
> >>> > controller.setDataByName('**NameKlient',name);
> >>> > controller.setDataByName('**DanachenNomer',danachenNomer);**}
> >>> > break;
> >>> > case 'NDok':
> >>> > if (action == "ok")  {....}
> >>> > ........
> >>> > ------------------------------**------------------------------**
> >>> ------------------------------**------------------------------**------
> >>> > ==============================**==============================**===
> >>> > Also you can use ZenProxy Object to transfer all the data.
>
> >>> > **Владо
>
> >>> > On Friday, April 13, 2012 8:32:31 AM UTC-7, sebth wrote:
>
> >>> > > Hi everybody,
>
> >>> > > I have a popup which is displayed under different circumstances.
> >>> This
> >>> > > Popup return a Value of a user taken action. I´ve already
> >>> > > "implemented" the onPopupAction(popupName, action, value). This
> >>> works
> >>> > > but setting a value into a page component is not that what i´d like
> >>> to
> >>> > > do.
>
> >>> > > Event occurs -> Popup is Displayed -> User click on Button in the
> >>> > > Popup -> the parent Window is notified on the PopupAction -> Capture
> >>> > > the Value... here is an example of what i am think about.
>
> >>> > > Method zenDoSomeThing() [ ZenMethod ] {
>
> >>> > > If condition = true {
> >>> > >  &js<zenPage.jsOnShowDialog(**evt);>
>
> >>> > >  }
>
> >>> > > }
>
> >>> > > /// Display our own Dialog pass an Event
> >>> > > ClientMethod jsOnShowDialog(evt) [ Language = javascript ]
> >>> > > {
> >>> > >   var parms = new Object();
> >>> > >   parms.EVENT = 'FORMSAVECONFLICT';
> >>> > >   zenPage.launchPopupWindow(**zenLink('nwP.ZEN.Dialog.**UserDialog.cls'),
>
> >>> > > 'FORMSAVECONFLICT','status,**scrollbars,resizable,width=**500,height=300',parms);
>
> >>> > > }
>
> >>> > > /// if the event is received
> >>> > > ClientMethod onPopupAction(popupName, action, value) [ Language =
> >>> > > javascript ]
> >>> > > {
> >>> > >  /// I dont want to call different methods based on the value wich
> >>> is
> >>> > > returned on the popupvalue
> >>> > > }
>
> >>> > > Is it possible to gather the Information onPopupAction() and use it
> >>> > > direct in zenDoSomeThing()?
>
> >>> > > Regards, Sebastian
>
> >>  --
> >> You received this message because you are subscribed to the Google Groups
> >> "InterSystems: Zen Community" group.
> >> To post to this group, send email to InterSys...@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> InterSystems-Z...@googlegroups.com
> >> For more options, visit this group at
> >>http://groups.google.com/group/InterSystems-ZEN?hl=en
> >> Zen Community Terms and Conditions:
> >>http://groups.google.com/group/InterSystems-ZEN/web/community-terms-a...
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "InterSystems: Zen Community" group.
> > To post to this group, send email to InterSys...@googlegroups.com
> > To unsubscribe from this group, send email to
> > InterSystems-Z...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/InterSystems-ZEN?hl=en
> > Zen Community Terms and Conditions:
> >http://groups.google.com/group/InterSystems-ZEN/web/community-terms-a...

Vlado

unread,
Apr 13, 2012, 4:59:01 PM4/13/12
to intersys...@googlegroups.com
You can pass the value using:

Property MyValue As %String;

ClientMethod onPopupAction(popupName, action, value) [ Language = javascript ]
{
this.MyValue=value;
}

and 
Method zenDoSomeThing() [ ZenMethod ]
{
   &js<var x=zenPage.jsOnShowDialog('#(evt)#');>
 set value=%page.MyValue
}
** Владо
> >> To post to this group, send email to InterSystems-ZEN@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> For more options, visit this group at
> >>http://groups.google.com/group/InterSystems-ZEN?hl=en
> >> Zen Community Terms and Conditions:
> >>http://groups.google.com/group/InterSystems-ZEN/web/community-terms-a...
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "InterSystems: Zen Community" group.
> > To post to this group, send email to InterSystems-ZEN@googlegroups.com
> > To unsubscribe from this group, send email to

sebth

unread,
Apr 14, 2012, 4:14:52 AM4/14/12
to InterSystems: Zen Community
Hey Vlado,

i did so - but i guess the synchronisation problem still exist...
sometime the popup won´t open and sometimes it opens but reports the
wrong value to the parent window.
Sebastian
> ...
>
> Erfahren Sie mehr »

sebth

unread,
Apr 14, 2012, 7:08:48 AM4/14/12
to InterSystems: Zen Community
After some investigation - the Popup returns the correct event in the
onPopupAction method. Setting this.MyValue=value; also work, but if i
try to use MyValue in the zenmethod it is still empty. So i can´t use
it.
> ...
>
> Erfahren Sie mehr »

Vlado

unread,
Apr 14, 2012, 12:37:10 PM4/14/12
to intersys...@googlegroups.com
Definitely this is synchronisation problem.

What do you have in the popupWindow?
Can you make the selection on the same page without
using popupWindow and rid from javascript,so the whole method will be in COS.

Another way would be to divide  the method zenSaveForm() on 2 pieces if it's possible
and call it from java script something like:

ClientMethod saveForm() [ Language = javascript ]
{
     var x=zenPage.zenSaveForm1()
     var x=zenPage.jsOnShowDialog('FORMSAVECONFLICT');
     var x=zenPage.zenSaveForm2() 
}
You have to take care about passing of some variables you have.

Also you can try additional synchronization:

var tCurrentMode = zenSynchronousMode; 
zenSynchronousMode = true;  
....
zenSynchronousMode = tCurrentMode; 
**Владо 

Roberto

unread,
Apr 14, 2012, 5:18:20 PM4/14/12
to intersys...@googlegroups.com
Seb,

Can you post your actual code?

Maybe someone here can give you advice based on your code.

-Roberto

Vlado

unread,
Apr 14, 2012, 7:01:25 PM4/14/12
to intersys...@googlegroups.com
Seb,
Actually here there is logical problem.
It is not good to make selection in the middle of saving process.
First you have to make selections(prepare all data) and after
that simple save only.So separate the things.If you need
add button to invoke the popupWindow.
**Владо

sebth

unread,
Apr 15, 2012, 9:28:23 AM4/15/12
to InterSystems: Zen Community
I did the redesing of the methods here is the code.

/// Check for CLIENT SNAPSHOT AGAINGT CURRENT SERVER SNAPSHOT
Method zenBeforeSaveForm() [ ZenMethod ]
{
Set tStorage = ##class(nwP.MMR.Data.Storage).
%OpenId(%session.Data("StorageID"))
Set tBool = $ZSTRIP(..SNAPSHOT,"*P") <
$ZSTRIP(tStorage.UpdateTSs.GetAt(..CurrentForm),"*P")

If tBool = 1{
&js<zenPage.jsOnShowDialog('FORMSAVECONFLICT',1);>
} ElseIf tBool = 0 {
Do %page.zenSaveForm()
}
Quit $$$OK
}

/// realy save
Method zenSaveForm() [ ZenMethod ]
{
...
Quit $$$OK
}



/// Display our own Dialog pass an Event
ClientMethod jsOnShowDialog(evt,bool) [ Language = javascript ]
{
if (bool == 1){
var parms = new Object();
parms.EVENT = evt;

var action =
zenPage.launchPopupWindow(zenLink('nwP.ZEN.Dialog.UserDialog.cls'),

'FORMSAVECONFLICT','status,scrollbars,resizable,width=500,height=300',parms);

alert('js: ' + action); //BUT ACTION IS STILL UNDEFINED

switch (action){
case 'YES':
//realy save
zenPage.zenSaveForm();
break;
case 'NO':
//do nothing
break;
case 'THROW':
//throw Client Values reload the entire Form
zenPage.zenLoadFormById(this.CurrentForm,'',1);
break;
default:
}
}
}

/// If the Popup return an value from the Client return it to caller
ClientMethod onPopupAction(popupName, action, value) [ Language =
javascript ]
{
if (popupName == 'FORMSAVECONFLICT'){
return value;
}
}

Since im not able to capture "action" it is not possible to call the
correct methods...

Maybe you have an Idea on that?
Sebastian
> ...
>
> Erfahren Sie mehr »

Roberto Cahanap

unread,
Apr 15, 2012, 12:24:49 PM4/15/12
to intersys...@googlegroups.com

I see what the problem is Seb.

I will pose a response later day.

-Roberto

Sent from the HTC EVO 3D

--
You received this message because you are subscribed to the Google Groups "InterSystems: Zen Community" group.
To post to this group, send email to InterSys...@googlegroups.com
To unsubscribe from this group, send email to InterSystems-Z...@googlegroups.com

For more options, visit this group at http://groups.google.com/group/InterSystems-ZEN?hl=en

Vlado

unread,
Apr 15, 2012, 12:31:59 PM4/15/12
to intersys...@googlegroups.com
Try something like:
ClientMethod firstMethod() [ Language = javascript ]
{
 
var tBool=zenPage.zenBeforeSaveForm()
if (tBool==1){
var x=zenPage.jsOnShowDialog('FORMSAVECONFLICT',1);}
else{zenPage.zenSaveForm()}

}

/// Check for CLIENT SNAPSHOT AGAINGT CURRENT SERVER SNAPSHOT
Method zenBeforeSaveForm() As %String [ ZenMethod ]
{
 
        Set tStorage = ##class(nwP.MMR.Data.Storage).%OpenId(%session.Data("StorageID"))
        Set tBool = $ZSTRIP(..SNAPSHOT,"*P") <$ZSTRIP(tStorage.UpdateTSs.GetAt(..CurrentForm),"*P")
        Quit tBool
To post to this group, send email to InterSystems-ZEN@googlegroups.com
To unsubscribe from this group, send email to InterSystems-ZEN-unsubscribe@googlegroups.com

sebth

unread,
Apr 15, 2012, 2:52:26 PM4/15/12
to InterSystems: Zen Community
Vlado,

I´ve examined some examples in the SAMPLES NS. They process the event
in the onPopupAction() Method - this is what i do know and it works.

Thanks for your Help,

Sebastian

On 15 Apr., 18:31, Vlado <viliyc...@earthlink.net> wrote:
> Try something like:
> ClientMethod firstMethod() [ Language = javascript ]
> {
>
> var tBool=zenPage.zenBeforeSaveForm()
> if (tBool==1){
> var x=zenPage.jsOnShowDialog('FORMSAVECONFLICT',1);}
> else{zenPage.zenSaveForm()}
>
> }
>
> /// Check for CLIENT SNAPSHOT AGAINGT CURRENT SERVER SNAPSHOT
> Method zenBeforeSaveForm() As %String [ ZenMethod ]
> {
>
>         Set tStorage = ##class(nwP.MMR.Data.Storage).%OpenId(%session.Data(
> "StorageID"))
>         Set tBool = $ZSTRIP(..SNAPSHOT,"*P") <$ZSTRIP(tStorage.UpdateTSs.
> GetAt(..CurrentForm),"*P")
>         Quit tBool
>
>
>
>
>
>
>
> }
> On Sunday, April 15, 2012 9:24:49 AM UTC-7, Roberto wrote:
>
> > I see what the problem is Seb.
>
> > I will pose a response later day.
>
> > -Roberto
>
> > Sent from the HTC EVO 3D
> ...
>
> Erfahren Sie mehr »

Roberto

unread,
Apr 15, 2012, 10:32:10 PM4/15/12
to intersys...@googlegroups.com
Oh good, you got it working. No need for me to response then.

-Roberto

sebth

unread,
Apr 16, 2012, 5:04:16 AM4/16/12
to InterSystems: Zen Community
Yes,

but I am still interessting in your solution Roberto,

Regards,
Sebastian
> ...
>
> Erfahren Sie mehr »
Reply all
Reply to author
Forward
0 new messages