users@woodstock.java.net

RE: Re: Filter panel in table component - setter not called for text field...

From: Huber, Stephan <Stephan.Huber_at_gigatronik.com>
Date: Mon, 16 Mar 2009 22:58:36 +0100

Thanks Ken!
 
You're right - removing the disabled property shows that the value of
the text field is submitted correctly.
 
In my filter panel I've several dropdowns (<webuijsf:dropdown/>), each
with a radio button to the left side - the radio button which is
selected by the user makes the corresponding field (dropdown or text
field) to set disabled=false. I'm wondering because with the dropdowns
all works well except for the text field - everything is done on
client-side using javascript:
 
<code>
function toggleElement(id) {

var domNode = document.getElementById(id);

// disable all elements

document.getElementById('form:yieldAnalysisContentPage:yieldTable:filter
Panel:dayCalendar').setProps({disabled: true});

document.getElementById('form:yieldAnalysisContentPage:yieldTable:filter
Panel:weekMenu').setProps({disabled: true});

document.getElementById('form:yieldAnalysisContentPage:yieldTable:filter
Panel:monthMenu').setProps({disabled: true});

document.getElementById('form:yieldAnalysisContentPage:yieldTable:filter
Panel:quarterMenu').setProps({disabled: true});

document.getElementById('form:yieldAnalysisContentPage:yieldTable:filter
Panel:yearMenu').setProps({disabled: true});

document.getElementById('form:yieldAnalysisContentPage:yieldTable:filter
Panel:lotNoTextField').setProps({disabled: true});

// enable the current element

domNode.setProps({disabled: false});

}

---
<td>
<webuijsf:radioButton id="yearRb" name="periodRbGroup"
label="#{bundle.yieldAnalysis_table_filter_period_rb_year}"
onClick="toggleElement('form:yieldAnalysisContentPage:yieldTable:filterP
anel:yearMenu')"
selected="#{YieldAnalysisBean.periodYearSelectedOption}"/>
</td>
<td><div style="width: 5px;"/></td>
<td>
<webuijsf:dropDown id="yearMenu" immediate="true"
disabled="#{!YieldAnalysisBean.periodYearSelectedOption}"
selected="#{YieldAnalysisBean.yearMenuSelectedOption}"
items="#{YieldAnalysisBean.yearMenuOptions}" width="100%"/>
</td>
</code>
Thanks and best regards,
- Stephan
________________________________
From: Ken.Paulsen_at_Sun.COM [mailto:Ken.Paulsen_at_Sun.COM] 
Sent: Monday, March 16, 2009 6:08 PM
To: users_at_woodstock.dev.java.net
Subject: Re: Filter panel in table component - setter not called for
text field...
Hi Stephan,
I am just making a guess here, but perhaps the disabled property is
interfering?  Was the field originally disabled when the content was
rendered and then changed to "enabled" via JS?  If the server-side
thinks the component was diabled when the data is submitted, it won't
look for a value from the browser.
Good luck!
Ken
Huber, Stephan wrote: 
	Hi,
	 
	I've discovered some strange behavior regarding the filter panel
in the woodstock table component (<webuijsf:table/>). The filter panel
contains several components like dropdowns, checkboxes and a text field
(<webuijsf:textfield/>). The strange thing now is that when I enter a
value in the text field and click ok to submit the filter panel, the
value is not submitted correctly - the property for the text field is
still null. But when I open the filter for the second time and enter a
value in the text field, the corresponding property is filled correctly
with the given value.
	 
	<code>
	<td><div style="width: 5px;"/></td>
	<td>
	<webuijsf:textField id="lotNoTextField" columns="25"
text="#{YieldAnalysisBean.lotNoTextField}"
	disabled="#{!YieldAnalysisBean.periodLotNoSelectedOption}"/>
	</td>
	</code>
	 
	The corresponding setter is not called for the first time - any
ideas?
	 
	<code>
	/**
	* @param lotNoTextField
	* the lotNoTextField to set
	*/
	public final void setLotNoTextField(final String lotNoTextField)
{
	this.lotNoTextField = lotNoTextField;
	}
	</code>
	 
	The other components in the filter panel do work well (even on
first submit).
	 
	Any help would be greatly appreciated.
	 
	Best regards
	 
	- Stephan
--------------------------------------------------------------------- To
unsubscribe, e-mail: users-unsubscribe_at_woodstock.dev.java.net For
additional commands, e-mail: users-help_at_woodstock.dev.java.net