Posts by Andre Gusmao • 1,011 points
47 posts
-
0
votes2
answers847
viewsA: How to go through an iterable?
To traverse a Iterable and print your value you can do so: Iterable<String> iterable = keysWithPrefix(pre); Iterable<String> q = iterable.iterator(); //verifica se existe itens a…
javaanswered Andre Gusmao 1,011 -
3
votes1
answer1072
viewsA: Notes JPA @Onetomany or Manytoone?
If ONE Report has SEVERAL subreports so the annotation that should be used is @OneToMany public class Report{ private String nome; @OneToMany private List<Report> subReports getters e…
-
0
votes1
answer116
viewsA: JPA read-only database
In your case you can perform the modification in the entity or in the database. In the JAVA add the annotation @Column with the attribute of insertable = false if you want to prevent Inserts and…
-
0
votes1
answer84
viewsA: Retrieve Bigdecimal Value from @Pathparam
Convert it to BigDecimal Vraptor is expecting a comma to decimals because of your server’s Locale (which is probably pt-BR). If you make your call like this:…
-
0
votes2
answers367
viewsA: Array declaration in javascript
To define the first element of an array, in this case cars[0] you first need to declare the array cars = []; or cars = new Array();. var cars = []; cars[0] = { a: "Saab", b: "Volvo", c: "BMW" }…
-
0
votes1
answer211
viewsA: Path ftp directory with spaces
You can try using the backslash \ to escape space, just as it is done when browsing linux directories. Do so: ftp.changeWorkingDirectory("/Premium\\ 2.0/Executaveis/Producao"); You need to use two…
javaanswered Andre Gusmao 1,011 -
2
votes2
answers496
viewsA: How do I activate a div with Javascript?
To change the style of an element you can access the properties using elemento.style.[propriedade] function mostrarLegenda() { var div; var estilo; div = document.getElementById("MostraLegenda");…
-
2
votes1
answer80
viewsA: Cast from object type name(String)
The class HtmlInput (link) is the parent of several classes used in forms (they contain the methods .getNameAttribute() and .getValueAttribute()), with the exception of select, so instead of casting…
-
2
votes4
answers1486
viewsA: Calculate inputs with Javascript
I think your problem is solved by putting a class in total inputs. function Soma(){ var soma = 0; $('.totais').each(function(){ var valorItem = parseFloat($(this).val()); if(!isNaN(valorItem)) soma…
-
1
votes2
answers54
viewsA: Problems in sorting by more than one criterion
Similar to the way you were doing with the if, you can check if the qualis is the same as the other if it is you check the year. In javascript you can enjoy that value 0 is interpreted as false to…
javascriptanswered Andre Gusmao 1,011 -
0
votes1
answer257
viewsA: Assemble a product table as a java jsp showcase
To write from 3 to 3 products you can do something in this sense: Use an accountant varStatus, for example contador, to find out what the forEach, this way every time contador.count is divisible by…
-
0
votes1
answer36
viewsA: Pass jTextField value to Namedquery
By your code, no if: if (jTextField1.getText().trim().equals("") == false) You handle the text of jTextField with the function. Trim() to remove spaces from the String, but when adding to the list…
-
0
votes1
answer474
viewsA: Add multiple products in one sessionStorage
The way your code is you overwrite the array of objetos every time you save a product. You have to check if there are already products in sessionStorage and if you have already recovered the product…
-
2
votes1
answer1662
viewsA: JSF error: javax.el.Propertynotwritableexception
This error is from the jsp’s Expression language, link. It occurs because in your class Empregado has not the method setMatricula() so Exception javax.el.Propertynotwritableexception.…
-
0
votes2
answers1446
viewsA: maskMoney does not work on input within table
When executing $(".dinheiro").maskMoney(); is made a bind in all elements with the class dinheiro to wear the mask. If you add a new element (as in the case of the table), even if it has the class…
-
1
votes1
answer447
viewsA: When I make a request on my Rest API with Spring boot, it is coming with an extra item
Your model has a method getCurso() which returns the id. So when serializing to JSON it is printing the key curso of the same value as id. To adjust just remove the method getCurso.…
-
3
votes1
answer249
viewsA: Doesn’t Index work on Arrays?
There is no method indexOf for arrays. If you want to know the int index in the array you can: 1 - Make a for in the array looking for the element (This function returns the day it had the maximum…
-
2
votes3
answers146
viewsA: Laravel 5.5: same field in multiple rows on Seeds
You can create a generous array and insert the objects into one foreach $nomes = array('Ação', 'Comédia', 'Terror'); $generos = []; $tabela = DB::table('generos') foreach ($generos as $genero) {…
-
0
votes3
answers393
viewsA: Generate an iframe from the youtube link with jquery
var linkYoutube = //link do YouTube. var $iframe = $('<iframe/'>).attr('src', linkYoutube); $('ID_DIV').append($iframe);
-
0
votes1
answer319
viewsA: Problem with JSF during form validation
Lack of property itemValue in his f:selectItems, it serves to set the client in the animal object of your Managed bean animalMB. How you declared a convert and it builds the client object from a cpf…
-
2
votes2
answers196
viewsA: Event add div javascript
How you add a new element (the .input) you must add the event of click in this new div. Extracts the function and reuses it for the div’s that are added. $(function(){ let onClick = function(e){…
-
1
votes1
answer459
viewsA: Script inside input text
In your input you can put a id <input id="placar-c" class="form-control" type="text" name="placarcasa" maxlength="1" value="" style="text-align: center;" required /> And in your javascript…
-
1
votes2
answers874
viewsA: Select specific columns from two related tables
I took the test with a 1xN relationship to simulate your problem and I believe your code is correct. Just need to insert foreign relationship key. I would make a modification in arrays too…
-
5
votes1
answer81
viewsA: What does cardinality mean in this case ? (jQuery Inputmask)
According to the documentation on github a cardinality (Cardinality) defines how many characters represent the definition to be validated. In your example, the character '*' represents 1 character…
-
1
votes1
answer768
viewsA: Problem with download PDF file with Laravel
Using Ajax to download files is not the best way. By security measure you cannot save a file on the user’s computer using javascript. Reference:…
-
0
votes2
answers70
viewsA: Maintenance problem with JPA query
You can use the method getName() class VendaTotal in your queries, so it is easier to refactor. The String.format() or the StringBuilder may also help you build this query. String jpql = "select…
-
1
votes4
answers155
viewsA: How to create function with SINGLE BUTTON to open multiple class together?
You can put a class in the tags <span/> <div class="alinha" onclick="abre('texto<?=$id?>')"><span class="cor"><b><?=$titulo?></b></span> <span…
-
0
votes1
answer1119
viewsA: Charts with PHP Chart.js
I was able to reproduce your error in the following excerpt: var grafico = new (ctx, { type:'bar', data:chartdado }); According to the chart.js documentation to create a graph you need to…
-
2
votes1
answer1655
viewsA: Uncaught Typeerror: Cannot read Property 'NOME' of Undefined
Your API response is returning something in format: //Cada PACIENTE é um JSON { TRACKER: [PACIENTE1, PACIENTE2] } Then you have to adjust the parameter that is passed to the function…
-
5
votes2
answers2051
viewsA: Matrix multiplication in Java
When creating an array you pass its size as a parameter new int[tamanho]. The vector indices start from 0, according to the oracle documentation. You can also see in this Caelum link about vectors.…
-
0
votes1
answer249
viewsA: Servlet giving error 404
The url for your Servlet is /user/post. According to the javadoc of @WebServlet, the properties value and urlPatterns which are used to map the Servlet URL. The name is just the name of Servlet.…
-
0
votes3
answers66
viewsA: I calculate with Javascript
Your script is correct, maybe you missed the parseFloat for the function .val() returns a string, I refactored your code. //função para calcular a diferença function formulaCreabas(valorCreabas2,…
-
1
votes1
answer614
viewsA: How to set up an Laravel project with Vuejs
You gotta get that line right: https://github.com/wladyband/imoveis/blob/master/resources/views/imoveis/create.blade.php#L48 You’re just putting it titulo instead of $titulo, in this way the Modular…
-
0
votes1
answer32
viewsA: Php does not recognize css button
You used simple quotes on a.botao01 escaping the text of echo. .botao01{ background: -webkit-linear-gradient(bottom, #E0E0E0, #F9F9F9 70%); background: -moz-linear-gradient(bottom, #E0E0E0, #F9F9F9…
-
1
votes1
answer75
viewsA: How to pass data from two unrelated tables in a view?
Looking fast at your code both the getLemas() as to the getIgreja() are searching for the data of Lemas protected function getLemas() { return Lema::where('status_lm', 'Activo')->get(); }…
-
2
votes2
answers217
viewsA: Setting the color of a div in rgb
1) Your code is making the comparison backgroundColor == 'rgb(#FF6600)' but the value of background color is rgb(255, 102, 0) 2) You can do it using a class that changes the default style. So you…
-
0
votes1
answer284
viewsA: Transform Brute Inner Join to Laravel Join
Following the documentation (https://laravel.com/docs/5.5/queries#joins) you can do your query this way: DB::table('ma_usuario') ->join('ma_user_tipo_rel' 'ma_usuario.usr_id', '=',…
-
0
votes1
answer140
viewsA: Maven OWL API How to resolve dependency error
Following the link you commented (OWL API resolution) you can add owlapi and owlapi-osgi dependencies (this dependency should solve the problem according to the link) to your pom.xml:…
-
0
votes1
answer142
viewsA: Problems with <p:ajax> on primefaces
Your p:selectOneMenu is waiting for an object State but you are passing the state id. You can change xhtml: <p:selectOneMenu id="estado" value="#…
-
1
votes1
answer40
viewsA: Keep div on screen
I made an adjustment in your code to not let go of the screen on the left side. To the other directions just follow the same logic. $(document).keydown(function(e){ //var pos = $(".box").position();…
-
1
votes1
answer199
viewsA: Keep data already filled in the form
There is the method replicate Model that can help you, it creates a clone of the non-existent model in the database. (link) Let’s say your model is Informacoes, in the controller you can check if…
-
0
votes1
answer238
viewsA: Joptionpane cancel button
mensagem.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { String nome; nome = JOptionPane.showInputDialog("Qual seu nome?"); …
javaanswered Andre Gusmao 1,011 -
0
votes2
answers201
viewsA: Json created incomplete
Maybe we need to adjust the notes, the @JsonManagedReference indicates that the property must be serialized, while the @JsonBackReference serves to omit the serialization property. Looking at your…
-
1
votes1
answer819
viewsA: Bootstrap progress bar tracking video youtube duration
I changed your example to work progress bar. I put a version on Jsfiddle, I used the Moment.js to mess with time. Methods and values were taken from the API documentation, Link. The methods…
-
0
votes1
answer155
viewsA: put an image under columns in Bootstrap
Follow an example of what you can do: Jsfiddle. You have to subdivide the columns this way: | col-md-8 | col-md-4 | | coluna 1 (md-6) | coluna 2 (md-6) | coluna 3 (col-md-12) | | imagem (md-12) |…
-
4
votes3
answers1359
viewsA: How do I run the script after loading the page
You can use the event pageInt, link $(document).on('pageInit', function (e) { //as funções de bind $("#capturarFoto").unbind().bind()... });…
-
1
votes2
answers96
viewsA: Save a page from an Htmlpage (java)
The Htmlpage class has the method save that you can use in this situation: public void gerarPaginaIndex() { try { final HtmlPage paginaIndex = WebClientFactory.getInstance().getPage(URL_INICIAL);…