You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by sh...@wipro.com on 2007/03/06 12:43:03 UTC

Regarding sandbox's inputSuggestAjax tag

Hi,

            I am using sandbox's inputSuggestAjax tag. It is working
fine in my application. But the problem is if you are typing text in the
<s:inputSuggestAjax> field for every character typing its calling the
suggest method. At that time if I submit the form then it has to ignore
the previous requests. Is there any way to ignore the previous requests.

 

My code look like as follows:

 

            <s:inputSuggestAjax id="customerId"
suggestedItemsMethod="#{customerBean.getCustomerIdSuggestItems}"

 
value="#{customerBean.customerId}" maxSuggestedItems="5"/>

            <h:commandButton id="customerBeanCommandButtonNextId"
action="#{customerBean.next}" value="Next"/>

 

Regards,

Basha




The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

Re: Regarding sandbox's inputSuggestAjax tag

Posted by Werner Punz <we...@gmail.com>.
Werner Punz schrieb:
> shaikyesdani.basha@wipro.com schrieb:
>> Hi,
>>
>>             I am using sandbox’s inputSuggestAjax tag. It is working
>> fine in my application. But the problem is if you are typing text in the
>> <s:inputSuggestAjax> field for every character typing its calling the
>> suggest method. At that time if I submit the form then it has to ignore
>> the previous requests. Is there any way to ignore the previous requests.
>>
>>  
> You cannot really influence the behavior easily (there is an internal
> mechanism however which has the state history of your component tree)
> but I would not roll back that one programmatically.
> The best bet is if you cannot live with this request pattern which is
> inherently ajax related, that you move away from the inputsuggestajax
> entirely and use the simple suggest control.
> 
> 
also another thing i forgot, if you fear losing values over the request
boundaries, you always can add a dialog system to your mix of
tools, which resolves such an issue
or work with the session.

Available dialog systems
seam, fusion, shale dialog, spring webflow



Re: Regarding sandbox's inputSuggestAjax tag

Posted by Werner Punz <we...@gmail.com>.
shaikyesdani.basha@wipro.com schrieb:
> Hi,
> 
>             I am using sandbox’s inputSuggestAjax tag. It is working
> fine in my application. But the problem is if you are typing text in the
> <s:inputSuggestAjax> field for every character typing its calling the
> suggest method. At that time if I submit the form then it has to ignore
> the previous requests. Is there any way to ignore the previous requests.
> 
>  
You cannot really influence the behavior easily (there is an internal
mechanism however which has the state history of your component tree)
but I would not roll back that one programmatically.
The best bet is if you cannot live with this request pattern which is
inherently ajax related, that you move away from the inputsuggestajax
entirely and use the simple suggest control.


Re: h:messages within f:subview not working

Posted by Werner Punz <we...@gmail.com>.
Hi I sent the answer already over the mail
but just for history reasons

you have the use the full client id
of the component which is
<formid>:<viewid>:<suvbviewid>:<componentid>


you can use componentbindings to get it programmatically
component.getClientId(facesContext)

alternatively, but this is a bad method, you can look up the markup and
check which id has been generated, but if your nesting changes the ids
will change also every component within this nesting has to have an id set!

for convenience purposes you also can use forceId="true" on the tomahawk
components, they enforce an id, but also then you have to have one
single id with this name in the entire page.

Werner



SOSELLA@austin.rr.com schrieb:
> I am using the following JSF code snippet:
> 
> <f:view>
>    ...
>    <f:subview>
>       <h:messages />
>       ...
>    </f:subview>
>    ...
> </f:view>
> 
> and in the backing bean I am adding an error message such as
> 
> FacesContext.getCurrentInstance().addMessage("myClientId", new
> FacesMessage("error"));
> 
> 
> The error message is not showing up.  I have tried all sorts of
> combinations of addMessage() and new FacesMessage() and attributes with
> <h:messages />, but nothing works.  Any advice?
> 


h:messages within f:subview not working

Posted by SO...@austin.rr.com.
I am using the following JSF code snippet:

<f:view>
   ...
   <f:subview>
      <h:messages />
      ...
   </f:subview>
   ...
</f:view>

and in the backing bean I am adding an error message such as

FacesContext.getCurrentInstance().addMessage("myClientId", new
FacesMessage("error"));


