<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Messages posted by "databass"]]></title>
		<link>http://jforum.icesoft.org/JForum/posts/listByUser/19423.page</link>
		<description><![CDATA[Messages posted by "databass"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Re:can't get ice:selectbooleancheckbox to copy one component value to another component value</title>
				<description><![CDATA[ Thanks for the response. 

I've put partialSubmit on all of the fields and 
I'm now able to read values in the valueChangeListener.

But it still won't update the component values.

I assume that I would put the setServiceAddress method before setting the phaseId.. something like this?


<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>public void handleCopyMailingAddress&#40;ValueChangeEvent event&#41; {
    if &#40;event.getPhaseId&#40;&#41; != PhaseId.INVOKE_APPLICATION&#41; {

            this.setServiceAddress&#40;"my service address value"&#41;;

            event.setPhaseId&#40;PhaseId.INVOKE_APPLICATION&#41;;
            event.queue&#40;&#41;;
     } else {
            // do some wor
     }
}</pre>
		</div>




<p></p>

		<cite>patrick.corless wrote:</cite><br>
		<blockquote>There's a couple things going on in your sample code.  First consider enabling partial submit on the checkbox and inputText fields.  This will insure that you bean values are updated on the blur event.

When the valueChangeListener is called without partial submit being enabled on the outputText field the JSF lifecycle will prevent you form getting the assumed value of the outputText field.  

The valueChangeListener is fired in the Process Validation phase which is before the components dump their values into the beans.  As a result any bean look ups will be out of date unless you access the component directly.  

If you want to valueChangeListener to fire in the invoke application phase you can do the following:
<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>public void handleCopyMailingAddress&#40;ValueChangeEvent event&#41; {
    if &#40;event.getPhaseId&#40;&#41; != PhaseId.INVOKE_APPLICATION&#41; {
            event.setPhaseId&#40;PhaseId.INVOKE_APPLICATION&#41;;
            event.queue&#40;&#41;;
     } else {
            // do some wor
     }
}</pre>
		</div>

&nbsp;
		</blockquote>]]></description>
				<guid isPermaLink="true">http://jforum.icesoft.org/JForum/posts/preList/11037/44824.page#44824</guid>
				<link>http://jforum.icesoft.org/JForum/posts/preList/11037/44824.page#44824</link>
				<pubDate><![CDATA[Tue, 6 Jan 2009 17:41:19]]> GMT</pubDate>
				<author><![CDATA[ databass]]></author>
			</item>
			<item>
				<title>can't get ice:selectbooleancheckbox to copy one component value to another component value</title>
				<description><![CDATA[ I'm trying to make a checkbox that when clicked, should copy the mailing address string from the service address string.

I was hoping I could simply set the value of the mailing address to the service address in the checkbox's valueChangeListener.

But when the checkbox is checked, the mailing address doesn't get updated.

Also, I noticed that I can't get the value of the service address the first time the checkbox is checked, but it does give me the value on subsequent checkbox clicks.

These are the relevant parts of my xhtml and bean

form.xhtml

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>
&lt;ice:form id="myForm"&gt;
&lt;ice:selectBooleanCheckbox id="copyMailingAddressFromOwner" required="false"
valueChangeListener="#{newService.handleCopyMailingAddress}"
value="#{newService.copyMailingAddressFromServiceAddress}" autocomplete="off" /&gt;
mailing address: &lt;ice:inputText id="mailingAddress" value="#{newService.mailingAddress}"/&gt;


service address: &lt;ice:inputText id="serviceAddress" value="#{newService.serviceAddress}"/&gt;
&lt;/ice:form&gt;
</pre>
		</div>

bean newServiceAction.java:
<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>
@Stateful
@Name&#40;"newService"&#41;
@Scope&#40;CONVERSATION&#41;
public class NewServiceAction implements NewService {

  public String getMailingAddress&#40;&#41; {

    return mailingAddress;
  }

  public void setMailingAddress&#40;String mailingAddress&#41; {
    this.mailingAddress=mailingAddress;
  }

  public String getServiceAddress&#40;&#41; {
    return serviceAddress;
  }

  public void setServiceAddress&#40;String serviceAddress&#41; {
    this.serviceAddress =serviceAddress;
  }

  public void handleCopyMailingAddress&#40;ValueChangeEvent e&#41; {
   if &#40;!this.copyMailingAddressFromOwner&#41;
	{
                this.setServiceAddress&#40;this.getMailingAddress&#40;&#41;&#41;;

	}
	else
	{
		this.setServiceAddress&#40;""&#41;;
	}	
}
</pre>
		</div>

FYI, I'm using Icefaces 1.7.0 with Seam 2.0.1.GA
Also note that I have gotten this to work using what seems to be like a hack, when I put this code in the valueChangeListener for the checkbox:

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>
    UIViewRoot viewRoot=javax.faces.context.FacesContext.getCurrentInstance&#40;&#41;.getViewRoot&#40;&#41;;
    
    UIInput input = &#40;UIInput&#41; viewRoot.findComponent&#40;"myForm:serviceAddress"&#41;;
   input.setValue&#40;newService.mailingAddress&#41;;
</pre>
		</div>

But obviously I'd like to avoid this since it requires using client-ids.

Any help would be greatly appreciated.

Thanks,
dave]]></description>
				<guid isPermaLink="true">http://jforum.icesoft.org/JForum/posts/preList/11037/44683.page#44683</guid>
				<link>http://jforum.icesoft.org/JForum/posts/preList/11037/44683.page#44683</link>
				<pubDate><![CDATA[Fri, 2 Jan 2009 18:00:36]]> GMT</pubDate>
				<author><![CDATA[ databass]]></author>
			</item>
			<item>
				<title>Re:1.7 &amp;lt;ice:effect/&amp;gt;</title>
				<description><![CDATA[ Thanks, that did it.]]></description>
				<guid isPermaLink="true">http://jforum.icesoft.org/JForum/posts/preList/8161/34283.page#34283</guid>
				<link>http://jforum.icesoft.org/JForum/posts/preList/8161/34283.page#34283</link>
				<pubDate><![CDATA[Mon, 5 May 2008 21:11:15]]> GMT</pubDate>
				<author><![CDATA[ databass]]></author>
			</item>
			<item>
				<title>1.7 &amp;lt;ice:effect/&amp;gt;</title>
				<description><![CDATA[ I'm trying to use the new <ice:effect/> component, specifically the appear and face effects.

Can this be done without having to use any beans?

Here's a simple example of what I'm trying to do:

<font color='green'>&lt;ice:outputText value="Make this text fade" &gt;
&lt;ice:effect effectType="face"/&gt;
&lt;/ice:outputText&gt;

&lt;ice:outputText value="Make this text appear" &gt;
&lt;ice:effect effectType="appear"/&gt;
&lt;/ice:outputText&gt;</font>

Nothing happens. Am I missing something? 
It would be helpful if someone could post a 'Hello World' example. 
The 1.7 Component Showcase has some examples source code, but that doesn't appear to be using the <ice:effect> components.

Thank you,
dave  

]]></description>
				<guid isPermaLink="true">http://jforum.icesoft.org/JForum/posts/preList/8161/34222.page#34222</guid>
				<link>http://jforum.icesoft.org/JForum/posts/preList/8161/34222.page#34222</link>
				<pubDate><![CDATA[Fri, 2 May 2008 17:40:21]]> GMT</pubDate>
				<author><![CDATA[ databass]]></author>
			</item>
	</channel>
</rss>
