Skip to main content

unifacetriggers won't work twice in a row.

  • April 12, 2024
  • 6 replies
  • 52 views

Iain Sharp
Forum|alt.badge.img+5

As part of our slow migration from CS to DSP, I have a form with an HTML widget, (the only field painted). 

On the loaded DSP I have an attributes only field (button) with a call to unifaceTriggers in the onClick. This is supposed to call another instance which runs crystal reports and produces a print. The first click on this field performs the actions as appropriate. After which, none of the fields in the DSP are responsive. I can't type in text areas, I can (apparently) click one radio group, but the onChange is not fired, clicking the 'button' which just worked does nothing. 

To try and find the issue, the uniface trigger in the form is now 

askmess "Printing"
return 0

But the issue persists. 

The onclick trigger I am clicking is 

webtrigger onClick
javascript
	p=this.getParent();
	f=p.getField("PPV_PREP_ID");
	id=f.getValue();
	rpt=p.getInstance().getEntity("FILTERS.NOMODEL").getOccurrence(0).getField("D_REPORT_FILE").getValue()
	if (typeof window.unifaceTriggers === "function") { 
		window.unifaceTriggers("web_print",id,rpt)
	};
endjavascript
end

id and rpt are populated correctly, and the popup message appears the first time.  The mouse pointer after the click is arrow with circle (busy), and whilst I can get a textbos to show the focus border, I can't type in it.

Am I missing something in the javascript to reset the state somehow? 

I need to get this to work if we are going to be able to develop a hybrid system to bridge the 'modernisation' gap. 

Regards, 

Iain



------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------

6 replies

Iain Sharp
Forum|alt.badge.img+5
  • Author
  • Inspiring
  • April 12, 2024

As part of our slow migration from CS to DSP, I have a form with an HTML widget, (the only field painted). 

On the loaded DSP I have an attributes only field (button) with a call to unifaceTriggers in the onClick. This is supposed to call another instance which runs crystal reports and produces a print. The first click on this field performs the actions as appropriate. After which, none of the fields in the DSP are responsive. I can't type in text areas, I can (apparently) click one radio group, but the onChange is not fired, clicking the 'button' which just worked does nothing. 

To try and find the issue, the uniface trigger in the form is now 

askmess "Printing"
return 0

But the issue persists. 

The onclick trigger I am clicking is 

webtrigger onClick
javascript
	p=this.getParent();
	f=p.getField("PPV_PREP_ID");
	id=f.getValue();
	rpt=p.getInstance().getEntity("FILTERS.NOMODEL").getOccurrence(0).getField("D_REPORT_FILE").getValue()
	if (typeof window.unifaceTriggers === "function") { 
		window.unifaceTriggers("web_print",id,rpt)
	};
endjavascript
end

id and rpt are populated correctly, and the popup message appears the first time.  The mouse pointer after the click is arrow with circle (busy), and whilst I can get a textbos to show the focus border, I can't type in it.

Am I missing something in the javascript to reset the state somehow? 

I need to get this to work if we are going to be able to develop a hybrid system to bridge the 'modernisation' gap. 

Regards, 

Iain



------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------

