[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

JSF commandButton  --  method binding is not working

Posted on 2006-07-19
8
Medium Priority
?
2,396 Views
Last Modified: 2012-06-21
this question is regarding JSF

below is my part of JSF

 <h:commandButton id="create" type="submit" action="#{feedBack.create}" alt="#{bundle.buttonPost}" image="#{facesContext.externalContext.requestContextPath}/HTML-INF/images/buttons/post_button.gif"/>




here is my faces-config

<managed-bean>
<description>Feedback Bean</description>
<managed-bean-name>feedBack</managed-bean-name>
<managed-bean-class>com.vrx.web.bean.FeedBackRecordBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>



and finally FeeBackRecordBean create method


     public FeedBackRecordBean()
     {
          LogManager.getPlatformLogger().log(Level.INFO, "FeedBackRecordBean Constructor");
          this.reset();
     }

public String create() {

log(Level.INFO, "FeedBackRecordBean create Begin");

sendEmail();

return null;
}

I don't know why the JSF is not able to invoke the create method
any kind of help would be appreciated
I can see the log that is inside the constructor but not the one in create method

what i observed is that text fields are invoked, but not the method
so method binding is not working, i double checked spelling
where else can i check i have gone wrong

thanks
0
Comment
Question by:geekprog
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
8 Comments
 
LVL 25

Expert Comment

by:Tomas Helgi Johannsson
ID: 17146381
     Hi!

public String create() {

 LogManager.getPlatformLogger().log(Level.INFO, "FeedBackRecordBean create Begin");

sendEmail();

return null;
}

Regards,
  Tomas Helgi
0
 
LVL 1

Author Comment

by:geekprog
ID: 17148179
LogManager.getPlatformLogger()  -- already exists in my code, i just removed it in this post to make it short
0
 
LVL 25

Expert Comment

by:Tomas Helgi Johannsson
ID: 17148439
try
public String create() {

 LogManager.getPlatformLogger().log(Level.INFO, "FeedBackRecordBean create Begin");

sendEmail();

return "";
}

If you are using the returned string value ( in your case null ) in comparison like String.compareTo(.) or Integer.parseInt(str) you will get NullPointerException.

Regards,
   Tomas Helgi
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:geekprog
ID: 17148627
yeah, i tried

return "";
and
return "dfault";


but my understanding is that method itself is not getting invoked. Since i am not able to see the log statement that is inside the method printed on the console

while i was able to see the log statements that are inside the Constructor

---
and coming back to JSF

i have included this JSF in another JSP using tiles

in that scenario, is there anything i need to know about method binding
or about using   f:view tags

what i was thinking is since my JSF is included in another JSP, i was wondering does the request URL goes back ?  i mean to say that different URL ( original page URL ) might be going back instead of my JSF ( i don't know, what i am talking, i am not that good )
0
 
LVL 1

Author Comment

by:geekprog
ID: 17164157
I will put my question in simple way


can anybody give me some ideas about debugging JSF method binding

i have a java bean, which also contains a method which will email to me

and i am calling this method in my JSF using method binding
and i have a print statement in my method, which doesn't print in the console
which means this method itself is not getting called

i have included this java bean in configuration file

what else do i need to make sure and any other debugging ideas ?
0
 
LVL 1

Author Comment

by:geekprog
ID: 17170635
I solved my problem myself

In my JSF, i have used couple of fields, which includes Date field

In JSF, you have to do conversion for Date and other non String fields. Since it displays only Strings. Read JSF tutorial more about it if you guys wanted to know. That was the reason, my method binding was not working and it wasn't displaying any errors too. Had a tought time debugging this.

I hope my points get refunded to ask more questions

thanks
0
 
LVL 1

Accepted Solution

by:
GhostMod earned 0 total points
ID: 17399952
PAQed with points refunded (350)

GhostMod
Community Support Moderator
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here in this article, you will get a step by step guidance on how to restore an Exchange database to a recovery database. Get a brief on Recovery Database and how it can be used to restore Exchange database in this section!
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question