I get this value always null









up vote
0
down vote

favorite












I have this method in my backing bean, when the user click the bottom this method will be called in order to get the values and update these value in the DB.



public String doApproverActionSendForAwardTeam() 
IIMDelegate iimDelegate = new IIMDelegate();
try
if (isUpdateMode)
addIdeaDto.setIdeaId(hiddenIdeaId);
addIdeaDto.setSendForAwardNotes(addIdeaDto.getSendForAwardNotes());
addIdeaDto.setStatusCode(7);
if (addIdeaDto.getSendForAwardNotes() == null)
addInformationMessage("enter the note...");
return null;


iimDelegate.approverActionSendForAwardTeam(addIdeaDto);
addPointForApprover();
addInformationMessage(" Done ...");
return "goSearchIdeasApproverUI";

catch (Exception e)
e.printStackTrace();
addErrorMessage(" Error...");

return null;



The problem is when i click the bottom if the input text is empty the message show in order to enter the value and after I enter the value is stay same the message it show and show , it mean that there is no value for this input and the method not complete the execution.



I make sure that the value bind right but I do not know why its happend like that, it is not first time to use the information message.



this is the jsp page:



<tr>
<td><rich:panel>
<f:facet name="header">
<h:outputText value=" send idea "></h:outputText>
</f:facet>
<table>
<tr>
<td>
<table>
<tr>
<td width="80px" align="left"><h:outputLabel
value="note"></h:outputLabel></td>
<td width="5px">&nbsp;</td>
<td><h:inputText id="notesId3" maxlength="100" style="width:700px"
value="#ideaDetailsBean.addIdeaDto.sendForAwardNotes"></h:inputText>
</td>
</tr>
</table>
</td>
</tr>
</table>
</rich:panel></td>
</tr>
<tr>
<td width="100%" align="center">
<table>
<td width="3px"><h:commandButton image="6.png" immediate="true"
action="#ideaDetailsBean.doApproverActionSendForAwardTeam">
</h:commandButton></td>
</table>
</td>
</tr>


addIdeaDto class:



public class AddIdeaDto 

private Long ideaId;
private Integer statusCode;
private String sendForAwardNotes;
public Long getIdeaId()
return ideaId;

public void setIdeaId(Long ideaId)
this.ideaId = ideaId;

public Integer getStatusCode()
return statusCode;

public void setStatusCode(Integer statusCode)
this.statusCode = statusCode;

public String getSendForAwardNotes()
return sendForAwardNotes;

public void setSendForAwardNotes(String sendForAwardNotes)
this.sendForAwardNotes = sendForAwardNotes;




it stay in this if, it mean the value of it is always null



if (addIdeaDto.getSendForAwardNotes() == null) 
addInformationMessage("enter the note...");
return null;


only it show the information message even if I enter the value, and notes that I did not use SendForAwardNotes anywhere before this method










share|improve this question























  • Please add the context too, e.g. where does it get addIdeaDto from etc. Also, addIdeaDto.setSendForAwardNotes(addIdeaDto.getSendForAwardNotes()); is redundant.
    – Darshan Mehta
    Nov 10 at 14:19










  • @GhostCat I update my code
    – wadha alketbi
    Nov 10 at 14:27






  • 1




    @GhostCat I update my code
    – wadha alketbi
    Nov 10 at 14:38










  • @ Darshan Mehta what do you mean by redundant?
    – wadha alketbi
    Nov 10 at 15:45










  • I find the problem from this addIdeaDto.getSendForAwardNotes() == null that why it returns to me null.. who i can solve it, acutely this value coming from the jsp page??
    – wadha alketbi
    Nov 10 at 17:58














up vote
0
down vote

favorite












I have this method in my backing bean, when the user click the bottom this method will be called in order to get the values and update these value in the DB.



public String doApproverActionSendForAwardTeam() 
IIMDelegate iimDelegate = new IIMDelegate();
try
if (isUpdateMode)
addIdeaDto.setIdeaId(hiddenIdeaId);
addIdeaDto.setSendForAwardNotes(addIdeaDto.getSendForAwardNotes());
addIdeaDto.setStatusCode(7);
if (addIdeaDto.getSendForAwardNotes() == null)
addInformationMessage("enter the note...");
return null;


