UnManagedBean setter not called - jsf-1.2

I have run in to wierd issue where the setter of a property within my managedbean is not called.
I have 4 javabeans and out of which two are managed bean and two are POJO
ManagedbeanA has instance of ManagedbeanB which has a instance of PojoA object which is alist of pojoB rendered in a fragment included within my main jsp.
The list of PojoB objects are rendered as table and that table contains text boxes which can be edited by the user. The problem is that the when the user submits the form the setter of the property which hold the values of the textfield within the PojoB is never called.
i am referencing the list of pojoB objects as below within my JSF fragment included within my main JSP which has the submit button and the whole main page is sorrounded by the
<t:dataList id="tableEx1"
binding="#{managedbeanA.ManagedBeanB.pojoA.htmlDataTableforPojoB}"
value="#{managedbeanA.ManagedBeanB.pojoA.listofpojoB}"
var="PojoB">
<h:outputText id="sampletext" value="#{pojoB.sampleText}"/>
</t:datalist>
I am using trinidad components.

Related

How do I edit variables and update content of a view component using a button within the same component?

Summary: I have a view component with buttons which need to be able to change the details displayed in the rest of the component on click, but i can't figure out how to update the components content and data using an element within the component.
I am using asp.net razor pages to make a simple UI which displays various info grabbed from a JSON file, no database connection or POST functionality necessary.
I want the block of html that displays the data to be a reusable component, so i don't have to rewrite it every time i want to show a different entry in the file. From my research, there are a few options: HTML components, tag helpers, razor components, partial views, and view components. I chose to use a view component since the other options all seemed either outdated or not capable enough to achieve what i wanted. That is, with the exception of razor components, which require blazor to function fully which would also require me to learn a whole new framework and retrofit my program to work for it.
My view component functions to the point where i can invoke it from Index.cs and the component shows all the data from the first log in the list, as desired.
My intention: the default entryNo value is 0, so the component shows the title and date from the first log entry. When a user clicks the "Next" button (inside the component), entryNo becomes 1, and the component shows the title and date of the second entry in the log file.
ViewComponent.cshtml:
#model FullLog
#{ int entryIndLocal = 0; }
<div>
<div>#Model[entryNo].Title</div>
<div>#Model[entryNo].Date</div>
<button onclick={entryNo++}>Next</button>
</div>
What i've tried:
Setting the entryNo value in the view's .cs file and including a function to increment that value when called. I couldn't figure out how to call the function from the cshtml.
Initialising the entryNo variable from within the cshtml file, with the intention of the adding onclick={#entryNo++}. This didn't work either.

Creating a custom adaptive form component - that will submit and store data

Is it possible to create a new adaptive form component in HTL/sightly or extend an existing component?
Basically just trying to create a dropdown component (or any other component) that populates its values from a java model and will be saved to crx repo when the form is submitted.
All current adaptive form components are written in jsp and I've already tried extending the GuideField class them and manage to populate a dropdown dynamically but on page load it displays this in the console and the submit button won't work.
guideRuntime.js:26192 TypeError: Cannot read property 'priority' of undefined
at child.getAttribute (guideRuntime.js:26698)
at child._addProperty (guideRuntime.js:30187)
at child.<anonymous> (guideRuntime.js:30156)
at en.js:576

How to pass data to a ClassFactory-generated instance in Flex?

I have created an item-renderer (IListItemRenderer) to customize the display of a datagrid, and I override the data getter/setter to pass in the relevant variable. So far, so good.
In the item-renderer I have a button, which, when clicked, should display a form populated with various fields of the aforementioned variable. To do this, Button is overridden so that it displays whatever IFactory implementation it is passed.
private function instantiateDropdown():void
{
_dropdownFactory = new ClassFactory(MyPanel);
_dropdownFactory.properties = {boundData: _myVariable};
}
<buttons:PopUpButton id="editButton" dropdownFactory="{_dropdownFactory}" toolTip="Edit" source="{skins.ButtonImages.Edit}" click="edit_clickHandler(event)" />
My IFactory implementation is a panel containing my form, and it is displayed when the button is clicked, as desired. However, the variable is not set. It seems that in order to instantiate my IFactory before the overridden button needs to access it, my new ClassFactory() statement needs to be in the preinitialize event handler, but the variable has not been set at that time. Setting the properties of my IFactory instance after it has been created (e.g. in the click event) does not appear to work.
How should I pass my variable to my ClassFactory-generated instance so that it populates the form correctly?
Using lazy instantiation for the creation of the dropdownFactory (MyPanel in the question) in the class overriding Button (PopUpButton in the question), I was able to call instantiateDropdown in the creationComplete event instead of preinitialize, which allowed the PopUpButton to initialize with the correct properties (_myVariable in the question).

returnedObject property

I'm programming in Flex Builder Burrito for an mobile application.
I'm trying to get a variable from navigator.PopView()
and i found the following site: adobe View and ViewNavigator
On that page is written that you can get to an returnedObject:
The ViewNavigator will save this object internally, and the new view can access it from with the navigator.returnedObject property.
The problem is when I want to acces the returnedObject flash builder doesn't seem to find that even the package isn't found.
I've found my problem on an other site.
There it's plain simple explained.
Do the override public function createReturnObject():Object.
On the page where it needs to be send back.
Then on the popped view, you can acces it by returnedObject.
On same page next lines are
The property is a ViewReturnObject
which contains the object that was
returned
and the context in which the removed view was pushed (See Setting
the View Context).
ViewNavigator.poppedViewReturnedObject
is guaranteed to be set by the time
the new view
receives the add event and will be destroyed after the view receives its
viewActivate
event.
and also a NOTE
Note, the return object is only stored when a view is popped of
the navigation stack
or replaced through the use of the pop and replace navigation
operations (e.g.,
replaceView, popView, etc...). It will be cleared after the new view
receives its
ViewNavigatorEvent.VIEW_ACTIVATE event.
I think should try function to get popuped view poppedViewReturnedObject of ViewNavigator
Its description is also on same page
public function get poppedViewReturnedObject():ViewReturnObject
Hopes that help

Opening a new tab and adding an mxml component to it

Hi
In our flex application we have tabs at the main level and under it we have subview.
e.g
Home / Tasks / Admin etc...
In one condition we have to click on a button and open a new tab, on this tab we have to add an existing mxml component and show it in the tab.
We are using parsley as the framework.
Inside the mxml component test.mxml (that is shown in the tab) i am configuring it with parsley using the tag
Now when i add the instance of this test.mxml i am getting an exception
I am deriving this test.mxml instance using teh parsley context
as
context.getObject(id of component) as DisplayObject and adding it to the tabNavigator...
But i am getting exception when i try to grab an instance of a view using parsley context.
How do i get an instance of a view or component that is configure through parsley using the parslye context.
posting some code
in parsley context mxml file
in mediator class
public class TestMediator {
[Inject(id="testViewID")]
public var testView:TestView;
and then i add this view object to a container....
Also the problem is occuring becuase of the view injection..because i get a parsley excepiton on startup of the application stating that there is some problem in the context.
What exception are you getting? Without this information it's hard to help you out.
Anyways, here are some thoughts:
creating views through the container should not be a problem
note that MXML components can't take constructor arguments, so make sure you don't have any in your object definition
children of the tab navigator should be containers, not just display objects

Resources