Posts by Rafael • 2,875 points
79 posts
- 
		0 votes2 answers337 views
- 
		1 votes1 answer487 viewsA: Default select AngularMake a ng-init to select the first element: <select class="ui search dropdown" ng-init="vm.empresa = vm.collectionData.items[0]" ng-model="vm.empresa" ng-options="item.id as item.label for item… 
- 
		4 votes2 answers271 views
- 
		0 votes1 answer122 viewsA: Use html tag to replace JSF components when possibleYou can use HTML and JSF tags on the same page. The advantage of using JSF components is that you can access them from the JSF component tree. With HTML tags you cannot. References: Mixing JSF Tag… 
- 
		0 votes2 answers430 views
- 
		0 votes1 answer382 viewsA: Angular index variableDude you’re doing it wrong, you don’t use php code in the middle of Angular. You will have to take the database data and return in JSON format, usually this request is made by REST. Follow an… 
- 
		1 votes2 answers1400 viewsA: How to sort a p:datatableIf you want to show your already ordered table you have to sort your table object list before showing it. Or add the sortBy in the table column: <p:column headerText="Status"… 
- 
		4 votes1 answer405 viewsQ: How to validate login without redirecting the page?I have the following login form in a dropdown, my question is the following, how to validate the login without redirecting the page? Currently when the user informs a wrong password he is redirected… 
- 
		1 votes1 answer40 viewsQ: Failed to create Web Worker from local file in ChromeWhen trying to create a worker var worker = new Worker('teste.js'); I receive the following message: Uncaught Securityerror: Failed to Construct 'Worker': Script at 'file://C:/..... /js/teste.js'… 
- 
		4 votes1 answer395 views
