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

View: New views
3 Messages — Rating Filter:   Alert me  

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

by Huber, Stephan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

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

by Ken Paulsen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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@... For additional commands, e-mail: users-help@...

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

by Huber, Stephan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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:filterPanel:dayCalendar').setProps({disabled: true});

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

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

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

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

document.getElementById('form:yieldAnalysisContentPage:yieldTable:filterPanel: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:filterPanel: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@... [mailto:Ken.Paulsen@...]
Sent: Monday, March 16, 2009 6:08 PM
To: users@...
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@... For additional commands, e-mail: users-help@...