Posts by Luídne • 1,748 points
60 posts
-
1
votes0
answers15
viewsQ: Amount of files in Moq request
The SetupGet to for the form (Form) of the request works, however the Count doesn’t work. How to solve for the Count return the desired value? var httpContextMock = new…
-
1
votes1
answer349
viewsA: Retrofit always returning null in Response
It is returning null because there is no parse of the body in JSON for the Java object. Based on the method name Call<MovieResults> getFilmesByName(@Query("t") String movieName); return should…
-
7
votes2
answers3003
views -
1
votes1
answer948
viewsA: View PDF JSF primeFaces
You must return one org.primefaces.model.StreamedContent instead of java.io.File. You can do it like this: public StreamedContent getPdf() { InputStream stream = null; try { // arquivo é do tipo…
-
1
votes1
answer176
viewsQ: Why does Retrofit make an exception when the status code is 204?
After a consultation GET only to check if a content exists on the server, the return is 200 (exists) or 204 (there is no). Why does Retrofit trigger the exception below when the server returns the…
-
1
votes2
answers413
viewsA: How can I put a button to make it visible?
What you lack is having one Listener on the button vibrar and in this Listener change the visibility of the button cor. For example: Button vibrar = (Button) findViewById(R.id.vibrar); Button cor =…
-
1
votes2
answers2514
viewsA: Android layout with colorful embroidery
You will have to create a drawable with rounded corners and set it as your background layout or in any view as desired. Follow an example with green edges: drawable/rounded.xml <?xml…
-
1
votes1
answer19
viewsA: Update a label with dropdown text
To get the text from label use the following selector with jQuery: $("#GrupoID option:selected").text(); And to attribute such a text to your label: $("#grupoupdate").text($("#GrupoID…
-
2
votes1
answer194
viewsQ: How to insert entity with ID into Entity Framework
How to insert an entity with ID in Entity Framework 6.0? That is, insert with ID because the table does not generate it. For example: var last = _contexto.Area.AsEnumerable().LastOrDefault();…
-
2
votes1
answer178
viewsQ: Okhttp only works on Lollipop
The Okhttp 2.6.0 library does not work in versions prior to Android 5. In versions prior to Lollipop always fires the exception: Exception Caused by: java.lang.Noclassdeffounderror:…
-
6
votes2
answers3602
viewsQ: Store credentials from a Git repository on Windows without SSH
How to set up Git in a local repository so you don’t ask for the login and password every time you push or pull? My Git server does not support SSH. HTTP only. I have only the username and the…
-
1
votes2
answers97
viewsA: How to differentiate an Edittext with the same name and the same id?
Whichever View Android has an attribute called tag which can be used to add extra information in a View. An example of its use is the following: View view = new View(contexto); Object objeto = new…
-
2
votes2
answers2138
viewsA: Java and Postgresql/ MYSQL encryption
To encrypt a password or any other string you do it in the application or in the bank. Here I will deal with SHA1 and MD5, but the latter is no longer recommended, see How to hash passwords…
-
2
votes2
answers570
viewsA: Ioc with Ninject
Using the annotation [assembly] you can configure the method that will be executed when started and finished the ioc container. No need to configure the Global.asax to initialize the container…
-
1
votes2
answers2833
viewsA: Enabling Internet Connection in an Android App
To check if a is connected to the Internet independent of the interface can be used the following code: ConnectivityManager cm = (ConnectivityManager)…
-
2
votes1
answer90
viewsA: Do not move with Mouse the <p:dialog>
Just add the attribute draggable as false. For example: <p:dialog header="#{MyBean.select.projetos.nome}" widgetVar="lanDialog" modal="false" showEffect="blind" resizable="false"…
-
1
votes4
answers368
viewsA: Difficulty with CSS in a JSF2 project
As you are added CSS by JSF it will manage such CSS. Therefore, to add an image you should use the JSF Expression Language (EL). For example: css style. body { background-image:…
-
4
votes1
answer2877
viewsQ: How to change location in Postgresql
My database is with locale en_US.UTF-8, I need to change it to pt_BR.UTF-8 for the purposes of ordering consultations. How can I do that only with phpPgAdmin?…
-
1
votes2
answers387
viewsA: Add all records before a specific date - Sqlite
The error is here: strftime('%Y-m%-d%', data) The function strftime(format, timestring, modifier, modifier, ...) only accepted string as second argument and you are passing a DATETIME. The correct…
-
1
votes2
answers1269
viewsA: How to insert inpuText data into a list using JSF?
The method adicionarOpcao() adds a new option to the list with the data coming from <h:inputText>. After sending the form data (execute="@form") and the execution of the above method…
-
5
votes2
answers528
viewsA: Web application chat with Java and Primefaces
It is possible to do according to some technologies or asynchronous communication services, such as: Websocket This, in turn, is available in the Java EE JSR 356 specification (such specification…
-
3
votes1
answer896
viewsQ: How to handle request header with Filter
How to change, remove or add a header of a request in a web application using Filter?
-
0
votes2
answers303
viewsA: Android app => Unfortunately project has stopped
You must use findViewById() within the onCreate() because if you execute the method before that he won’t find the view because it does not even have layout assigned to Activity, since this is done…
-
0
votes1
answer167
viewsA: Action on the button to center text
You can use jQuery to add the class text-center from Bootstrap to input. For example: Javascript and jQuery <script> function centralizar(){ $(".input-centralizar").addClass("text-center"); }…
-
2
votes2
answers1312
viewsA: Open Dialog in primefaces as soon as the screen opens
You can simply add the attribute visible="true" that automatically the <p:dialog> will open when the page is accessed. Another way beyond what Rafael responded is to do this via jQuery…
primefacesanswered Luídne 1,748 -
2
votes1
answer1886
viewsA: How to pass data from a Datatable line to a Dialog in Primefaces
I understand you’re using the component Dialog Framework of the Primefaces. The third parameter of the method openDialog(pagina, opcoes, params) serves to be passed the data (parameters) to the…
-
2
votes1
answer729
viewsQ: Search data from related tables
I know that to return the values of a directly related entity in the bank is done so with LINQ: List<Usuario> lista = banco.Usuario.Include("Tipo").ToList(); But how can I get the data from…
-
2
votes1
answer1965
viewsA: Update form dialog without closing it
This has already happened to me. The solution was instead of giving update in the <h:form> in which the <p:dialog> is giving update in the container data within the <p:dialog>. In…
-
2
votes3
answers1805
viewsA: Return the inverse of a vector
Using Collections Java to get the reverse order is very simple: Integer vetor[] = {1,2,3}; Collections.reverse(Arrays.asList(vetor)); With this, the order of the elements of the vector vetor[] will…
-
1
votes1
answer310
viewsA: Validate custom fields of generated classes
The error simply occurred because the namespace of the archives Metadata.Cs and Partialclasses.Cs was not the same as the generated classes are (Bancodehours.Data). The solution was to leave the…
-
3
votes1
answer310
viewsQ: Validate custom fields of generated classes
To prevent validations made with Data Annotations are lost if the table structure changes, it is necessary to create another class with fields for validation and a class partial, path that this last…
-
2
votes1
answer2242
viewsA: Calling a JSF bean method within Javascript
You can use the framework Primefaces which contains a component for this, follow an example. <h:form> <p:remoteCommand name="rc" update="msgs" actionListener="#{remoteCommandView.execute}"…
-
2
votes1
answer134
viewsA: How to get the value of the attribute "Lazy" of the datatable primefaces in the bean?
To take any attribute of a JSF component just have an instance of the type UIComponent of the same, than with the method getAttributes() returns any desired attribute by passing only one key to the…
-
3
votes2
answers5149
viewsA: Create a Alertdialog with an Edittext of type "number" - Android
You can use the method setRawInputType() as follows: input.setInputType(InputType.TYPE_CLASS_NUMBER); Or you can also use the method setInputType() passing the same argument. With this method if the…
-
0
votes3
answers2527
viewsA: How to determine the sort of accented characters in Mysql?
You can override the collation standard by other through the clause COLLATE. For example: SELECT * FROM tabela ORDER BY campo COLLATE utf8_general_ci; Also, note if the field is also with the same…
-
3
votes1
answer1039
viewsA: Encryption of mysql data
AES_ENCRYPT() encrypts a string with a key and returns a binary string containing the encrypted output that must be stored in a field for binary data such as BLOB. To view a field BLOB you should…
-
2
votes2
answers1896
viewsA: How to get the description of an Enum in xhtml?
So that your <p:selectOneMenu> show the description in the options you must specify which property should be shown through the attribute itemLabel. The standard JSF does not have the necessary…
-
1
votes2
answers414
viewsA: How to put a subheading at the bottom of the app name in the bar menu
For this you must register a listener for when the ViewPager change you capture the event and do something related. It can be done like this: ViewPager galeria = (ViewPager)…
-
1
votes2
answers208
viewsA: Send geolocation to web service and update to other devices
Saving the data in the database will be an option if you want to use it for further analysis. But you can very well share this data to the customer without having to do some data persistence work,…
-
4
votes1
answer1164
viewsQ: Resolve SVN error: "must be ancestrally Related to..."
With Tortoisesvn I created a branch for production from my trunk, only after a while when I try to do the merge of trunk in production gives the following error:…
-
5
votes3
answers487
viewsA: Execute code before executing the first Activity
You can finish the Initialactivity right after calling the Mainactivity doing so: startAcitivity(new Intent(this, MainActivity.class)); finish(); Doing so, your Activity will be closed before being…
-
8
votes3
answers1511
viewsQ: How to send an object via SOAP web service
To send a primitive data is simple, but when it comes to complex data as shown below, an exception is thrown: java.lang.Runtimeexception: Cannot serialize: Person{name=given, address=given etc...}…
-
1
votes1
answer3313
viewsA: How to pass parameter for a dialogue with Primefaces?
When the button is triggered you can change the value of the property #{TA_MB.tituloProcessamento} using <f:setPropertyActionListener /> and update a component that contains the title of the…
-
1
votes2
answers564
viewsA: Listview too slow to load XML
Cause The slowness in your case is due to each iteration in the following section: for (int i = 0; i < reader.getItems().size(); ++i) { // código omitido } For every iteration the method…
-
4
votes1
answer106
viewsA: Sorting an Array
You can implement the Comparator interface and use it for Collections to sort your list. For example, in API 19: Collections.sort(itens, new Comparator<ItemListPropaganda>() { @Override public…
-
1
votes2
answers1390
viewsA: jpa jpql filter without using the primeface filter (with proper method)
This can be done by changing the search method to fill in the list #{mBProduto.produto} with the filtered values in your method and then updating the data (the same list of <p:dataTable>) of…
-
0
votes1
answer471
viewsA: p:panelGrid component does not render, only displays text
Note that instead of <p:panelGrid> you put <h:panelGrid> This justifies not showing the borders automatically. But if you want to use <h:panelGrid> the border will be displayed…
primefacesanswered Luídne 1,748 -
1
votes1
answer457
viewsA: Error in applicationContext-security.xml
What is happening is the following, in XML the namespace handler http://www.springframework.org/schema/security is not being found. This is because a library is missing that contains this…
-
1
votes2
answers3658
viewsA: "Connection refused" error when connecting to Postgresql
By default when creating an environment in the Jelastic with a database, such a database can only be accessed by applications in the same environment or by the website (such as the phpPgAdmin).…
-
2
votes1
answer1561
viewsA: java.lang.Nullpointerexception Error in JDBC Connection with WS + Postgres
What’s going on is this: databaseURL, is pointing to the application server port and not the database server; So, databaseURL it must be like this: jdbc:postgresql://localhost/nomeDoSeuBancoDeDados…