Kayıtlar

Richfaces ListShuttle Javascript Manipulation by jQuery

Hi again, for people who are still using Rich Faces with version 3.3.x and having problems in manipulating ShuttleList component via javascript, i have a solution for you. But i have to warn you before that it is not the best solution around. So I have a scenario in which when user selects not interested option then we need to deselect other options from the selected list. You may think that you can do it in server side but what if you have a problem with reRender because it does not works! Then here is my solution for you. Some people who just doesn't want to go to server side for such problem would like it i think. function beforeListChange(compId) { var srcValues = jQuery(jQuery(document.getElementById(compId)) .find('.rich-shuttle-body').find('.rich-shuttle-internal-tab')[0]).find('tr'); var tarValues = jQuery(jQuery(document.getElementById(compId)) .find('.rich-shuttle-body').find('.rich-shuttle-i...

Adding images dynamically via jQuery and resizing according to the container

Hi, suppose that you have a web service which returns image url's and you need to load them dynamically into your page via javascript with the help of jQuery but image sizes can vary and you need to resize them according to the size of your container div but if the image is smaller than the container div then you need to leave them as they are. You tried to set img tags display style as inline but it didn't work. Then you are welcome here is the solution for this trouble: HTML <div id="containerDivId" width="580" height="380" /> Script var img = $('<img>'); img.attr('src', 'http://upload.wikimedia.org/wikipedia/commons/thumb/c/c7/Rubber_duck.jpeg/512px-Rubber_duck.jpeg'); img.appendTo('#containerDivId'); if(img[0].width>580) img[0].width = 580; if(img[0].height>380) img[0].height = 380;

Richfaces reRender does not work after validation error

hi again folks, another strange problem with jsf behavior. For example you have a data grid and when u double click in a row you open up a pop up which contains a separate form and some fields on this pop up contains required attribute. When you submit this form required fields empty you will get a validation error. Till this time everything is ok but strange things starts after this. You closed the form popup and this time clicked another row on data table and what you see is really strange you see the pop up form with the same values after validation error. According to guys at rich faces forums this is normal and it is because of nature of jsf. U may comment this situation as you should re set bean values but you are already doing this so what to do? Yes again according to guys at rich faces forums you should reset the popup form. You can do this by defining an action listener each time opening the new form with the code given below. I took these code from rich faces forums and ...

Richfaces DataTable Fixed Header

Hi folks, for people who want to have a datatable with a fixed header but not want to use richfaces:extendeddatatable you may use following solution. I seeked internet a lot to find a better solution but couldn't find any solution for this. anyway here is my solution: first i need to tell you that you need to have jQuery for following solution: please note that "#customerForm\\:custTable" is the id of the datatable jQuery(document).ready(function() { initFixedHeader(); }); function initFixedHeader(){ if(jQuery('#myDiv').scroll()) jQuery('#myDiv').scroll(moveScroll); var componentId = '#{rich:clientId('custTable')}'; componentId = componentId.replace(/:/g, "\\\:"); jQuery('#inDiv').empty(); ...

Adobe Flex RIA Dünyasının Gerçek Başlangıçı

Web 2.0 öncesi dinamik web sayfalarımız ve onlardan beklentilerimiz oldukça basitti. Daha önceden mevcut olan Javascript , XMLHTTPRequest in birleşimiyle AJAX icat oldu sayfalardan beklentilerimiz arttı. Adını bile sayamıyacağımız kadar javascript , AJAX kütüphaneleri çıktı karşımıza birkaç insan bu frameworklere gerek duymadan kendi başlarına modüler olmayan javascriptlerle işlerini gördüler. Ancak burda dananın kuyruğunun koptuğu nokta javascript , css kullanılarak yaratılan bu kütüphanelerin her ne kadar her türlü browser da çalışma iddiaları olsa da pratik anlamda pek öyle olmadığı görüldü. En azından desktop application'ı kıvamında web uygulamaları yazmanın bu frameworklerde ezziyet olduğunu gözüm kapalı söyleyebilirim. *** Lütfen şimdi bu işlere derinlemesine bulaşmaktan kaçınmayacak dirty programmerlar ve kütüphane geliştirecek kadar iyi javascript , CSS bilgisi olan arkadaşlar ne saçmalıyor bu cahil demesinler. Benim baktığım RIA dünyasında görmek istediğim WYSIWYG'den ...

JSF Richfaces

Son zamanlarda en büyük zevkim java web frameworklerin cicili bicili component explorerlarına göz atıp evet işte aradığım framework bu demek. Şirketimizdeki araştırmalar ve yakın çevremde benden bu konuda daha iyi bilgili insanların gazları sayesinde bir java standartı olan JSF üzerinde durmak gerektiği düşüncesi hakim oldu. *** Tabi jsf in standart implementasyonları ve myfaces gibi implementasyonların istenilen ajax şovları için yetersiz olduğu malumunuz bu yüzden jboss'un Richfacesını denemeye karar kıldım. Standart bir jsf input component'ine ajax desteği kazandırmak ve sayfadaki elemanları idleriyle ile sayfayı tamamen refresh etmeden reRenderlamak başta güzel kolay basit gibi gözüktü ancak malesef swing ile yazmanız 1 gün sürecek bir ekranı uzunca bir sürede çalışmasından memnun kalacak şekilde bitirmek mümkün olmadı. Başta bunun kendi eksikliğimden kaynaklandığını düşünürken konu üzerinde biraz daha uğraşmam sonucu Richfaces'ın vaat ettiklerinin ardından development...

Web Frameworks ve Java

Java ve open source ... Evet bu iki kavram birbirlerinden bağımsız dursalar da şunu kabul etmek gerekir ki ikisi de birbirlerine sıkı şekilde bağımlılar. tabi ki open source yazılımlar için java şart değil veya javanın var olabilimesi open source olması gerekli değil. Ancak open source yazılımların geliştirilmesindeki en çok kullanılan dillerden biri bugün baktığımızda java. Başlığa bakarak ne zırvaladığımı sorabilirsiniz o vakit sadete gelmekte fayda var : Evet open source ve javanın etkileşiminden hepimiz son derece memnunuz tomcat , eclipse , struts , spring,hibernate ,gwt ve en önemlisi javanın kendisi opensource ve ücretsiz ancak java ile web programlama yapanlar bilirler ki konu web yazılımı geliştirmek olunca işler biraz kompleksleşiyor. Tabi bu karmaşa sizin bir web frameworkünden beklentilerinizle de değişiyor basit bir tabloya basım ve form işlemleri için struts 2(struts değil) gayet yeterli olacakken web 2.0 kavramı ile hayatımıza giren ajax işleri zorlaştırdığı gibi s...