- 
		3 votes3 answers1527 viewsA: How to find the negative of a color in hexadecimal?I found an example in PHP: function color_inverse($color){ $color = str_replace('#', '', $color); if (strlen($color) != 6){ return '000000'; } $rgb = ''; for ($x=0;$x<3;$x++){ $c = 255 -… hexadecimalanswered Rafael 2,875
- 
		5 votes5 answers1943 viewsA: Is it possible to program to web with Lua?Yes it is possible. You can use the Orbit, it is a MVC framework for the web. 
- 
		1 votes1 answer194 viewsA: Set custom database settings in LaravelYou can do it like this: $conn = array( 'driver' => 'mysql', 'host' => 'localhost', 'database' => 'DATABASE', 'username' => 'USERNAME', 'password' => 'SOME_PASSWORD', 'charset' =>… 
- 
		2 votes1 answer917 viewsA: Convert Bufferedimage to File?The problem was that you prompted your File as null. File file = new File("image.jpg"); ImageIO.write(image, "jpg", file ); You need to specify the image path.… 
- 
		1 votes2 answers2968 viewsA: Error org.hibernate.LazyinitializationexceptionThis error occurs because your category list is with Lazy, you need to initialize your list first before performing an operation. You will need to create a method of init() in your class… 
- 
		5 votes2 answers1244 viewsA: How to work with scripts and style sheets in Laravel 5.1Assuming: public/css public/js You can do the following: <link href="{{ asset('css/aqr.css') }}" media="all" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="{{… 
- 
		1 votes1 answer55 viewsA: Concatenate values in the Jfreechart chartYou can do the following, create a constructor that receives a CategoryDataset public LineChartDemo1(final String title, CategoryDataset dataset) { super(title); final CategoryDataset dataset =… 
- 
		1 votes1 answer1315 viewsA: Line break in <p:confirm> Primefaces messageDo the following: <p:confirm icon="ui-icon-alert" header="Confirma a alteração do Status"/> <p:confirmDialog header="Confirmação"> <f:facet name="message"> <p:outputText… 
- 
		0 votes2 answers545 viewsA: Problem accessing a One to Many interface in LaravelYou need to set the foreign key in the relationship, so it stays like this: public function categoria(){ return $this->belongsTo('estoque\Categoria', 'categoria_id'); } So just access as an… 
- 
		5 votes2 answers545 viewsQ: Problem accessing a One to Many interface in LaravelMy Product model has the following relationship: public function categoria(){ return $this->belongsTo('estoque\Categoria'); } and my Category model has: public function produtos(){ return… 
- 
		2 votes1 answer149 viewsA: Why is my selectOnMenu of the primefaces rendered differently?On your page where your select: <style type="text/css"> .ui-selectonemenu .ui-selectonemenu-trigger{ width: 25px !important; /* coloque aqui as propriedades do css que deseja mudar com a tag… 
- 
		1 votes1 answer191 viewsA: How to run a <p:confirm> through the bean?Yes it is possible, follow the code: public void abrirConfirm() { RequestContext.getCurrentInstance().execute("PF('WidgetVarDoDialog').show();"); } this code serves to open a <p:dialog> also.… 
- 
		2 votes1 answer84 viewsA: How to access a "List" from the screen?Just use: <p:selectOneMenu id="nature" value="#{pokemon.nature}"> <f:selectItems value="#{pokemon.listaNatures()}"/> </p:selectOneMenu> And another suggestion, it seems to me you… 
- 
		0 votes1 answer72 viewsA: Is it possible to return a value using Remotecommand?Well you can do the following: public String testRemote() { String[] id = JSFUtil.getRequestParameterMap().get("id"); System.out.println(id);… 
- 
		2 votes2 answers402 viewsA: Redirect JSF errorIt is because you are not sending the correct id, have to use #{cargo.id}. <p:commandButton icon="ui-icon-pencil" action="form?faces-redirect=true&id=#{cargo.id}"></p:commandButton>… 
- 
		11 votes2 answers18970 views
- 
		3 votes1 answer510 viewsA: Why does JSF not recognize the component id in the View?The problem is not that it recognizes the id but rather it is not finding the correct id path dialog. the right way would be update=":frmAtividade:dialogo-analise". Some components need to do this,… 
- 
		26 votes6 answers10518 viewsQ: Difference between php <?php tags and <?=Well I’m learning Laravel and I was left with a doubt following some tutorials. At certain moments within the view the tag is used : <?php foreach($produtos as $p): ?> and when will I get the… 
- 
		4 votes3 answers381 viewsA: How to create expression that returns 1,12,123,1234 in PythonThe code is very simple: st = '' for i in range(1, 10): st += str(i) print st Online test: link. 
- 
		2 votes2 answers127 viewsA: How to invert values that are comma separated in mysqlUse the method explode to separate by , and then just reorganize. <?php $partes = explode(',', $row['latlng']); $latlng = $partes[0].",".$partes[2].",".$partes[1]; ?>… 
- 
		0 votes2 answers290 viewsA: What is the life cycle behavior of JSF 2 when validating mandatory fields?This is the JSF validation lifecycle: Here is an example of a registration panel: <h:form> <h:panelGrid id="painelCadastro"> <h:outputLabel value="CPF:"/> <h:inputText… 
- 
		1 votes1 answer2713 viewsA: Conversion Error - Null ConverterWhen using a list of Objects in selectOneMenu it is necessary to create a Converter for him. That Converter will convert the itemValue of the item selected for a Plan object (in your case), example… 
- 
		1 votes1 answer58 viewsA: problem with Java validationTo process all fields of your panel you need a button. <p:commandButton value="Salvar" process="painel @this" update="painel"/> With this it processes your dashboard and does the validation.… 
- 
		3 votes2 answers949 viewsA: Add field by clicking buttonThere is no component of Primefaces specific to that. One way to do this is to use the component <p:dataTable>: <p:dataTable id="tabelaLogin" value="#{seu_bean.listaDeLogins}"… 
- 
		1 votes2 answers2205 viewsA: Nothing to migrateTo recreate all tables and run the files from seed, just run the command below. php artisan migration:refresh --seed He will roll back his bank and recreate the bank. Documentation: link;… 
- 
		3 votes2 answers1224 viewsA: Image Preview with JSFollows the code: var loadFile = function(event) { var output = document.getElementById('output'); output.src = URL.createObjectURL(event.target.files[0]); }; <input type="file" accept="image/*"… 
- 
		7 votes1 answer939 viewsA: What is the name of the :: (double-point) operator in PHP?Well, according to the manual, it’s the Operador de Resolução de Escopo, or - the simplest term suggested by the manual - dois pontos duplo. Link of the manual in PT-BR.… 
- 
		2 votes1 answer1254 viewsA: Spacing between JSF buttonsUse the attributes cellpadding and cellspacing to remove spaces between cells: <h:panelGrid columns="4" cellpadding="0" cellspacing="0"> <h:commandButton value="7" /> <h:commandButton… 
- 
		4 votes1 answer600 viewsA: How to change a dynamic template content when the user clicks a button?You can do the following: Define a bean(com @SessionScoped or @ApplicationScoped) to control which page will be displayed. And in your xhtml: <ui:insert name="centro"> <ui:include… 
- 
		2 votes1 answer654 viewsA: Commandbutton Primefaces does not call the methodWhen to use action or actionListener: action is used when you will perform action/nagevação. Your method needs to return a String with the next destination or return null to stay on the same screen.… 
- 
		3 votes2 answers1460 viewsA: Message from "required" PrimefacesJust use the requireMessage of the component: <p:inputText id="inputValue" requiredMessage="SUA MENSAGEM" value="{beam.valor}" required="true" /> 
- 
		3 votes1 answer1333 viewsA: Conditional validation in Primefaces componentYour search button is not processing the description field. You have two options to solve. first: Process inputText by its button <p:commandButton id="search" value="Pesquisar"… 
- 
		1 votes2 answers2211 viewsA: Primefaces p:datatable changing default message "No Records found."?With this CSS you make the default line disappear: .ui-widget-content .ui-datatable-empty-message{ display: none; } There is no easy way to change the default message without changing the Primefaces… 
- 
		1 votes2 answers1849 viewsA: How to understand shopping cart logic in a JSF project?One way you send an object or a list of it to another page is like this: For example in your method adicionar() add the following code: List<Noticia> lista = new ArrayList<>();… 
- 
		0 votes2 answers10669 viewsQ: As local network localhost addressI am testing a web application locally by pc and mobile, connect on pc using http://localhost and by cell phone http://192.168.xx.xx:8080. And I wonder if you have how to change the host address to… 
- 
		1 votes1 answer380 viewsA: Change Bootsfaces themeFrom the agreement with the site for you customize you will have to build by the source of BootsFace. Follows the link from their Github where the Less folder is located.… 
- 
		9 votes1 answer261 viewsQ: Mirroring of DatabaseI am developing an application in Java using database PostgreSQL, locally. I would like to know if there is a way to mirror my local database to an external server? Is there an API on Java for that… 
- 
		0 votes1 answer159 viewsA: Relating entity to more than one entityAn example of bidirectional: public class User { private int id; private String name; @ManyToOne @JoinColumn( name = "groupId") private Group group; } public class Group { private int id; private… 
- 
		7 votes1 answer1148 viewsA: How to structure Hibernate Entity relationship annotations?@One-To-One: The One-to-One association is similar to the Many-to-one association with the difference that the column will be defined as single. Example: @OneToOne public Endereco getEndereco() {… 
- 
		1 votes2 answers453 viewsA: Problems with table configuration in PrimefacesTry the following, I always recommend to use <p:row> and <p:column> in the <p:panelGrid>, if you want to change the size of the Labels column change the width in the first…