dev@woodstock.java.net

Re: Alert and DynaFaces in woodstock components 4.2 build 2

From: richard ratta <Richard.Ratta_at_Sun.COM>
Date: Tue, 19 Feb 2008 22:13:29 -0500

What does your original JSP page look like ?
How are the alert and the other components defined ?
Are they defined by markup in the JSP page or created as components in
the ManagedBean ?

I wondering if the id's are mapping to the components in the view true
during the request.

What is happening in the debugger on the server ?
Is the Alert being reconstruced during RESTORE_VIEW ?

-rick

Dipesh Patel wrote:

> i am using woodstock 4.2 build 2.
>
> there are no javascript errors.
>
> and i have included the jsf extention support with webuijsfx=true
>
> and initially i have not made alert invisible.
>
> On Feb 19, 2008 11:06 PM, Dan Labrecque <Dan.Labrecque_at_sun.com
> <mailto:Dan.Labrecque_at_sun.com>> wrote:
>
> Dipesh Patel wrote:
>
>> Hello,
>>
>> I am using alert component.
>>
>> i have delete button which delete the item and shows message in
>> alert component and on click of delete component i have used the
>> following script
>>
>> <webuijsf:button
>> actionExpression="#{products$ProductHome.btndeletproducteattachment_action}"
>>
>> binding="#{products$ProductHome.btndeletproducteattachment}"
>> id="btndeletproducteattachment"
>> onClick="return
>> btndeleteproductattachment(this);" primary="true"
>> style="width: 71px" text="Delete"/>
>>
>> function btndeleteproductattachment(temp) {
>> var h=confirm("Are you sure you want to delete this product");
>>
>> if(h==true)
>> {
>> var h=temp.value;
>>
>> document.getElementById('form1:hiddenid').setProps({value:h});
>>
>> DynaFaces.fireAjaxTransaction(temp,{execute:temp.id+',form1:hiddenid',render:'*form1:mainpanel:alertpanel:alert1*,form1:mainpanel:layoutPanel2:layoutPanel4:tabSet1:tbattachments:layoutPanel17:attachmenttablepanel'});
>> }
>> return false;
>>
>> }
>>
>> here *form1:mainpanel:alertpanel:alert1 *is the alert component i
>> want to rendered using dynafaces but it is not rendered
>>
>> but when i do not use ajax i.e dynafaces the alert is rendered.
>
>
> 1. What version of Woodstock are you using?
> 2. Do you have any JavaScript errors?
> 3. Have you included JSF Extensions in the page? If not, please
> read the Woodstock release notes.
>
>
>>
>> *and also
>> document.getElementById('form1:mainpanel:alertpanel:alert1').refresh()
>> does not work.
>>
>> *
>
>
> Calling refresh without any properties simply renders the
> component in its original state. If the alert was hidden when the
> page was loaded, it will not be visible after a refresh. That is,
> unless you submit another value (e.g., from a hidden field) so you
> can change the state before it is re-rendered. You provided the
> execute property to DynaFaces, so you'll have to do the same here.
>
> Dan
>
>
>
>
> --
> Dipesh Patel
> Computer Engineer