JWt: Open discussionhttp://redmine.emweb.be/http://redmine.emweb.be/favicon.ico?16934085252023-03-14T18:00:37ZRedmine
Redmine Open discussion: Large WTreeTable Efficiencyhttp://redmine.emweb.be/boards/3/topics/182832023-03-14T18:00:37ZJeremiah Jahnjeremiah.jahn@gmail.com
<p>What is the best, most efficient, method to add node to large tree tables. It seems the only way I can get additional nodes to become visible is to add the node, the do a setTreeRoot on the whole tree again. This doesn't seem right for highly dynamic tree tables. Is there a better way to add a new row? </p>
Open discussion: RE: TextArea does not populate size change events to the layerhttp://redmine.emweb.be/boards/3/topics/16482?r=16483#message-164832019-08-18T10:20:35ZHenry Morganfantasia.ended@gmail.com
<p>getParent().hide();<br><br>
getParent().show();<br><br>
fixes the problem when i hanged on mouseDragged event. But i suppose it's not right.</p>
Open discussion: TextArea does not populate size change events to the layerhttp://redmine.emweb.be/boards/3/topics/164822019-08-18T09:19:04ZHenry Morganfantasia.ended@gmail.com
<p>Hello</p>
<p>I'm trying to use WTextArea inside layer but widget doesn't generate size change events and doesn't redraw to the parent elements. Chat client example doesn't work as well. WTextArea works fine inside layer-less container. What's wrong?</p>
<p>Regards</p>
Open discussion: WApplication with action for fullscreenhttp://redmine.emweb.be/boards/3/topics/150482018-05-25T14:55:38ZEverton Fonsecasalvocalfonseca@hotmail.com
<p>Could a new version of Wt and Jwt contain a function in WApplication with fullscreen like this requestFullscreen()</p>
Open discussion: Tutorial Youtubehttp://redmine.emweb.be/boards/3/topics/143412017-12-28T22:23:33ZEverton Fonsecasalvocalfonseca@hotmail.com
<p>Emweb please do a tutorial on youtube complete with using your Wt and Jwt framework, so many people will use your products<br><br>
Do you have any plans to do this?</p>
Open discussion: RE: "invalid ackId" (jwt-3.3.6)http://redmine.emweb.be/boards/3/topics/12814?r=13958#message-139582017-09-28T15:07:12ZVladimir Savchikvsavchik@gmail.com
<p>I see 3.3.8 has successfully fixed that!<br><br>
Great!</p>
Open discussion: RE: About Localization...http://redmine.emweb.be/boards/3/topics/5146?r=12904#message-129042016-09-28T22:08:28ZKoen Deforchekoen@emweb.be
<p>Hey Rafael, it sounds like that should work.</p>
<p>The two calls that are important are:</p>
<pre><code> WXmlLocalizedStrings bundle = new WXmlLocalizedStrings();
bundle.use("/package-path/to/wt");
app.setLocalizedStrings(bundle);
WApplication.getInstance().setLocale(new Locale("pt"))
</code></pre>
<p>This should load "wt_pt.xml"</p>
<p>JWt comes with a 'form' example that illustrates these APIs.</p>
<p>Koen</p>
Open discussion: RE: About Localization...http://redmine.emweb.be/boards/3/topics/5146?r=12892#message-128922016-09-26T08:01:03ZKip J Mejiakipjmejia@yahoo.com
<p>To translate a text in to a particular language is know as Localization. It is a process by which we can change a text to a different language and also we can add some locale-specific components. Swing supports localization in the way that when we localize an application to a particular language and run it in that specific locale then Swing pulls up the localized strings from the resource bundle. After this, the component gets resized by the layout manager. The previous example demonstrates how to localize an application.Check more info from <a href="http://cheapessaywritingservice.us/" class="external">http://cheapessaywritingservice.us/</a></p>
Open discussion: "invalid ackId" (jwt-3.3.6)http://redmine.emweb.be/boards/3/topics/128142016-09-03T17:30:04ZDaniel G
<p>I saw that this was remedied on the Wt side, but I notice I'm having the problem in JWt, too.</p>
<p>Basically after 2.5 minutes of inactivity, this error appears in the console and the app isn't responsive anymore.</p>
<p>Container is Jetty 9.3.6.</p>
<p>Let me know if you need any other information / source code / etc.</p>
Open discussion: RE: jWt equivalent of Wt::Http::Client, or ... background/async tasks in generalhttp://redmine.emweb.be/boards/3/topics/12792?r=12801#message-128012016-08-28T21:02:49ZWim Dumonwim@emweb.be
<p>One of the reasons there's no httpclient in jwt, is that there's a ton of libraries in java that handle this pretty well. We felt that there wasn't an easy solution for C Wt yet.</p>
<p>Wim.</p>
Open discussion: RE: jWt equivalent of Wt::Http::Client, or ... background/async tasks in generalhttp://redmine.emweb.be/boards/3/topics/12792?r=12800#message-128002016-08-27T05:02:46ZDaniel G
<p>Just a little followup for anybody else who visits this thread in the future. (Thanks again for your assistance, Jeremiah)</p>
<p>Since I'm using Groovy, I decided to use the Http Builder NG library: <a href="https://github.com/dwclark/http-builder-ng" class="external">https://github.com/dwclark/http-builder-ng</a> .</p>
<p>I made a method in my WApplication object:</p>
<pre><code> def getJSON(String url, Map<String, String> params, Closure<Object> callback) {
Thread.start {
http.get {
request.uri.path = url
request.uri.query = params
response.success { res, Object data ->
def lock = getUpdateLock()
try {
callback(data)
triggerUpdate()
} finally {
lock.release()
}
}
}
}
}
</code></pre>
<p>And here is an example of calling it, such as in a button click listener:</p>
<pre><code> getJSON("https://api.giphy.com/v1/gifs/random", [api_key: "xxxxxx", tag: "cats"]) { result ->
// change UI here, based on converted JSON 'result'
}
</code></pre>
<p>Of course I'll eventually have to add a way to handle API failures / network exceptions properly, but for my current experiments this will do.</p>
Open discussion: RE: jWt equivalent of Wt::Http::Client, or ... background/async tasks in generalhttp://redmine.emweb.be/boards/3/topics/12792?r=12795#message-127952016-08-26T07:41:03ZDaniel G
<p>Ah, nice --- thank you! Will give your WWorker a try this weekend.</p>
Open discussion: RE: jWt equivalent of Wt::Http::Client, or ... background/async tasks in generalhttp://redmine.emweb.be/boards/3/topics/12792?r=12794#message-127942016-08-26T05:04:03ZJeremiah Jahnjeremiah.jahn@gmail.com
<p>also, apache has an httpClient you can use that pretty popular for access external web resources. Or you can use the built in HttpURLConnection if it's not too complicated.</p>
Open discussion: RE: jWt equivalent of Wt::Http::Client, or ... background/async tasks in generalhttp://redmine.emweb.be/boards/3/topics/12792?r=12793#message-127932016-08-26T05:01:20ZJeremiah Jahnjeremiah.jahn@gmail.com
<p>If you don't want your UI to freeze or timeout you'll need to enable updates and make a new thread.<br><br>
With Java 8 lambdas it's pretty simple.</p>
<p>WApplication.getInstance().enableUpdates(true);</p>
<p><a href="https://github.com/jahnje/delcyon-capo/blob/master/java/com/delcyon/capo/webapp/widgets/WWorker.java" class="external">https://github.com/jahnje/delcyon-capo/blob/master/java/com/delcyon/capo/webapp/widgets/WWorker.java</a><br><br>
The update method more or less calls the WApplication.triggerUpdate() method which causes JWT's magic to happen between threads.</p>
<p>Here's an example using this WWorker class to run a pdf report and trigger progress bar changes wile it loads.</p>
<pre><code>private void runReport()
{
if (worker.isRunning())
{
worker.interrupt();
return;
}
DocketWarrantsReport rptWarrants = new DocketWarrantsReport();
btnRun.setText("Cancel");
prgBar.setHidden(false);
anchorResults.setHidden(true);
prgBar.setValue(prgBar.getMinimum());
WCursorState.wait.setCursourStateOn(WApplication.getInstance().getRoot());
worker.run(() -> {
try
{
prgBar.valueChanged().addListener(prgBar, () -> worker.update());
bosWarrantReport = rptWarrants.getWarrantsForHearingsPDF(dtpBeginDate.getIntegerDate(), dtpEndDate.getIntegerDate(), chkInCounty.getBooleanValue(), chkMayAppear.getBooleanValue(), prgBar);
prgBar.setValue(prgBar.getMaximum());
anchorResults.setHidden(true);
anchorResults.open();
worker.update();
}
catch (InterruptedException e)
{
// Do nothing, it's just the user hitting cancel
}
catch (Exception e)
{
JOApplication.exception(Level.WARNING, e.getMessage(), e, worker.getOwnerApplication());
}
prgBar.setHidden(true);
btnRun.setText("Run");
WCursorState.initial.setCursourStateOn(WApplication.getInstance().getRoot());
worker.update();
});
}
</code></pre> Open discussion: jWt equivalent of Wt::Http::Client, or ... background/async tasks in generalhttp://redmine.emweb.be/boards/3/topics/127922016-08-26T03:02:44ZDaniel G
<p>I'm probably (definitely) missing something obvious here ... but let's say I need to do some HTTP requests behind the scenes to interact with external APIs.</p>
<p>Is there something nice and easy like Wt's Http::Client ? Or do I need to write my own to mask the complexity of spawning a separate thread, notifying the UI thread, etc?</p>
<p>(Also wouldn't a full thread be kind of a bad idea from an overhead point of view? Pardon my ignorance but I don't understand the internals of jWt, or Java servlets for that matter :) But if it's some kind of Node-esque event-driven IO under the surface, a real thread wouldn't be required just to fetch an external URL, correct?)</p>