iimDelegate.approverActionSendForAwardTeam(addIdeaDto);
addPointForApprover();
addInformationMessage(" Done ...");
return "goSearchIdeasApproverUI";

catch (Exception e)
e.printStackTrace();
addErrorMessage(" Error...");

return null;



The problem is when i click the bottom if the input text is empty the message show in order to enter the value and after I enter the value is stay same the message it show and show , it mean that there is no value for this input and the method not complete the execution.



I make sure that the value bind right but I do not know why its happend like that, it is not first time to use the information message.



this is the jsp page:



<tr>
<td><rich:panel>
<f:facet name="header">
<h:outputText value=" send idea "></h:outputText>
</f:facet>
<table>
<tr>
<td>
<table>
<tr>
<td width="80px" align="left"><h:outputLabel
value="note"></h:outputLabel></td>
<td width="5px">&nbsp;</td>
<td><h:inputText id="notesId3" maxlength="100" style="width:700px"
value="#ideaDetailsBean.addIdeaDto.sendForAwardNotes"></h:inputText>
</td>
</tr>
</table>
</td>
</tr>
</table>
</rich:panel></td>
</tr>
<tr>
<td width="100%" align="center">
<table>
<td width="3px"><h:commandButton image="6.png" immediate="true"
action="#ideaDetailsBean.doApproverActionSendForAwardTeam">
</h:commandButton></td>
</table>
</td>
</tr>


addIdeaDto class:



public class AddIdeaDto 

private Long ideaId;
private Integer statusCode;
private String sendForAwardNotes;
public Long getIdeaId()
return ideaId;

public void setIdeaId(Long ideaId)
this.ideaId = ideaId;

public Integer getStatusCode()
return statusCode;

public void setStatusCode(Integer statusCode)
this.statusCode = statusCode;

public String getSendForAwardNotes()
return sendForAwardNotes;

public void setSendForAwardNotes(String sendForAwardNotes)
this.sendForAwardNotes = sendForAwardNotes;




it stay in this if, it mean the value of it is always null



if (addIdeaDto.getSendForAwardNotes() == null) 
addInformationMessage("enter the note...");
return null;


only it show the information message even if I enter the value, and notes that I did not use SendForAwardNotes anywhere before this method










share|improve this question























  • Please add the context too, e.g. where does it get addIdeaDto from etc. Also, addIdeaDto.setSendForAwardNotes(addIdeaDto.getSendForAwardNotes()); is redundant.
    – Darshan Mehta
    Nov 10 at 14:19










  • @GhostCat I update my code
    – wadha alketbi
    Nov 10 at 14:27






  • 1




    @GhostCat I update my code
    – wadha alketbi
    Nov 10 at 14:38










  • @ Darshan Mehta what do you mean by redundant?
    – wadha alketbi
    Nov 10 at 15:45










  • I find the problem from this addIdeaDto.getSendForAwardNotes() == null that why it returns to me null.. who i can solve it, acutely this value coming from the jsp page??
    – wadha alketbi
    Nov 10 at 17:58












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have this method in my backing bean, when the user click the bottom this method will be called in order to get the values and update these value in the DB.



public String doApproverActionSendForAwardTeam() 
IIMDelegate iimDelegate = new IIMDelegate();
try
if (isUpdateMode)
addIdeaDto.setIdeaId(hiddenIdeaId);
addIdeaDto.setSendForAwardNotes(addIdeaDto.getSendForAwardNotes());
addIdeaDto.setStatusCode(7);
if (addIdeaDto.getSendForAwardNotes() == null)
addInformationMessage("enter the note...");
return null;


iimDelegate.approverActionSendForAwardTeam(addIdeaDto);
addPointForApprover();
addInformationMessage(" Done ...");
return "goSearchIdeasApproverUI";

catch (Exception e)
e.printStackTrace();
addErrorMessage(" Error...");

