Posts by DiegoAugusto • 8,694 points
325 posts
-
6
votes2
answers477
viewsA: Alternative to Scanner for Data Entry
I don’t know if that would be a viable alternative, but you can use JOptionPane to pick up data entry. String nome = JOptionPane.showInputDialog("Entre com um nome: ");…
-
0
votes2
answers219
viewsA: Datatable with jsf
Try this. At the beginning of your xhtml file put: <f:metadata> <f:viewParam name="dummy" /> <f:event listener="#{usuarioController.findAll()}"…
-
6
votes3
answers40219
viewsA: How to format a date in 'dd/MM/yyyy' format?
The @Pedro answer already answers your question, but I’d like to show you an example where we can work with filters on Controller: var myApp = angular.module('myApp',[]); myApp.controller("MyCtrl",…
-
1
votes2
answers167
viewsA: Data does not persist in txt file
Your problem is in the call of the export method, it will only be executed if the option is equal to 0 because it is at the end of the do while. You can call it after entering the data, it would be…
-
4
votes2
answers139
viewsA: Doubt Angularjs with array
If you use only in HTML just do an ng-repeat like this: angular.module('App', []) .controller('MyCtrl', [ '$scope', function( $scope ) { $scope.content = { "type": "champion", "version": "6.3.1",…
-
3
votes1
answer481
viewsQ: Select Distinct returns repeated data when using Row_number
I’m trying to make pagination with SQLServer 2008 as follows: WITH CTEResults AS ( SELECT DISTINCT SolicitacaoServico.AutoId AS Id_Solicitacao, Pessoa.Nome AS Nome, Beneficiario.Codigo AS…
-
1
votes1
answer423
viewsA: Links in Angular
I didn’t quite understand your question, but if you want to do something only when the page(route) is fully loaded you can use the $viewContentLoaded. Example: Controller: var redirecionar = false;…
-
2
votes1
answer717
viewsQ: Delete entity and all its relationships Hibernate
I have the entity Fatura who has a relationship OneToMany with the entity Item. When I try to delete an Invoice I have the following error: Caused by:…
-
0
votes2
answers1075
viewsQ: Is it bad practice to make direct paging on the front end?
I have some systems Java + AngularJS, in some pages on back-end, using paging of Hibernate, ex: query.setFirstResult(0); query.setMaxResults(10); But recently I found some libraries from AngularJS…
-
0
votes1
answer1444
viewsQ: Handle cache with Angularjs
I have an app with AngularJs, application when I make any changes and then the deploy the browser does not recognize these changes. It only works when I change the URL of that application. I…
-
1
votes1
answer1372
viewsQ: Scroll bar does not descend until the end
I have a side menu that has position fixed, if I decrease the screen resolution the scroll bar does not descend until the end, that way: Currently I do this bar using the property overflow of css:…
-
0
votes0
answers381
viewsQ: Problems with menu-toggle Angularjs
I’m trying to make an application with AngularJs on top of a template ready with bootstrap. So far everything is working, but I noticed that some events do not work, as is the case of menu-toggle.…
-
4
votes3
answers2578
viewsQ: Pass Token by header to each Angularjs request
I am implementing tokens in a system, I already have the token generated and saved the same in sessionStorage. How can I create a service or Interceptor to put this token on Header of each request?…
angularjsasked DiegoAugusto 8,694 -
1
votes1
answer129
viewsA: Problems (Vraptor + Hibernate request)
Analyzing your code I saw that you are not giving commit in their consultations. The commit basically terminates the transaction by saving all changes that occurred during the transaction. It is…
-
4
votes4
answers9539
viewsA: How to convert a string to date or date?
An Alternative would be to create a Class utilitarian with the methods that convert dates if you need to do conversions in more places. Or you can create the methods in the Class itself, Example:…
javaanswered DiegoAugusto 8,694 -
1
votes1
answer924
viewsA: How to query a web api by passing parameters using Angularjs?
I recommend creating a service to work with API's, leave everything on controller is not a good practice. Ex: angular.module("oraculo").factory("colaboradorAPI", function ($http, config) { var…
-
3
votes0
answers171
viewsQ: Values set on top of Angularjs graph
I have some charts with angular-Charts where values only appear when I hover the mouse over: I would like these values to be fixed on top of each respective area of the graph. I have already…
angularjsasked DiegoAugusto 8,694 -
5
votes1
answer787
viewsA: ng-click button inside a label
When you use Label it replaces the button click, so your button does not work. Change this label by a div that will work.
-
3
votes1
answer1232
viewsQ: Very heavy Tomcat log
I have noticed that some files that get inside the folder Log of Tomcat are getting too heavy. Yesterday I deleted a file with 40GB and today already has another with 2GB. I can’t read the contents…
-
3
votes1
answer1664
viewsA: Display Alert according to an Ionic condition
I solved the problem as follows: On the controller: $scope.showAlert = function(titulo, erroMsg) { var alertPopup = $ionicPopup.alert({ title: titulo, template: erroMsg });…
-
1
votes3
answers310
viewsA: doubt with ajax and angular
As you are using C# I can’t help you 100% however I will respond the way I do something similar with Java+Vraptor maybe I can help you. Controller in the back-end: @Get…
-
3
votes1
answer585
viewsQ: Generate file . txt with three columns
I have a system where I do some research at the bank and store everything in one Array, but I have to put together a layout with this data so that they can be printed as labels on a matrix printer.…
javaasked DiegoAugusto 8,694 -
4
votes3
answers1293
viewsA: How to use ng-repeat in an object list?
You can do it that way: Instead of using var objeto change to $scope.objeto because this way you will make Binding with the Html in the ng-repeat. Then just do the binding with the data in the…
-
2
votes3
answers4406
viewsA: Check empty object Angularjs
I solved the problem by checking the object attributes instead of the whole object. Ex: $scope.filtrarContratos = function(contrato) { if (isEmpty(contrato.contrato) &&…
-
4
votes3
answers4406
viewsQ: Check empty object Angularjs
I have some fields where I pass some filters for a query in the bank. I would like to check if the object is empty, so the query would not be held. I tried that way: function isEmpty(obj) { for(var…
-
6
votes2
answers2360
viewsA: Fill Jcombobox with an object
Another solution would be to use the comboModel. Simple example: public class AulaComboModel extends AbstractListModel<Aula> implements ComboBoxModel<Aula> { private List<Aula>…
-
1
votes2
answers4721
viewsA: Angular JS - Take the value sent by the select of a directive
You can add the directive ng-change in his select and create a function to receive the data: Sg.combo.html <div class="col-sm-4 control-label"> <label>{{label}}</label> <select…
-
9
votes2
answers3664
viewsQ: Connection to the Bank drops after a certain time
I have a server where I have several web applications connected to the database(Mysql). The problem is that if any system gets idle it loses the connection to the bank and I have to refresh the…
-
2
votes2
answers835
viewsA: How not to repeat random numbers?
If it’s just for display you can use the filter unique. Example: ng-repeat="user in users | unique:'login'" This way it will not display two users with the same login. If you want to make a filter…
-
7
votes1
answer138
viewsQ: Tomcat on Windows and Linux
I currently have a server Tomcat running on a machine with Windows Server 2012. But I got some tips from some friends from Infra where they say the Tomcat in the Linux has better performance. So I…
-
7
votes6
answers49720
viewsA: Convert DATA dd/mm/yyyy hh:mm:ss to yyyy/mm/dd
Do it little padawan: CONVERT (VARCHAR, CONVERT(DATETIME, dataSistema, 103), 102) AS novaData Example: http://sqlfiddle.com/#! 6/2173d/2 In the documentation has some examples and explanations about…
-
0
votes1
answer333
viewsA: Insert colored markers into datepick using Angularjs, ui-bootstrap
I commented on the example that is in documentation of ui-bootstrap to try to exemplify for you how it works. Here is the example: http://plnkr.co/edit/9pdjzpEHx1jhZsapbcjS?p=preview Note that in…
-
5
votes1
answer10692
viewsA: Minimum and maximum limit of a number in a number type input
You can use the attributes min and max if you’re using HTML5 <input type="number" min="1" max="10">…
-
2
votes1
answer525
viewsA: Servlet Faces - Error in context with path
Add to your pom.xml: <dependency> <groupId>javax.servlet</groupId> <artifactId>jsp-api</artifactId> <version>2.0</version> </dependency>…
-
1
votes3
answers579
viewsA: JSF + Primefaces - HTTP 404 error
Try adding these libraries to your pom.xml: <!-- API de Servlet --> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId>…
-
3
votes1
answer317
viewsA: Error while uploading an Angularjs+Vraptor file
I managed to solve the problem. It was actually a bit of a lack of attention on my part, at documentation of Vraptor says that the default upload value for each file is 2MB then I have to overwrite…
-
5
votes1
answer317
viewsQ: Error while uploading an Angularjs+Vraptor file
I have a system where I can upload files through an Angular library (ng-file-upload), but if the file is larger than 3MB when I try to upload I have the following errors: GRAVE: Servlet.service()…
-
2
votes1
answer475
viewsA: JSON array with Angularjs checkbox
I didn’t understand it very well, but from what I saw in a comment you wanted something more "complete" and not just take the [1,2,3]. See if this example I put together can help you:…
-
1
votes1
answer126
viewsA: Problems configuring Table with CSS
I did a test with HTML+Bootstrap+AngularJS and it worked, I believe it will also work on JSF, try to do this: <h:form> <table> <div class="row"> <ui:repeat var="produto"…
-
0
votes1
answer67
viewsA: Error Web System after a while online
I solved the problem by making a Thread that makes a query 1 in 1 hour in the bank. This way there is always a "connection" with the bank and the connection does not fall. But recently I received a…
-
4
votes2
answers942
viewsA: Properly configured hibernate does not insert into database
Well, come on: The mistake isn’t coming because you’re doing nothing with the exception, try to put a ex.printStackTrace(); in its saving method which is in the DAO that you will find the error. The…
-
1
votes1
answer3729
viewsA: java.lang.Noclassdeffounderror in Java WEB with JSF
Probably missing CDI lib. If you are using Maven just add the following snippet in your pom.xml: <dependency> <groupId>javax.enterprise</groupId>…
-
2
votes1
answer1471
viewsA: Javafx Tableview apparently takes the value but shows null
I believe you are not "creating" the table. Try to do the following: clMarca = new TableColumn<>("Marca"); Do the same for others and then: tbVeiculo.getColumns().addAll(clMarca, clModelo,…
-
10
votes1
answer1527
viewsQ: Differences between Success and Then Angularjs
So far I’ve been using the success to the Http Promises. Ex: $http.get(/url).success(function(data){ console.log("Sucesso"); }) .error(function(response, status) { console.log("erro " + status); });…
-
4
votes4
answers3199
viewsA: Check if String is number, if not, return error to user
Alternatively you can create a method that checks the characters to see if it is a String or Integer. Example: public static boolean validarString(String texto) { String valor = texto; boolean…
javaanswered DiegoAugusto 8,694 -
0
votes2
answers1977
viewsQ: Break Line Correctly in a List with Data Binding Angularjs
I have a list of comments where I display some data. But when the comment is too big the list gets strange because the lines break does not happen correctly. Example: Here is the code: <div…
-
2
votes1
answer112
viewsA: $ionicLoading, template does not work
One of the possible causes for this problem is the version of Ionic and or the libraries you are using. Here has an example showing how the loading properly customized. If your app is local(offline)…
ionicanswered DiegoAugusto 8,694 -
2
votes1
answer1474
viewsA: Angularjs take the $Scope and concatenate into a URL
Change var carregarMarcas = function() for $scope.carregarMarcas $scope.carregarMarcas = function() { $http.get('https://crossorigin.me/http://fipeapi.appspot.com/api/1/' + $scope.tipoSelec.id +…
-
1
votes1
answer448
viewsA: pdf download that is outside the java jsf application
Try this: Declare an attribute of type DefaultStreamedContent in your bean: Example: private DefaultStreamedContent download; Do the Get and Sets: public DefaultStreamedContent getDownload() {…
-
2
votes3
answers895
viewsA: Side menu in Angular
You can make your side menu using routes, for this I recommend using the howling. With the uiRouter basically you can load your pages within a main template or within other pages through the…