Non Collapsible TreePanel in GXT - gxt

I am new to GXT and need a little help in implementing a tree panel.
User has a requirement that the TreePanel should not allowed to be collapsed and it should always remain expanded. (as in the image)
Is there a way we can achieve this ? May be using some other widget ?

For example, you can use on your tree addCollapseHandler() which will always call tree.setExpanded(true);

Related

Change order pagination options dojo

I make a table with dojo script, but it should see the diferent order of pagination options as that: 1. the page navigation choices, 2. page length menu and, 3. current position display.
I need help with that, how can I change that?
http://dojotoolkit.org/reference-guide/1.10/_images/pagination_ui_overview.bmp
In order to customize/modify an existing dojo widget you will need to manipulate the dom.
In this specific case you should use selectors like dojo/dom and dojo/query to select the portions of the grid you wish to move and then use dojo/dom-construct to place them in the correct location.
domConstruct.place(pageNavigation, positionDisplay, "replace");
Here is a jsfiddle which demonstrates a portion of what you are trying to accomplish and is a good starting point http://jsfiddle.net/kagant15/u6edz0b9/

how to know the height of a control? I get NaN

I have an application that use the MVVM pattern. In the main view model, I create a view and its viewmodel of another control.
I need to know the height of the control, but when I create the control, if I see the Height value of the control I get NaN.
I use this code in my main view model:
miSecondControl = new mySecondControl(param1, param2);
double myHeight = miSecondControl.height;
This secondary control does not use the MVVM patter but it has code behind, because I only want to use it to print a fixed document, so I think that in this case MVVM would make more complex the solution.
I need the heigh property of the control to know if I need to create a new page because I don't have space in the actual page.
Thanks.
Height/Width are values that are specified at design/layout time.
Use FrameworkElement.ActualHeight and FrameworkElement.ActualWidth to get the rendered Height/Width of a control.

Reusable edit form in Apache Wicket

I have a simple ContactEditPanel which contains a form and a number of textfields. Up until now I included an AjaxSubmitLink in this panel which, if the form content is valid, saves/updates the Contact instance contained in the Panel model. So far so simple. However now I'd like to remove the link in order that I may, depending on the context in which I use the ContactEditPanel, place the submit link at different levels of my overall component hierarchy. For instance in one context I'd like to use to flip between ContactEditPanel and ContactViewPanel with a bar of actions above the current view (edit | save , cancel). Another context would be to use ContactEditPanel in a standalone way (maybe part of a multi-step process) with just a save link below.
I was contemplating refactoring my ContactEditPanel to extends FormComponentPanel rather than Panel as described here but I'm not sure whether this is the right approach and I'm having trouble wrapping my head around this.
Any help would be most appreciated!
Many Thanks,
A
Your using the panel like a FormComponent so extend FormComponentPanel, it will allow you to keep all the validation you write contained to the component and also allow you to reuse it as you wish.
Just think of it as you've created a new FormComponent, like a TextField or DropDownChoice.

Is it possible to determine the facet content in a custom controls design definition?

I'm putting together the design definition for a custom control and would like to vary how it displays based on whether or not a different custom control has been placed in the one of the facet areas. Is this possibe with the design definition and if so, how?
I know I can reference properties of the custom control by using "this", but I couldn't guess as to how to get to the facet content information.
Any ideas? Thanks
In the design definition you can add a callback node where your facet should appear. This should expose the Editable Area when you add your control to another page.
The format for the callback node would look similar to
<xp:callback id="callbackID" facetName="facetname" />
Dan,
Can you get the Editable Area as a javax.faces.component.UIComponent and then do .getFacets()?
BTW, hope you're well!

jsf popupwindow with a datatable

I have a form which one of it's fields is a code and description, also a button for opening a popup window that contains a list of all of the available codes.
when the user double clickes a row from that table i want to set these values to the code and description. - how can this be done?
Another question, I want to create this popup and table to be initialized dynamically - by that i mean that if i have a few forms in my application, when ever i have a field which has a description i want to be able to open this popup and to see the available list for that field. (every field can be from a diffrent table). is it possible to create something like that? if so, how?
Any help will be appritiated,
Thank's In Advance.
Yes, it is possible. Even more, many component libraries have ready to use popup/dialog components, such as RichFaces with <rich:popupPanel> and PrimeFaces with <p:dialog>.
If you do not want to use a component library for some reason, you would need to create a custom component for this which generates basically an absolutely positioned HTML <div> element with a CSS overlay which get shown/hidden by JS on a particular click/action. The HTML/CSS/JS part should be relatively simple if you are familiar with those languages. The JSF part is somewhat hard if you have never created a custom component before, but it should be possible with a composite component as well, so you could also just create one with pure XHTML. The updating/refreshing can just take place by the usual <f:ajax> means.

Resources