return null;



The problem is when i click the bottom if the input text is empty the message show in order to enter the value and after I enter the value is stay same the message it show and show , it mean that there is no value for this input and the method not complete the execution.



I make sure that the value bind right but I do not know why its happend like that, it is not first time to use the information message.



this is the jsp page:



<tr>
<td><rich:panel>
<f:facet name="header">
<h:outputText value=" send idea "></h:outputText>
</f:facet>
<table>
<tr>
<td>
<table>
<tr>
<td width="80px" align="left"><h:outputLabel
value="note"></h:outputLabel></td>
<td width="5px">&nbsp;</td>
<td><h:inputText id="notesId3" maxlength="100" style="width:700px"
value="#ideaDetailsBean.addIdeaDto.sendForAwardNotes"></h:inputText>
</td>
</tr>
</table>
</td>
</tr>
</table>
</rich:panel></td>
</tr>
<tr>
<td width="100%" align="center">
<table>
<td width="3px"><h:commandButton image="6.png" immediate="true"
action="#ideaDetailsBean.doApproverActionSendForAwardTeam">
</h:commandButton></td>
</table>
</td>
</tr>


addIdeaDto class:



public class AddIdeaDto 

private Long ideaId;
private Integer statusCode;
private String sendForAwardNotes;
public Long getIdeaId()
return ideaId;

public void setIdeaId(Long ideaId)
this.ideaId = ideaId;

public Integer getStatusCode()
return statusCode;

public void setStatusCode(Integer statusCode)
this.statusCode = statusCode;

public String getSendForAwardNotes()
return sendForAwardNotes;

public void setSendForAwardNotes(String sendForAwardNotes)
this.sendForAwardNotes = sendForAwardNotes;




it stay in this if, it mean the value of it is always null



if (addIdeaDto.getSendForAwardNotes() == null) 
addInformationMessage("enter the note...");
return null;


only it show the information message even if I enter the value, and notes that I did not use SendForAwardNotes anywhere before this method










share|improve this question















I have this method in my backing bean, when the user click the bottom this method will be called in order to get the values and update these value in the DB.



public String doApproverActionSendForAwardTeam() 
IIMDelegate iimDelegate = new IIMDelegate();
try
if (isUpdateMode)
addIdeaDto.setIdeaId(hiddenIdeaId);
addIdeaDto.setSendForAwardNotes(addIdeaDto.getSendForAwardNotes());
addIdeaDto.setStatusCode(7);
if (addIdeaDto.getSendForAwardNotes() == null)
addInformationMessage("enter the note...");
return null;


iimDelegate.approverActionSendForAwardTeam(addIdeaDto);
addPointForApprover();
addInformationMessage(" Done ...");
return "goSearchIdeasApproverUI";

catch (Exception e)
e.printStackTrace();
addErrorMessage(" Error...");

return null;



The problem is when i click the bottom if the input text is empty the message show in order to enter the value and after I enter the value is stay same the message it show and show , it mean that there is no value for this input and the method not complete the execution.



I make sure that the value bind right but I do not know why its happend like that, it is not first time to use the information message.



this is the jsp page:



<tr>
<td><rich:panel>
<f:facet name="header">
<h:outputText value=" send idea "></h:outputText>
</f:facet>
<table>
<tr>
<td>
<table>
<tr>
<td width="80px" align="left"><h:outputLabel
value="note"></h:outputLabel></td>
<td width="5px">&nbsp;</td>
<td><h:inputText id="notesId3" maxlength="100" style="width:700px"
value="#ideaDetailsBean.addIdeaDto.sendForAwardNotes"></h:inputText>
</td>
</tr>
</table>
</td>
</tr>
</table>
</rich:panel></td>
</tr>
<tr>
<td width="100%" align="center">
<table>
<td width="3px"><h:commandButton image="6.png" immediate="true"
action="#ideaDetailsBean.doApproverActionSendForAwardTeam">
</h:commandButton></td>
</table>
</td>
</tr>


addIdeaDto class:



public class AddIdeaDto 

