Good morning together,
after I tried for nearly an hour to get this problem solved, I would like to 
ask you all if anyone could help me. I got the following constellation: I have 
form having a selectOneMenu:

        <x:selectOneMenu id="selectSystem" immediate="true" 
onchange="this.form.submit( );"
       valueChangeListener="#{requestSpringBean.filter}">
                                <f:selectItems 
value="#{requestSpringBean.systemBean}" />
                </x:selectOneMenu>

If the value changes the event gets fired and it should change the following 
textboxes:

                <x:outputLabel value="#{bundle.requestBuidling}" for="building" 
/>
                <x:inputText value="#{requestSpringBean.system.sbuilding}" 
id="building" />
                <x:outputLabel value="#{bundle.requestFloor}" for="floor" />
                <x:inputText value="#{requestSpringBean.system.sfloor}" 
id="floor" />
                <x:outputLabel value="#{bundle.requestRoom}" for="room" /> 
                <x:inputText value="#{requestSpringBean.system.sroom}" 
id="room" />
                <x:outputLabel value="#{bundle.requestTable}" for="table" /> 
                <x:inputText value="#{requestSpringBean.system.stable}" 
id="table" />   

So, because they are referencing system in my requestSpringBean I thought, if I 
just null system and put new values into, that it should update the values in 
the frontend automatically.

               
        HtmlSelectOneMenu systemMenu = (HtmlSelectOneMenu) 
event.getComponent().findComponent("selectSystem");
                setSystem(null);
                
setSystem(getSystemManager().getSystem(systemMenu.getValue().toString()));

But trying it that way it didn't work, so I tried to reference the inputFields 
directly and update them "by hand" like this:

HtmlInputText building = (HtmlInputText) 
event.getComponent().findComponent("building");
                HtmlInputText floor = (HtmlInputText) 
event.getComponent().findComponent("floor");
                HtmlInputText room = (HtmlInputText) 
event.getComponent().findComponent("room");
                HtmlInputText table = (HtmlInputText) 
event.getComponent().findComponent("table");

system = getSystemManager().getSystem(systemMenu.getValue().toString());
                building.setValue(system.getSbuilding());
                floor.setValue(system.getSfloor());
                room.setValue(system.getSroom());
                table.setValue(system.getStable());

But that didn't work either. So what I want to ask is, am I doing something 
wrong in my concept? Or do I miss a tag or something like that?

I hope I provided enough information, to help you understand my problem.

Regards Johannes

PS: Thanks a lot for all comment, tipps, tricks and hints :-)
______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193

Reply via email to