The error message is not showing up.  I have tried all sorts of
combinations of addMessage() and new FacesMessage() and attributes with
<h:messages />, but nothing works.  Any advice?

Re: Regarding sandbox's inputSuggestAjax tag

Posted by Werner Punz <we...@gmail.com>.
shaikyesdani.basha@wipro.com schrieb:
> In my bean method to manipulate the suggested list takes some time. So
> for each request the bean method is called then the performance of my
> application will be degraded. So is there any way to send the request to
> the server after 1 second from the user stops typing text?
> 
actually i do not think it has such a feature, because javascript itself
cannot easily determine whether a user has stopped typing
the best bet for you probably is, to set the value of characters when
the suggest should start to trigger to a higher value.
I do not know the input suggest good enough to know whether it has such
an attribute,
but the table suggest definitely has it
(in table suggest ist is the startRequest="numberofkeystrokes"  parameter)


RE: Re: Regarding sandbox's inputSuggestAjax tag

Posted by sh...@wipro.com.
In my bean method to manipulate the suggested list takes some time. So
for each request the bean method is called then the performance of my
application will be degraded. So is there any way to send the request to
the server after 1 second from the user stops typing text?

Regards,
Basha

-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of Werner Punz
Sent: Tuesday, March 06, 2007 6:30 PM
To: users@myfaces.apache.org
Subject: Re: Regarding sandbox's inputSuggestAjax tag

Is there a specific reason why you want to ignore those requests?
They do not do anything specifically.


shaikyesdani.basha@wipro.com schrieb:
> Hi,
> 
>             I am using sandbox's inputSuggestAjax tag. It is working
> fine in my application. But the problem is if you are typing text in
the
> <s:inputSuggestAjax> field for every character typing its calling the
> suggest method. At that time if I submit the form then it has to
ignore
> the previous requests. Is there any way to ignore the previous
requests.
> 
>  
> 
> My code look like as follows:
> 
>  
> 
>             <s:inputSuggestAjax id="customerId"
> suggestedItemsMethod="#{customerBean.getCustomerIdSuggestItems}"
> 
>                                    
>             value="#{customerBean.customerId}" maxSuggestedItems="5"/>
> 
>             <h:commandButton id="customerBeanCommandButtonNextId"
> action="#{customerBean.next}" value="Next"/>
> 
>  
> 
> Regards,
> 
> Basha
> 
> 
> The information contained in this electronic message and any
attachments
> to this message are intended for the exclusive use of the addressee(s)
> and may contain proprietary, confidential or privileged information.
If
> you are not the intended recipient, you should not disseminate,
> distribute or copy this e-mail. Please notify the sender immediately
and
> destroy all copies of this message and any attachments.
> 
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of
viruses.
> The company accepts no liability for any damage caused by any virus
> transmitted by this email.
> 
> www.wipro.com
> 



The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

Re: Regarding sandbox's inputSuggestAjax tag

Posted by Werner Punz <we...@gmail.com>.
Is there a specific reason why you want to ignore those requests?
They do not do anything specifically.


shaikyesdani.basha@wipro.com schrieb:
> Hi,
> 
>             I am using sandbox’s inputSuggestAjax tag. It is working
> fine in my application. But the problem is if you are typing text in the
> <s:inputSuggestAjax> field for every character typing its calling the
> suggest method. At that time if I submit the form then it has to ignore
> the previous requests. Is there any way to ignore the previous requests.
> 
>  
> 
> My code look like as follows:
> 
>  
> 
>             <s:inputSuggestAjax id="customerId"
> suggestedItemsMethod="#{customerBean.getCustomerIdSuggestItems}"
> 
>                                    
>             value="#{customerBean.customerId}" maxSuggestedItems="5"/>
> 
>             <h:commandButton id="customerBeanCommandButtonNextId"
> action="#{customerBean.next}" value="Next"/>
> 
>  
> 
> Regards,
> 
> Basha
> 
> 
> The information contained in this electronic message and any attachments
> to this message are intended for the exclusive use of the addressee(s)
> and may contain proprietary, confidential or privileged information. If
> you are not the intended recipient, you should not disseminate,
> distribute or copy this e-mail. Please notify the sender immediately and
> destroy all copies of this message and any attachments.
> 
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of viruses.
> The company accepts no liability for any damage caused by any virus
> transmitted by this email.
> 
> www.wipro.com
>