eclipse-ee4j / mojarra-jsf-extensions

Other
1 stars 3 forks source link

fireAjaxTransaction for input text with null value problem #82

Open glassfishrobot opened 16 years ago

glassfishrobot commented 16 years ago

I have an input text component which is ajaxified using fireAjaxTransaction wired into the onchange event. This works OK when a value is entered in the input field. However, if I then try to blank out the value then it posts the value as being 'x' (I can see this using Firebug). I would expect it to send an empty string or nothing.

Environment

Operating System: All Platform: PC

Affected Versions

[current]

glassfishrobot commented 5 years ago
glassfishrobot commented 16 years ago

@glassfishrobot Commented Reported by sjoglesby

glassfishrobot commented 16 years ago

@glassfishrobot Commented rogerk said: Can you please specify exactly what your fireAjaxTransaction command looks like (cut and paste it)?

glassfishrobot commented 16 years ago

@glassfishrobot Commented sjoglesby said: Here is the input that is doing the fireAjaxTransaction.

<input id="bodySubView:CreateSPS:outerPanel:j_id38:nominalInput" type="text" name="bodySubView:CreateSPS:outerPanel:j_id38:nominalInput" value="x" cols="0" onchange="DynaFaces.fireAjaxTransaction(this,

{execute: 'bodySubView:CreateSPS:outerPanel:j_id38:nominalInput', render: 'bodySubView:CreateSPS:outerPanel:j_id38:nominalInput,bodySubView:Create SPS:outerPanel:j_id38:nominalInputMessage', inputs: 'bodySubView:CreateSPS:outerPanel:j_id38:nominalInput,_uccId'}

);return false;" rows="0"/>

I have managed to do some debugging and found that line 710 of com_sun_faces_ajax.js is setting the value to x if it is an empty string and the fireAjaxTransaction was invoked by that input. The line reads:

709 if (action && action.form)

{ 710 this[action.name] = action.value || 'x'; 711 }

I guess this sets it to a value for command buttons in order that you can tell who fired the event?

glassfishrobot commented 16 years ago

@glassfishrobot Commented sjoglesby said: Hi, Just to be clear. If the current value is '500' and I then blank it out then it gets posted as 'x'. It just happens that the current value is x because I have been debugging and it keeps setting it to x.

glassfishrobot commented 16 years ago

@glassfishrobot Commented Issue-Links: blocks JSF_EXTENSIONS-84

glassfishrobot commented 16 years ago

@glassfishrobot Commented Was assigned to rogerk

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA JSF_EXTENSIONS-82