Why doesn't button push work?

I have a form with an h:command Button.

I set the action to the default value for this button of "okBtn_action()"

When I push the button, 'okBtn_action()' appears that it is not

called. When I place a break point in the function, it does not break

in the debugger.

If I check the 'immediate' flag, then it gets called and the debugger stops

at the break point as expected. The problem is that the form also

contains a ui:textField with the text bound to a parameter in the sessioin bean.

This value does not get set if I use the immediate flag.

Why does this not work as expected?

I am expecting the button press to call the okBtn_Action() method

sometime in this process.

[749 byte] By [burferda] at [2007-11-26 20:49:35]
# 1
my guess...check virtual forms-dElay
dElaya at 2007-7-10 2:13:35 > top of Java-index,Development Tools,Java Tools...
# 2
Virtual Forms?This is just a plain vanilla page with nothing special.Just text fields with strings bound to session bean properties and a button.
burferda at 2007-7-10 2:13:35 > top of Java-index,Development Tools,Java Tools...
# 3

I tried to reproduce your problem, but button worked for me. Here is the part of jsp code for the button:

<h:commandButton action="#{button.button1_action}" binding="#{button.button1}" id="button1"

style="position: absolute; left: 192px; top: 168px" value="Submit"/>

--Hong

From Creator Team

Hong_Lua at 2007-7-10 2:13:35 > top of Java-index,Development Tools,Java Tools...
# 4

Basically I have the same thing for my jsp.

<h:commandButton> action= "#{InPage.applyBtn_action}" binding="#{InPage.applyBtn}" id="applyBtn" value="Apply">

This is not a cut and paste, but the only thing missing is the style= section.

There is an applyBtn_action method in the java portion of the page that was created when I bound the button to the action by JSC2.

The only way I could get it to work is to use 'immediate'.

But I have an even stranger problem on another page.

The button works when the page is first drawn, but when I navigate

away and come back, the apply method is not called.

When in debug, I can trace the action in that the first time, the apply method is called. When I navigate away and come back, the apply method is never called, just the prerender method.

I do not understand how this can happen at all.

burferda at 2007-7-10 2:13:35 > top of Java-index,Development Tools,Java Tools...
# 5
I still cannot reproduce the problem. Could you provide steps to reproduce the problem?Thanks,--HongFrom Creator Team
Hong_Lua at 2007-7-10 2:13:35 > top of Java-index,Development Tools,Java Tools...
# 6

I have no clue as to why this is happening.

The form was created in a very straight forward manner usuing the graphical editor

The thing that baffles me most is that in the debugger, I can set a break pont in the button push action method and the prerender method.

The first time through I push the button, the button action method is called and then the prerender method.

The second time through, the button method is not called, just the prerender method.

I suspect some property is getting set somehow, but I do not know what would cause this kind of behavior.

burferda at 2007-7-10 2:13:35 > top of Java-index,Development Tools,Java Tools...
# 7

Could there be some issue with the calendar component that might be causing this kind of problem?

The two pages that I have that show this behavior both have calendar components. I noticed that if I do not use the calendar component, the problem does not seem to happen.

After I use the calendar component to select a date, the apply button on my page appears not to work.

burferda at 2007-7-10 2:13:35 > top of Java-index,Development Tools,Java Tools...
# 8
Could you provide me more details on what the pages do? Do you have validators in the pages? --HongFrom Creator Team
Hong_Lua at 2007-7-10 2:13:35 > top of Java-index,Development Tools,Java Tools...
# 9
I think your button is not in between <ui: > </ui> tagsPlease check if it is not the action method will not work.
anikhindia at 2007-7-10 2:13:35 > top of Java-index,Development Tools,Java Tools...
# 10
I'm using h:command button inside ui:panelLayout.All jsp page stuff seems ok. Nothing complaiins.I
burferda at 2007-7-10 2:13:35 > top of Java-index,Development Tools,Java Tools...
# 11

Hong.

I do not have validators on the page.

Everything is really plain vanilla usign JSC defaults.

I found that the ONLY way I could get things to work was to check the 'immediate' option on the push buttons. When I do this, the menu components do not update from the session bean properties they are bound to. The bean properties get updated, but the components do not. I then had to go into the prerender portion of the page and manually update the menu components from the bean properties.

burferda at 2007-7-10 2:13:35 > top of Java-index,Development Tools,Java Tools...
# 12

I am now experiencing a similar issue on a project that I have been working on for a fairly long time and on a different computer.

I have a menu panel with ui:button components that each have a separate buttonName_action() method that was generated by JSC2.

This application has been working properly for months. Now, I am experiencing the same problem. I navigate onto a page and for some reason, the buttonName_action methods are not being called.

There is one common point between this application and the one where I first started observing this condition. BOTH applications create a dynamic grid in the page where the problem first starts. I am at a loss to understand how this could cause this problem, but that is the ONLY thiing they have in common.

Is there any possibility that there could be some issues caused by generating components dynamically?

Is there any property that could be getting set that would cause this kiind of problem?

burferda at 2007-7-10 2:13:35 > top of Java-index,Development Tools,Java Tools...
# 13
There is one issue with button on IE you may want to know: http://www.nabble.com/VWPsubmit-button-and-IE-browser-tf3039704.html#a844848 5--Hong
Hong_Lua at 2007-7-10 2:13:35 > top of Java-index,Development Tools,Java Tools...
# 14

Hello Hong,

I have a very similar problem. A web app written using Creator 2 Update 1 has a button that only calls the action method if using Mozilla. It is not called in IE 6. Initially, the IE 6 Browser displayed the appropriate navigation associated with the action method. After some modifications, such as adding a table, the action method was no longer called. I can not locate any hidden characters, etc. that would cause the problem. Again, the action method is valid, and it works in Mozilla. It is clear there is an issue with the IE 6 browser, I'm just not sure how to correct the problem. I must use IE for this project. If I can't, I may have to reconsider the platform to be used. Is there anyone actively looking into this issue?

Best,

gmoney

gmoneya at 2007-7-10 2:13:35 > top of Java-index,Development Tools,Java Tools...