atom feed5 messages in org.netbeans.nbusersUsing function in JSF page
FromSent OnAttachments
Stephen CarpenterDec 15, 2006 4:54 pm 
Craig McClanahanDec 15, 2006 5:09 pm 
Stephen CarpenterDec 18, 2006 9:26 am 
Craig McClanahanDec 18, 2006 2:34 pm 
Stephen CarpenterDec 21, 2006 4:43 am 
Subject:Using function in JSF page
From:Stephen Carpenter (step@hotmail.co.uk)
Date:Dec 18, 2006 9:26:27 am
List:org.netbeans.nbusers

Craig,

Many thanks for the reply. I'm fine with the strategy, but this is my very first use of a function and I cannot see how to : -

'Have your popup store its returned value in the "value" attribute of the hidden field component'.

Here is how my fundtion looks : - <webuijsf:script binding="#{Edit.script1}" id="script1"> function setDelete(){ if(confirm("Are you sure you want to delete this record?")){ return "true" }else{ return "false" } } </webuijsf:script>

And here is the JSF declaration : -

<webuijsf:hiddenField binding="#{Edit.hiddenField1}" id="hiddenField1" text="#{SessionBean1.strDelete}"/>

Could you clarify please.

On 12/15/06, Stephen Carpenter <step@hotmail.co.uk> wrote:

Hi,

I am using Netbeans 5.5 with VWP and have created a page which throws up a popup to confirm that the user wanst to delete a record in db.

I get the popup OK, and if I call the popup (running thro a jsp function) from the onClick() event from a textfield - I get the return value either 'true' or 'false' in the textfield.

My problem is that I need to call the popup from a Delete button and capture the return value. I am trying to do this via a property in the session bean (SessionBean1) called strDelete which has a getter and setter. I need to know how to save the return value to the bean.

I have been thro umpteen forums and tutorials and therefore any asistance would be VERY GREATLY appreciated.

Since the session bean lives on the server, and not in your client, you can't get to it directly. But, consider a strategy like this:

* Add a "Hidden Field" component in your form. Bind the "text" property to your session bean property so that it will get updated when the form is submitted.

* Have your popup store its returned value in the "value" attribute of the hidden field component.

* Now, when the form is submitted, you'll be able to see what value was returned by the popup.

Craig