private Long ideaId;
private Integer statusCode;
private String sendForAwardNotes;
public Long getIdeaId()
return ideaId;

public void setIdeaId(Long ideaId)
this.ideaId = ideaId;

public Integer getStatusCode()
return statusCode;

public void setStatusCode(Integer statusCode)
this.statusCode = statusCode;

public String getSendForAwardNotes()
return sendForAwardNotes;

public void setSendForAwardNotes(String sendForAwardNotes)
this.sendForAwardNotes = sendForAwardNotes;




it stay in this if, it mean the value of it is always null



if (addIdeaDto.getSendForAwardNotes() == null) 
addInformationMessage("enter the note...");
return null;


only it show the information message even if I enter the value, and notes that I did not use SendForAwardNotes anywhere before this method







java jsp jsf






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 10 at 14:43

























asked Nov 10 at 13:59









wadha alketbi

274




274











  • Please add the context too, e.g. where does it get addIdeaDto from etc. Also, addIdeaDto.setSendForAwardNotes(addIdeaDto.getSendForAwardNotes()); is redundant.
    – Darshan Mehta
    Nov 10 at 14:19










  • @GhostCat I update my code
    – wadha alketbi
    Nov 10 at 14:27






  • 1




    @GhostCat I update my code
    – wadha alketbi
    Nov 10 at 14:38










  • @ Darshan Mehta what do you mean by redundant?
    – wadha alketbi
    Nov 10 at 15:45










  • I find the problem from this addIdeaDto.getSendForAwardNotes() == null that why it returns to me null.. who i can solve it, acutely this value coming from the jsp page??
    – wadha alketbi
    Nov 10 at 17:58
















  • Please add the context too, e.g. where does it get addIdeaDto from etc. Also, addIdeaDto.setSendForAwardNotes(addIdeaDto.getSendForAwardNotes()); is redundant.
    – Darshan Mehta
    Nov 10 at 14:19










  • @GhostCat I update my code
    – wadha alketbi
    Nov 10 at 14:27






  • 1




    @GhostCat I update my code
    – wadha alketbi
    Nov 10 at 14:38










  • @ Darshan Mehta what do you mean by redundant?
    – wadha alketbi
    Nov 10 at 15:45










  • I find the problem from this addIdeaDto.getSendForAwardNotes() == null that why it returns to me null.. who i can solve it, acutely this value coming from the jsp page??
    – wadha alketbi
    Nov 10 at 17:58















Please add the context too, e.g. where does it get addIdeaDto from etc. Also, addIdeaDto.setSendForAwardNotes(addIdeaDto.getSendForAwardNotes()); is redundant.
– Darshan Mehta
Nov 10 at 14:19




Please add the context too, e.g. where does it get addIdeaDto from etc. Also, addIdeaDto.setSendForAwardNotes(addIdeaDto.getSendForAwardNotes()); is redundant.
– Darshan Mehta
Nov 10 at 14:19












@GhostCat I update my code
– wadha alketbi
Nov 10 at 14:27




@GhostCat I update my code
– wadha alketbi
Nov 10 at 14:27




1




1




@GhostCat I update my code
– wadha alketbi
Nov 10 at 14:38




@GhostCat I update my code
– wadha alketbi
Nov 10 at 14:38












@ Darshan Mehta what do you mean by redundant?
– wadha alketbi
Nov 10 at 15:45




@ Darshan Mehta what do you mean by redundant?
– wadha alketbi
Nov 10 at 15:45












I find the problem from this addIdeaDto.getSendForAwardNotes() == null that why it returns to me null.. who i can solve it, acutely this value coming from the jsp page??
– wadha alketbi
Nov 10 at 17:58




I find the problem from this addIdeaDto.getSendForAwardNotes() == null that why it returns to me null.. who i can solve it, acutely this value coming from the jsp page??
– wadha alketbi
Nov 10 at 17:58

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53239701%2fi-get-this-value-always-null%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53239701%2fi-get-this-value-always-null%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kleinkühnau

Makov (Slowakei)

Deutsches Schauspielhaus