It seems that even if I replace the contents of the onClick with a 'simple' prompt the behaviour persists. (One use of this field, and then the page behaves oddly (I can type in a textarea but it doesn't fire the onchange trigger, similarly clicking a radio group. When this is done and nothing is happening, the mouse goes to 'busy' but the 'processing' image is not displayed. 

webtrigger onClick
javascript
	let person = prompt("Please enter your name", "Harry Potter");
/*
	p=this.getParent();
	f=p.getField("PPV_PREP_ID");
	id=f.getValue();
	rpt=p.getInstance().getEntity("FILTERS.NOMODEL").getOccurrence(0).getField("D_REPORT_FILE").getValue()

	if (typeof window.unifaceTriggers === "function") { 
		window.unifaceTriggers("web_print",id,rpt)
	};
*/

endjavascript
end


------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------

Iain Sharp
Forum|alt.badge.img+5
  • Author
  • Inspiring
  • April 12, 2024

It seems that even if I replace the contents of the onClick with a 'simple' prompt the behaviour persists. (One use of this field, and then the page behaves oddly (I can type in a textarea but it doesn't fire the onchange trigger, similarly clicking a radio group. When this is done and nothing is happening, the mouse goes to 'busy' but the 'processing' image is not displayed. 

webtrigger onClick
javascript
	let person = prompt("Please enter your name", "Harry Potter");
/*
	p=this.getParent();
	f=p.getField("PPV_PREP_ID");
	id=f.getValue();
	rpt=p.getInstance().getEntity("FILTERS.NOMODEL").getOccurrence(0).getField("D_REPORT_FILE").getValue()

	if (typeof window.unifaceTriggers === "function") { 
		window.unifaceTriggers("web_print",id,rpt)
	};
*/

endjavascript
end


------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------

I have put a call in the print trigger on the form to the $widgetoperation for the HTML field. This calls a proc operation with public web which parses a field in the data and then calls a weboperation with this data which then in turn calls unifaceTriggers to pass the data back to the form to handle. This STILL causes the HTML page to lock up. THe debugger in devtools indicates that it's hitting a this.isblocked, but I can't work out what this is under these circumstances. 

I've now spent a full day banging away at this problem, and I have no way of understanding the problem, let alone fixing it. It seems that every time I poke the DSP/Mobile environment, I find something else which just seems to not work in crazy ways, and the support/documentation is between laughable and non-existant.

I am now going to revamp the whole thing to have the DSP store a print queue in the database, and then have the print run solely from the CS client, and hope that 'fixes' the issue. Its that or quit entirely and give the customer his money back.....

 



------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------

Hortion Gilles
Forum|alt.badge.img+2
  • Participating Frequently
  • April 12, 2024

I have put a call in the print trigger on the form to the $widgetoperation for the HTML field. This calls a proc operation with public web which parses a field in the data and then calls a weboperation with this data which then in turn calls unifaceTriggers to pass the data back to the form to handle. This STILL causes the HTML page to lock up. THe debugger in devtools indicates that it's hitting a this.isblocked, but I can't work out what this is under these circumstances. 

I've now spent a full day banging away at this problem, and I have no way of understanding the problem, let alone fixing it. It seems that every time I poke the DSP/Mobile environment, I find something else which just seems to not work in crazy ways, and the support/documentation is between laughable and non-existant.

I am now going to revamp the whole thing to have the DSP store a print queue in the database, and then have the print run solely from the CS client, and hope that 'fixes' the issue. Its that or quit entirely and give the customer his money back.....

 



------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------

Hi Iain,

Do you try to test with a simple DSP (only one painted field for exemple).

I remember a problem with DSP  (9.7.5 ?)  when a field (radio group)  was not correctly initialized , it could freeze the html page.

Cordialy,

Gilles



------------------------------
Hortion Gilles
Dedalus Healthcare France
Artigues Pres Bordeaux FR
------------------------------

MartinBall
  • New Participant
  • July 27, 2026

Hi Iain,

Interested to know if you managed to find a solution to this?

Am carrying out a similar task (ie. running DSPs within a CS application) so Ive a Form with an HTML widget painted on it. The HTML widget then displays a DSP that contains a DSP container. The outer DSP is a list (whereby clicking on a row updates the inner DSP). The buttons painted to the inner DSP all work only the outer DSP links then become useless following the action.

In my mind a page refresh or something of that nature needs to take place only am currently not having any joy so hoping for some advice.

Thanks and regards


MartinBall
  • New Participant
  • August 5, 2026

Hi Iain,

Interested to know if you managed to find a solution to this?

Am carrying out a similar task (ie. running DSPs within a CS application) so Ive a Form with an HTML widget painted on it. The HTML widget then displays a DSP that contains a DSP container. The outer DSP is a list (whereby clicking on a row updates the inner DSP). The buttons painted to the inner DSP all work only the outer DSP links then become useless following the action.

In my mind a page refresh or something of that nature needs to take place only am currently not having any joy so hoping for some advice.

Thanks and regards

Got it working using entity subtypes / entity services in place of painting the ‘real’ table. Game on


OsmanShariff
Forum|alt.badge.img+3
  • Participating Frequently
  • August 7, 2026

I have a DSP, with an attributes only widget…

This is the properties in the widget
html:class=btn·;HTML:TYPE=button

and the code is 

webtrigger onClick
scope
endscope
javascript

var obj = this;
var vOcc = obj.getParent();

 

the html widget needs to be set to RAWHTML_UPDATABLE to update it.

 

this works fine….