Win a copy of Rust Web Development this week in the Other Languages forum!

Milan Mendpara

+ Follow
since May 10, 2011
Milan likes ...
Netbeans IDE PHP Java
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Milan Mendpara

i'm using ajax in almost every jsf page ...
i found it very useful ..

but i wondering whether excessive use of f:ajax is good programming attitude or not ?
can you please tell me any drawbacks of f:ajax ? in-case of project maintenance is it good ?

10 years ago
it might work for you by casting it to GregorianCalendar .........

<ace:dateTimeEntry value="#{backBean.urDate}">
<f:convertDateTime dateStyle="short" pattern="MM/dd/yyyy" type="date" />

Calendar cal = Calendar.getInstance();
XMLGregorianCalendar xcal = DatatypeFactory.newInstance().newXMLGregorianCalendar((GregorianCalendar) cal);
// your code
10 years ago
do something like this :

<t:inputFileUpload id="fileupload" value="#{uploadBean.ufile}" />

import org.apache.myfaces.custom.fileupload.UploadedFile;

public class UploadBean {
UploadedFile Ufile;

public String doUpload() {
String prefix = FilenameUtils.getBaseName(Ufile.getName()); // returns the file name
String suffix = FilenameUtils.getExtension(Ufile.getName()); // returns the extension

// do your upload code

i hope it will work for you acoording to your requirement ....
10 years ago
hi !

i've set pagination in ajax with four command button like first,next,previous,last.
it works fine for the first(any among four) button that i have pressed ....... all the subsequent click on that button , ajax listener method is fired ...
but other button's listener method is not fired then onwards

<h:form >
<h:datatable id=myDatatable >
// some code
<h:commandButton id="btnFirst" value="First" >
<f:ajax execute="@form" event="action" render="myDatatable hdnPage" listener="#{zoneBean.first}" />
<h:commandButton id="btnPrevious" value="Previous" >
<f:ajax execute="@form" event="action" render="myDatatable hdnPage" listener="#{zoneBean.previous}"/>
<h:commandButton id="btnNext" value="Next" >
<f:ajax execute="@form" event="action" render="myDatatable hdnPage" listener="#{} />
<h:commandButton id="btnLast" value="Last" >
<f:ajax execute="@form" event="action" render="myDatatable hdnPage" listener="#{zoneBean.last}" />

<h:inputHidden id="hdnPage" value="#{}" />

// sample of managed bin

// bean scope : requestScope

public void next(AjaxBehaviourEvent e) {
zoneList = port.getAllZones().subList(page * pageRows, page * pageRows + pageRows);

i hope you understand my problem .. . so any idea how can i call more than one listener method for the JSF components ?

thanks in advance !!!

10 years ago

i guess browser is not set as default ...

make sure that your browser is set as default by configure it in your development tool (IDE) ......

10 years ago
i'm facing the same problem ...

i don't know whether it is proper way to do the things or not

but i've use the tomahawk.jar of tomahawk12-1.1.10 and other dependencies(.jars) from tomahawk20-1.1.10 then everything is working fine
for me and components are render perfectly ......
10 years ago
I have a page(say A.jsf) from which a managed bean action method is called then it navigate to another jsf page(lsay B.jsf) along with one again when i do some action on that page(B.jsf) the object got null reference. my bean scope is ReuestScoped........
<f:setPropertyActionListener target="#{zoneBean.zoneID}" value="#{row.zoneId}" />

so how can maintain the reference of that object ???

in A.jsf i'm doing something like this ..

<h:commandLink value="Edit" action="#{zoneBean.edit}" >
<f:setPropertyActionListener target="#{zoneBean.zoneObj}" value="#{row}" />

thanks in advance ..
10 years ago