List/Enumeration of Elements in a View (WD for Java)
Hello,
How do I get a complete list of all elements in a view at runtime?
I want to dynamically modify 30+ elements, but I don't want to have to code each of them. Is there a way to do this?
Thanks,
Martin
Martin,
Try something like this:
static interface IAction
abstract public void execute(IWDUIElement el);
static class CollectElements implements IAction
final private Map _result = new TreeMap();
public Map result() { return Collections.unmodifiableMap(_result); }
public void execute(final IWDUIElement el)
_result.put( el.getId(), el );
void traverse(final IWDView view, final IAction action)
traverse( (IWDUIElementContainer)view.getRootElement(), action );
void traverse(final IWDUIElementContainer container, final IAction action)
action.execute(container);
for (final Iterator i = container.iterateChildren(); i.hasNext(); )
final IWDUIElement el = (IWDUIElement)i.next();
if ( el instanceof IWDUIElementContainer )
traverse( (IWDUIElementContainer)el, action );
else
action.execute( el );
Sample:
final CollectElements selectAll = new CollectElements();
traverse(wdView, selectAll);
/* Now selectAll.result() contains id->element mapping */
This will not collect Table columns, or Tabs in TabStrib, however you can create "dispatching" IAction implementation, that delegates to some custom methods like traverse(IWDTable) or traverse(IWDTabStrip)
Valery Silaev
EPAM Systems
http://www.NetWeaverTeam.com
Similar Messages
-
List Definition missing ribbon tab in View
Hello,
I am having a bit of a conundrum with my list definition and am looking for some help.
I created a list definition in visual studio SharePoint project and gave it six views. Going through the Schema, I noticed a lot or extraneous attributes and elements added to the views in a very disorganized manner. After realigning all
the elements and attributes and removing unnecessary data, all the views of my list are finally working as expected. Except for one. It turns out that one of the six similar views does not show Files/Items Ribbon Tab, and I can't understand
why it does this.
So if anybody who has worked with List Definitions knows anything about this, I would be grateful.Hi,
If this is the only one view comes with the issue, it is suggested that you can create a simple demo list view with only some basic configuration, if it works, then we can add
the additional customization and do the test again.
It will be easier to find out the root cause of the issue by following the steps above.
Best regards
Patrick Liang
TechNet Community Support -
Dear All,
I am enhancing a standard web dynpro component HAP_DOCUMENT_BODY, view VW_TABS_VIEW where I would have to add an Image on the first tab of the tab strip.
So i have Imported a MIME object inside the standard application and have bouned it to a an IMage container. Now the fixed image is appearing in all tabs of the tab strip. Hence i want to hide the image in different tabs strip through code.
Also my requirement is to display different image for different login languages too.
Basically i have two questions here.
i) I would want to know how to hide Image object or the transparent container which holds the IMAGE object, dynamically through the code inside the MODIFYVIEW method of the view
ii) Is there an option to dynamically specify diffent image based on the login language with the IMage container?
require you kind help.
Thanks,
SridharanHi ,
This is a Webdynpro related question. you would have got many repsonses if you posted in webdynpro forum.
i) I would want to know how to hide Image object or the transparent container which holds the IMAGE object, dynamically through the code inside the MODIFYVIEW method of the view
You can do a post_exit enhancement in the MODIFYVIEW method. Get the UI element object from view and There are methods to set the visibility at runtime.
Is there an option to dynamically specify diffent image based on the login language with the IMage container?
i think yes, same procedure as first question's answer. Based on condition you can change the source path of the mime object . -
Build XML for Custom Nested Accordian (like Tree View Structure) for SharePoint List Data
Expected output in Xml:
<?xml version="1.0" encoding="utf-8" ?>
- <TopRoot>
- <Root id="1" Name="Department">
- <Type id="2" Name="IT">
- <SubType id="3" Name="Technology">
<SubSubType id="4" Name="Sharepoint" />
<SubSubType id="5" Name="ASP.NET" />
<SubSubType id="6" Name="HTML 5" />
</SubType>
</Type>
</Root>
</TopRoot>
List Details:
list details for storing category / sub category data and code to build tree structure for the same.
1.Create Custom List named “CategoryDetails”:
2.Create Column “Category Name” of type single line of text. Make it as required field and check Yes for Enforce Unique values.
3.Create column “Parent Category” of type lookup. under Additional Column Settings.
Get information dropdown, select “CategoryDetails”.
4.Choice column ["SRTypeName"] 1.Root,2.SRTYPE,3.SubSRTYPE, 4.SUBSUBSRTYPE
In this column dropdown, select “Category Name”:
Referance:
http://www.codeproject.com/Tips/627580/Build-Tree-View-Structure-for-SharePoint-List-Data -fine but don't want tree view just generate xml string
i just follwed above link it work perferfectly fine for building tree view but i don't want server control.
Expected Result:
My ultimate goal is to generate xml string like above format without building tree view.
I want to generate xml using web service and using xml i could convert into nested Tree View Accordian in html.
I developed some code but its not working to generate xml /string.
My modified Code:
public const string DYNAMIC_CAML_QUERY =
"<Where><IsNull><FieldRef Name='{0}' /></IsNull></Where>";
public const string DYNAMIC_CAML_QUERY_GET_CHILD_NODE =
"<Where><Eq><FieldRef Name='{0}' /><Value Type='LookupMulti'>{1}</Value></Eq></Where>";
protected void Page_Load(object sender, EventArgs e)
if (!Page.IsPostBack)
string TreeViewStr= BuildTree();
Literal1.Text = TreeViewStr;
StringBuilder sbRoot= new StringBuilder();
protected string BuildTree()
SPList TasksList;
SPQuery objSPQuery;
StringBuilder Query = new StringBuilder();
SPListItemCollection objItems;
string DisplayColumn = string.Empty;
string Title = string.Empty;
string[] valueArray = null;
try
using (SPSite site = new SPSite(SPContext.Current.Web.Url))
using (SPWeb web = site.OpenWeb())
TasksList = SPContext.Current.Web.Lists["Service"];
if (TasksList != null)
objSPQuery = new SPQuery();
Query.Append(String.Format(DYNAMIC_CAML_QUERY, "Parent_x0020_Service_x0020_Id"));
objSPQuery.Query = Query.ToString();
objItems = TasksList.GetItems(objSPQuery);
if (objItems != null && objItems.Count > 0)
foreach (SPListItem objItem in objItems)
DisplayColumn = Convert.ToString(objItem["Title"]);
Title = Convert.ToString(objItem["Title"]);
int rootId=objItem["ID"].ToString();
sbRoot.Append("<Root id="+rootId+"
Name="+Title+">");
string SRAndSUBSRTpe = CreateTree(Title, valueArray,
null, DisplayColumn, objItem["ID"].ToString());
sbRoot.Append(SRAndSUBSRTpe);
SRType.Clear();//make SRType Empty
strhtml.Clear();
SRType.Append("</Root>");
catch (Exception ex)
throw ex;
return SRType.ToString();
StringBuilder strhtml = new StringBuilder();
private string CreateTree(string RootNode, string[] valueArray,
List<SPListItem> objNodeCollection, string DisplayValue, string KeyValue)
try
strhtml.Appends(GetSRType(KeyValue, valueArray, objNodeCollection);
catch (Exception ex)
throw ex;
return strhtml;
StringBuilder SRType = new StringBuilder();
private string GetSRType(string RootNode,
string[] valueArray, List<SPListItem> objListItemColn)
SPQuery objSPQuery;
SPListItemCollection objItems = null;
List<SPListItem> objNodeListItems = new List<SPListItem>();
objSPQuery = new SPQuery();
string objNodeTitle = string.Empty;
string objLookupColumn = string.Empty;
StringBuilder Query = new StringBuilder();
SPList objTaskList;
SPField spField;
string objKeyColumn;
string SrTypeCategory;
try
objTaskList = SPContext.Current.Web.Lists["Service"];
objLookupColumn = "Parent_x0020_Service_x0020_Id";//objTreeViewControlField.ParentLookup;
Query.Append(String.Format
(DYNAMIC_CAML_QUERY_GET_CHILD_NODE, objLookupColumn, RootNode));
objSPQuery.Query = Query.ToString();
objItems = objTaskList.GetItems(objSPQuery);
foreach (SPListItem objItem in objItems)
objNodeListItems.Add(objItem);
if (objNodeListItems != null && objNodeListItems.Count > 0)
foreach (SPListItem objItem in objNodeListItems)
RootNode = Convert.ToString(objItem["Title"]);
objKeyColumn = Convert.ToString(objItem["ID"]);
objNodeTitle = Convert.ToString(objItem["Title"]);
SrTypeCategory= Convert.ToString(objItem["SRTypeName"]);
if(SrTypeCategory =="SRtYpe")
SRType.Append("<Type id="+objKeyColumn+" Name="+RootNode+ ">");
if (!String.IsNullOrEmpty(objNodeTitle))
SRType.Append(GetSRType(objKeyColumn, valueArray, objListItemColn));
if(SrTypeCategory =="SRSubTYpe")
SRType.Append("<SRSubType id="+objKeyColumn+" Name="+RootNode+
">");
if (!String.IsNullOrEmpty(objNodeTitle))
SRType.Append(GetSRType(objKeyColumn, valueArray, objListItemColn));
if(SrTypeCategory =="SubSubTYpe")
SRType.Append("<SubSubType id="+objKeyColumn+" Name="+RootNode +"
></SubSubType");
SRType.Append("</SubType>");
SRType.Append("</Type>");
catch (Exception ex)
throw ex;
return SRType.ToString();
// Call method again (recursion) to get the child itemsHi,
According to your post, my understanding is that you want to custom action for context menu in "Site Content and Structure" in SharePoint 2010.
In "SiteManager.aspx", SharePoint use MenuItemTemplate class which represent a control that creates an item in a drop-down menu.
For example, to create or delete the ECB menu for a list item in
"Site Content and Structure", we can follow the steps below:
To add the “My Like” menu, we can add the code below:
<SharePoint:MenuItemTemplate
UseShortId=false
id="OLListItemLike"
runat="server"
Text="My Like"
ImageUrl="/_layouts/images/DelItem.gif"
ClientOnClickNavigateUrl="https://www.google.com.hk/"
/>
To remove the “Delete” menu, we can comment the code below:
<SharePoint:MenuItemTemplate
UseShortId=false
id="OLListItemDelete"
runat="server"
Text="<%$Resources:cms,SmtDelete%>"
ImageUrl="/_layouts/images/DelItem.gif"
ClientOnClickScript="%SmtObjectDeleteScript%"
/>
The result is as below:
More information:
MenuItemTemplate Class (Microsoft.SharePoint.WebControls)
MenuItemTemplate.ClientOnClickScript property (Microsoft.SharePoint.WebControls)
Best Regards,
Linda Li
Linda Li
TechNet Community Support -
How can i hide elements of a view?
Hi,, i've got a question about, how can i hide an element of a view?, this element colud be a group, a label, an input field, any element that i can put in the view layout.
My view has an ALV, an inputfield and a Table with a button, so when i click on a line of the alv, it shows data in the table and in the inputfield, and when i click on the button of the table, i want to hide the table and the inputfield, until i clik on the alv again to make appear the table and the inputfield.
how can i hide those element?,,,,,,,,thanksHi Luis Garcia,
It can be done easily by <b>context binding</b> the visibility property of the table and input field UI element to a node attribute whose type would be WDY_BOOLEAN.
1. Initially the node attributes default value would be 'X'.
2. When you click the button in the ALV, in the event handler of that button change the binded node attribute value to ' '.
3. When on lead selection of the table again change the binded node attribute field value to 'X'.
4. Below is the sample code to read the binded node attribute and toggle the visiblity attribute to 'X' if it is ' ' and vice versa.
data:
Node_If type ref to If_Wd_Context_Node,
Elem_If type ref to If_Wd_Context_Element,
Stru_If type If_Main=>Element_If ,
Item_VISIBILITY like Stru_If-VISIBILITY.
* navigate from <CONTEXT> to <IF> via lead selection
Node_If = wd_Context->get_Child_Node( Name = IF_MAIN=>wdctx_If ).
* get element via lead selection
Elem_If = Node_If->get_Element( ).
* get single attribute
Elem_If->get_Attribute(
exporting
Name = `VISIBILITY`
importing
Value = Item_Visibility ).
if Item_visibility is initial.
item_visibility = 'X'.
else.
item_visibility = ' '.
endif.
Elem_If->set_Attribute(
Name = `VISIBILITY`
Value = Item_Visibility ).
endmethod.
Hope it helps.
Regards,
Maheswaran.B -
Dreamweaver CC automatically deletes code in code view and elements in design view
When I open a file in Dreamweaver, it automatically shows a * next to the filename - showing it has been edited.
Then often when I select some code in code view, or an element in design view (such as a table, an image, some text) it is suddenly deleted.
The problem is especially bad (happens without fail) if I am switching between programs. But also happens when I'm not switching.
I do not have this problem on a different user account.
I have reinstalled Dreamweaver three times now. Also renamed preference and configuration folders. Tried with a wired mouse and keyboard. Nothing has worked.
I can't think what I did to cause this. I installed MAMP recently - but have uninstalled it correctly I think.
I had an issue with one file in which there were about 30 Spry collapsible panels. I kept getting this warning:
"A script in file Macintosh HD:Applications:Adobe Dreamweaver CC:Configuration:Shared:Spry:DesignTime:EditingUtils.js has been running for a long time. Do you want to continue?"
I have to click 'yes' many times to get into the file, and the warning keeps coming up while the file is open.
However, my big issue of DW CC deleting code and elements happens whether or not this particular file is open.
So this may have nothing to do with it.
Any ideas anyone?
Adobe's customer service has not helped. In fact, I have not even been able to get through to anyone on the phone - having waited literally hours listening to music, and getting shunted from person to person. And then their promised 'call backs' never happen.
Thanks,
- GregI do not have this problem on a different user account.
You've got a bad/corrupted user account. Create a new one with Admin level priveleges and delete your old user.
Nancy O. -
Dynamic tree UI element in the view
Dear All,
Can anyone provide me with the code snippet for Dynamic Tree UI element in the view. I need to show the tree which should be generated dynamically.
Thanks alot in advance!
Points will be rewarded, Please its urgent!
Cheers,
Darshna.Hi ,
sorry for the late reply... here is the code for onActionLoadchildren .. i am sure you wont understand this.. but lets try...
DATA:
element_parent TYPE REF TO if_wd_context_element,
lv_object_key1 type string,
lv_object_type type string.
DATA:
node_root_entry TYPE REF TO if_wd_context_node,
elem_root_entry TYPE REF TO if_wd_context_element,
stru_root_entry TYPE if_structure_view_new=>element_root_entry ,
item_valid_from LIKE stru_root_entry-valid_from,
item_plant LIKE stru_root_entry-plant,
item_equi_key LIKE stru_root_entry-equi_key,
item_object_key LIKE stru_root_entry-object_key,
item_object_type TYPE string,
item_path TYPE string,
item_parent_path TYPE string,
context_node TYPE REF TO if_wd_context_node,
root_entry TYPE if_structure_view_new=>element_selected_entry.
l_ref_componentcontroller TYPE REF TO ig_componentcontroller.
DATA:
node_root_info TYPE REF TO if_wd_context_node,
elem_root_info TYPE REF TO if_wd_context_element,
stru_root_info TYPE if_structure_view_new=>element_root_info .
DATA:
element TYPE REF TO if_wd_context_element,
node_selected_entry TYPE REF TO if_wd_context_node,
elem_selected_entry TYPE REF TO if_wd_context_element.
DATA:
ls_hier_return TYPE rplm_ts_struc_elements,
lt_hier_return TYPE TABLE OF rplm_ts_struc_elements,
ls_hier_return_temp TYPE rplm_ts_struc_elements,
lt_hier_return_temp TYPE TABLE OF rplm_ts_struc_elements,
ls_hier_level TYPE rplm_ts_hier_level,
lt_hier_level TYPE TABLE OF rplm_ts_hier_level,
ls_hier_return_sort TYPE rplm_mt_ts_hier,
lt_hier_return_sort TYPE TABLE OF rplm_mt_ts_hier.
DATA:
temp_hier_level TYPE if_structure_view_new=>element_hier_level,
lt_hier_temp TYPE TABLE OF if_structure_view_new=>element_hier_level,
lt_temp TYPE TABLE OF if_structure_view_new=>element_hier_level.
DATA:
lc_path TYPE string,
lv_object_key TYPE string.
DATA:
lv_hier_lines TYPE i.
DATA:
node_entries TYPE REF TO if_wd_context_node,
node_sub_entries TYPE REF TO if_wd_context_node,
elem_sub_entries TYPE REF TO if_wd_context_element,
stru_sub_entries TYPE if_structure_view_new=>element_sub_entries .
TYPES: BEGIN OF ls_hier_type, "structure for Hierarchy table
object(31) TYPE c, "Objectkey
predecessor(31) TYPE c, "Objectkey Predecessor
data(2000) TYPE c, "Data container
level TYPE i, "level of object in tree
successors(1) TYPE c, "Object has successors: YES/NO/U
display(1) TYPE c, "Object is displayed: YES/NO
selected(1) TYPE c, "Object is selected/marked: YES/NO
index_predec LIKE sy-tabix, "Index predecessor
strno TYPE ilom_strno,"External number for func. loc.
"in BOMs used for top object
END OF ls_hier_type.
DATA:
ls_hier TYPE ls_hier_type,
lt_hier TYPE TABLE OF ls_hier_type WITH DEFAULT KEY,
lt_mat_hier TYPE TABLE OF ls_hier_type WITH DEFAULT KEY.
" For retrieving Material Data Heirarchy
DATA:
lh_stpo_tab TYPE TABLE OF rihstpx ,
lwa_stpo_tab LIKE LINE OF lh_stpo_tab,
check_menge TYPE string ,
check_meins TYPE string ,
lwa_mat_hier LIKE LINE OF lt_mat_hier ,
lt_dup_mat_hier LIKE lt_mat_hier,
lv_len TYPE i,
lv_len_temp TYPE i .
DATA:
lv_equnr TYPE equi-equnr,
lv_tplnr TYPE iflo-tplnr,
lv_matnr TYPE mast-matnr.
DATA:
lv_cnt TYPE i,
lv_index TYPE i.
DATA:
lv_path TYPE string,
lv_parent_path TYPE string,
pos TYPE string,
separator TYPE c VALUE '.',
max_level TYPE i,
temp_level TYPE i,
counter TYPE i VALUE 1.
TYPES: BEGIN OF ls_pred_type, "structure for Hierarchy table
parent(31) TYPE c, "Objectkey Predecessor
path(2000) TYPE c, "Data container
index_predec LIKE sy-tabix, "Index predecessor
END OF ls_pred_type.
DATA:
ls_pred TYPE ls_pred_type,
lt_pred TYPE TABLE OF ls_pred_type WITH DEFAULT KEY.
DATA:
lv_int_obj_key TYPE string,
obj_len TYPE i,
lv_funcloc_ext TYPE ilom_strno,
lv_funcloc TYPE itob-tplnr.
DATA:
lv_level TYPE i,
lv_temp TYPE i,
lt_path_entries TYPE string_table.
DATA:
node_general TYPE REF TO if_wd_context_node,
elem_general TYPE REF TO if_wd_context_element,
stru_general TYPE if_structure_view_new=>element_general ,
item_collapse_visibility LIKE stru_general-collapse_visibility.
DATA:
elem_context TYPE REF TO if_wd_context_element,
stru_context TYPE if_structure_view_new=>element_context ,
item_expand_all LIKE stru_context-expand_all.
lv_path = path.
Get Element whose children shall be loaded
element_parent = wd_context->path_get_element( lv_path ).
element_parent->get_attribute(
EXPORTING
name = `OBJECT_KEY`
IMPORTING
value = LV_object_key ).
element_parent->get_attribute(
EXPORTING
name = `OBJECT_TYPE`
IMPORTING
value = lv_object_type ).
node_root_entry = wd_context->get_child_node( name = wd_this->wdctx_root_entry ).
get element via lead selection
elem_root_entry = node_root_entry->get_element( ).
get single attribute
elem_root_entry->get_attribute(
EXPORTING
name = `VALID_FROM`
IMPORTING
value = item_valid_from ).
elem_root_entry->get_attribute(
EXPORTING
name = `PLANT`
IMPORTING
value = item_plant ).
item_object_type = lv_object_type.
if lv_object_type eq 'EQUI'.
item_object_key = ''.
item_equi_key = lv_object_key.
elseif lv_object_type eq 'FUNCLOC'.
item_object_key = lv_object_key.
item_equi_key = ''.
ELSE.
lv_matnr = lv_object_key.
For BOM, material and Assembly
endif.
IF item_object_type EQ 'EQUI'.
lv_equnr = lv_object_key.
ELSEif item_object_type eq 'FUNCLOC'.
lv_tplnr = lv_object_key.
ELSE.
LV_MATNR = lv_object_key.
exit.
ENDIF.
CALL FUNCTION 'PM_HIERARCHY_CALL'
EXPORTING
datum = item_valid_from
equnr = lv_equnr
tplnr = lv_tplnr
matnr = lv_matnr
levdo = '99'
levup = '00'
sanin = 'X'
select_equi = 'X'
select_iflo = 'X'
select_stpo = 'X'
selmod = 'D'
stkkz = ''
werks = item_plant
with_equi = 'X'
with_equi_hier = 'X'
with_iflo_hier = 'X'
with_btyp = 'X'
with_mara = 'X'
with_ibase_hier = ''
capid = ''
emeng = 0
IMPORTING
et_hier = lt_hier
EXCEPTIONS
no_hierarchy = 1
no_object_defined = 2
no_selection = 3
no_valid_equnr = 4
no_valid_matnr = 5
no_valid_selmod = 6
no_valid_tplnr = 7
OTHERS = 8.
LOOP AT lt_hier INTO ls_hier.
ls_hier_return-object_key = ls_hier-object.
ls_hier_level-object_key = ls_hier-object.
ls_hier_level-predecessor = ls_hier-predecessor.
lv_len = strlen( ls_hier-object ).
IF lv_len GT 1.
lv_len_temp = lv_len - 1.
ELSEIF
lv_len_temp = lv_len.
ENDIF.
ls_hier_level-level = ls_hier-level.
IF ls_hier-object(1) = 'T'.
ls_hier_return-icon = 'ICON_TECHNICAL_PLACE'.
ls_hier_return-object_type = 'FUNCLOC'.
IF ls_hier-successors = 'Y'.
ls_hier_return-is_leaf = abap_false.
ls_hier_return-is_expanded = abap_false.
ls_hier_return-children_loaded = abap_true.
ELSE.
ls_hier_return-is_leaf = abap_true.
ls_hier_return-is_expanded = abap_true.
ls_hier_return-children_loaded = abap_true.
ENDIF.
ELSEIF ls_hier-object(1) = 'E'.
ls_hier_return-icon = 'ICON_EQUIPMENT'.
ls_hier_return-object_type = 'EQUI'.
IF ls_hier-successors = 'Y'.
ls_hier_return-is_leaf = abap_false.
ls_hier_return-is_expanded = abap_false.
ls_hier_return-children_loaded = abap_true.
ELSE.
ls_hier_return-is_leaf = abap_true.
ls_hier_return-is_expanded = abap_true.
ls_hier_return-children_loaded = abap_true.
ENDIF.
ELSEIF ls_hier-object+lv_len_temp(1) = 'M'.
ls_hier_return-icon = 'ICON_MATERIAL'.
ls_hier_return-object_type = 'MATERIAL'.
IF ls_hier-successors = 'Y'.
ls_hier_return-is_leaf = abap_false.
ls_hier_return-is_expanded = abap_false.
ls_hier_return-children_loaded = abap_false.
ELSE.
ls_hier_return-is_leaf = abap_true.
ls_hier_return-is_expanded = abap_true.
ls_hier_return-children_loaded = abap_true.
ENDIF.
ELSEIF ls_hier-object+lv_len_temp(1) = 'X'.
ls_hier_return-icon = 'ICON_SUPPLY_AREA'.
ls_hier_return-object_type = 'MATBOM'.
IF ls_hier-successors = 'Y'.
ls_hier_return-is_leaf = abap_false.
ls_hier_return-is_expanded = abap_false.
ls_hier_return-children_loaded = abap_false.
ELSE.
ls_hier_return-is_leaf = abap_true.
ls_hier_return-is_expanded = abap_true.
ls_hier_return-children_loaded = abap_true.
ENDIF.
ELSEIF ls_hier-object+lv_len_temp(1) = 'A'.
ls_hier_return-icon = 'ICON_MATERIAL_REVISION'.
ls_hier_return-object_type = 'MATERIAL'.
IF ls_hier-successors = 'Y'.
ls_hier_return-is_leaf = abap_false.
ls_hier_return-is_expanded = abap_false.
ls_hier_return-children_loaded = abap_false.
ELSE.
ls_hier_return-is_leaf = abap_true.
ls_hier_return-is_expanded = abap_true.
ls_hier_return-children_loaded = abap_true.
ENDIF.
ENDIF.
*IF ls_hier-predecessor EQ item_object_key OR ls_hier-object EQ item_object_key.
APPEND ls_hier_return TO lt_hier_return.
APPEND ls_hier_level TO lt_hier_level.
*ENDIF.
CLEAR lv_len.
CLEAR lv_len_temp.
ENDLOOP.
lt_hier_return_temp = lt_hier_return.
DESCRIBE TABLE lt_hier LINES lv_hier_lines.
IF lv_hier_lines EQ 0.
elem_selected_entry = wd_context->path_get_element( '1.ENTRIES.1' ).
Get children node
elem_selected_entry->set_attribute(
value = abap_true
name = 'IS_LEAF' ).
ENDIF.
*************************************Deleting Now***********
SORT lt_hier_level BY level DESCENDING.
LOOP AT lt_hier_level INTO ls_hier_level.
max_level = ls_hier_level-level.
EXIT.
ENDLOOP.
SORT lt_hier_level BY level ASCENDING.
LOOP AT lt_hier_level INTO ls_hier_level WHERE level EQ 0.
ls_hier_level-path = '1.ENTRIES.1'.
ls_hier_level-parent_path = '1.ENTRIES.1'.
MODIFY lt_hier_level FROM ls_hier_level.
ENDLOOP.
************************New design to Generate Path and Parent path
lv_cnt = 0.
temp_level = 1.
SORT lt_hier_level BY object_key ASCENDING.
LOOP AT lt_hier_level INTO ls_hier_level WHERE level EQ 1.
lv_cnt = lv_cnt + 1.
lv_parent_path = '1.ENTRIES.1'.
ls_hier_level-parent_path = lv_parent_path.
pos = lv_cnt.
CONCATENATE lv_parent_path separator 'SUB_ENTRIES' separator pos INTO lv_path.
ls_hier_level-path = lv_path.
MODIFY lt_hier_level FROM ls_hier_level.
ENDLOOP.
temp_level = 1.
lv_cnt = 0.
*********************Need to call this for each level ***************************
WHILE temp_level LT max_level.
CLEAR lt_pred.
CLEAR ls_pred.
LOOP AT lt_hier_level INTO ls_hier_level WHERE level EQ temp_level.
ls_pred-parent = ls_hier_level-object_key.
ls_pred-path = ls_hier_level-path.
APPEND ls_pred TO lt_pred.
ENDLOOP.
SORT lt_pred BY parent.
DELETE ADJACENT DUPLICATES FROM lt_pred.
LOOP AT lt_pred INTO ls_pred.
lv_cnt = 0.
LOOP AT lt_hier_level INTO ls_hier_level WHERE predecessor EQ ls_pred-parent.
lv_cnt = lv_cnt + 1.
lv_parent_path = ls_pred-path.
ls_hier_level-parent_path = lv_parent_path.
lv_path = ''.
pos = lv_cnt.
CONCATENATE lv_parent_path separator 'SUB_ENTRIES' separator pos INTO lv_path.
ls_hier_level-path = lv_path.
MODIFY lt_hier_level FROM ls_hier_level.
ENDLOOP.
ENDLOOP.
temp_level = temp_level + 1.
ENDWHILE.
LOOP AT lt_hier_level INTO ls_hier_level.
LOOP AT lt_hier_return INTO ls_hier_return.
IF ls_hier_level-object_key = ls_hier_return-object_key.
MOVE-CORRESPONDING ls_hier_level TO ls_hier_return.
MODIFY lt_hier_return FROM ls_hier_return.
ENDIF.
ENDLOOP.
ENDLOOP.
SORT lt_hier_return BY path ASCENDING.
**************************Delete the extra first character returned by PM_HIERARCHY_CALL******
LOOP AT lt_hier_return INTO ls_hier_return.
IF ls_hier_return-object_key(1) = 'T'.
SHIFT ls_hier_return-object_key BY 1 PLACES.
lv_object_key = ls_hier_return-object_key.
lv_funcloc_ext = lv_object_key.
CALL FUNCTION 'CONVERSION_EXIT_TPLNR_OUTPUT'
EXPORTING
input = lv_funcloc_ext
IMPORTING
output = lv_funcloc.
lv_int_obj_key = lv_funcloc.
ls_hier_return-object_key = lv_int_obj_key.
ELSEIF ls_hier_return-object_key(1) = 'E'.
SHIFT ls_hier_return-object_key BY 1 PLACES.
lv_object_key = ls_hier_return-object_key.
obj_len = strlen( lv_object_key ).
IF obj_len GE 18.
lv_object_key = lv_object_key+0(18).
ENDIF.
wd_comp_controller->conv_ext_2_int(
EXPORTING
iv_object_key_ext = lv_object_key " String
iv_object_type = 'EQUI' " String
IMPORTING
ev_object_key = lv_int_obj_key " String
SHIFT lv_int_obj_key LEFT DELETING LEADING '0'.
ls_hier_return-object_key = lv_int_obj_key.
ELSE.
SHIFT ls_hier_return-object_key BY 1 PLACES.
lv_object_key = ls_hier_return-object_key.
obj_len = strlen( lv_object_key ).
IF obj_len GE 18.
lv_object_key = lv_object_key+0(18).
ENDIF.
SHIFT lv_object_key LEFT DELETING LEADING '0'.
ls_hier_return-object_key = lv_object_key.
ENDIF.
MODIFY lt_hier_return FROM ls_hier_return TRANSPORTING object_key object_key.
ENDLOOP.
LOOP AT lt_hier_level INTO ls_hier_level.
IF ls_hier_level-object_key(1) = 'T'.
SHIFT ls_hier_level-object_key BY 1 PLACES.
lv_object_key = ls_hier_level-object_key.
lv_funcloc_ext = lv_object_key.
CALL FUNCTION 'CONVERSION_EXIT_TPLNR_OUTPUT'
EXPORTING
input = lv_funcloc_ext
IMPORTING
output = lv_funcloc.
lv_int_obj_key = lv_funcloc.
ls_hier_level-object_key = lv_int_obj_key.
ELSEIF ls_hier_level-object_key(1) = 'E'.
SHIFT ls_hier_level-object_key BY 1 PLACES.
lv_int_obj_key = ls_hier_level-object_key.
obj_len = strlen( lv_int_obj_key ).
IF obj_len GE 18.
lv_int_obj_key = lv_int_obj_key+0(18).
ENDIF.
wd_comp_controller->conv_ext_2_int(
EXPORTING
iv_object_key_ext = lv_int_obj_key " String
iv_object_type = 'EQUI' " String
IMPORTING
ev_object_key = lv_int_obj_key " String
SHIFT lv_int_obj_key LEFT DELETING LEADING '0'.
ls_hier_level-object_key = lv_int_obj_key.
ELSE.
SHIFT ls_hier_level-object_key BY 1 PLACES.
lv_int_obj_key = ls_hier_level-object_key.
obj_len = strlen( lv_int_obj_key ).
IF obj_len GE 18.
lv_int_obj_key = lv_int_obj_key+0(18).
ENDIF.
SHIFT lv_int_obj_key LEFT DELETING LEADING '0'.
ls_hier_level-object_key = lv_int_obj_key.
ENDIF.
MODIFY lt_hier_level FROM ls_hier_level TRANSPORTING object_key object_key.
ENDLOOP.
*********************Getinfo if root node else call Get_Children_Info to generate the structure as well*******
IF lv_path EQ '1.ENTRIES.1'.
element = wd_context->path_get_element( lv_path ).
navigate from <ENTRIES> to <SUB_ENTRIES> via lead selection
node_sub_entries = element->get_child_node( name = 'SUB_ENTRIES' ).
element->get_attribute( EXPORTING name = 'OBJECT_KEY'
IMPORTING value = item_object_key ).
element->get_attribute( EXPORTING name = `OBJECT_TYPE`
IMPORTING value = item_object_type ).
****************Get Info of Technical Objects*************
wd_comp_controller->get_children_info(
EXPORTING
iv_lt_list = lt_hier_return " Rplm_Tt_Mt_Struc
iv_path = ''
iv_hier_level = lt_hier_level
IMPORTING
ev_lt_full = lt_hier_return " Rplm_Tt_Mt_Struc
Create the strcuture by binding the entries to Node which is bound to the table
element = wd_context->path_get_element( lc_path ).
Get children node
node_sub_entries = element->get_child_node( 'SUB_ENTRIES' ).
CALL METHOD node_sub_entries->bind_table
EXPORTING
new_items = lt_hier_return
set_initial_elements = abap_true.
@TODO handle not set lead selection
IF ( node_entries IS INITIAL ).
ENDIF.
lv_temp = 1.
***************Sort the LT_HIER_TABLE appropriately ******
LOOP AT lt_hier_return INTO ls_hier_return .
MOVE-CORRESPONDING ls_hier_return TO ls_hier_return_sort.
ls_hier_return_sort-path_length = strlen( ls_hier_return_sort-path ).
APPEND ls_hier_return_sort TO lt_hier_return_sort.
ENDLOOP.
SORT lt_hier_return_sort BY path_length ASCENDING path ASCENDING.
CLEAR lt_hier_return.
LOOP AT lt_hier_return_sort INTO ls_hier_return_sort.
MOVE-CORRESPONDING ls_hier_return_sort TO ls_hier_return.
APPEND ls_hier_return TO lt_hier_return.
ENDLOOP.
*wd_comp_controller->gv_master_data = lt_hier_return.
LOOP AT lt_hier_return INTO ls_hier_return.
lv_path = ls_hier_return-path.
lc_path = ls_hier_return-parent_path.
IF lv_path NE '1.ENTRIES.1'.
element = wd_context->path_get_element( lc_path ).
Get children node
node_sub_entries = element->get_child_node( 'SUB_ENTRIES' ).
Now, create the children elements
element->get_attribute( EXPORTING name = 'OBJECT_KEY'
IMPORTING value = ls_hier_level-predecessor ).
Create the strcuture by binding the entries to Node which is bound to the table
CALL METHOD node_sub_entries->bind_structure
EXPORTING
new_item = ls_hier_return
set_initial_elements = abap_false.
ENDIF.
ENDLOOP.
Only when a new level is reached we create one more child node
else we attach our elements to same child node
element = wd_context->path_get_element( item_path ).
Get children node
element->set_attribute(
value = abap_false
name = 'IS_EXPANDED' ).
ENDIF.
navigate from <CONTEXT> to <GENERAL> via lead selection
node_general = wd_context->get_child_node( name = wd_this->wdctx_general ).
get element via lead selection
elem_general = node_general->get_element( ).
get single attribute
elem_general->set_attribute(
name = `COLLAPSE_VISIBILITY`
value = abap_false ).
node_selected_entry = wd_context->get_child_node( name = if_structure_view_new=>wdctx_selected_entry ).
get element via lead selection
elem_selected_entry = node_selected_entry->get_element( ).
get single attribute
elem_selected_entry->set_attribute(
name = `OBJECT_KEY`
value = '' ).
elem_selected_entry->set_attribute(
name = `OBJECT_TYPE`
value = '' ).
get element via lead selection
elem_context = wd_context->get_element( ).
get single attribute
elem_context->set_attribute(
name = `EXPAND_ALL`
value = abap_false ).
wd_this->enable_buttons(
endmethod. -
Is it possible to access elements of a view in implementation class?
Hi,
In the BSP component workbench, is it possible to manipulate elements of a view (listbox, inputfields etc., hardcoded using htmlb tags) in the methods of view implementation class. For example, I have a inputfield which is initially invisible. I want to make it visible when a particular event is triggered. I wish to code this directly in the event handler method. Can anybody provide some pointers?Arun,
As the UI elements (tags) do only exist during rendering phase a direct access from the view controller is not possible - especially not in the forward-oriented way from within an event handler as indicated from you in the posting.
However, it is of course possible to hard-code view layouts; for this approach you can use the BSP view corresponding to the view and code there whatever you like. BSP views can also contain code snippets to achieve dynamic effects. In your example it doesn't look like that you need code at all - you need to preserve the status (visible/ invisible) in a value attribute of a context node and use this value to bind visibility of the input field on the layout.
In CRM 2007, there are two main tag libraries (aka BSP extensions) being used:
- THTMLB (single tags, like input field, button, table, ...)
- CHTMLB (configuration tags; these are available for forms, tables and trees)
You should always use these tag libraries in the first place to assure common look and feel and avoid rendering issues.
Best regards
Peter -
ABAP webdynpro how to give spacing between the UI Elements in a view
Hi Expert,
I am very new to webdynproapplication development. I am stuck in changing the look of the ui elements of the view.
Cud anyone explain how to set the spaces between the UI Elements on a View is there any method ?
I have set the Layout property to Matrix layout. But here I am unable to set the spacing between the deffernet elements as it is taking it automaticaaly and I am not able to allign all the Elements.
Need your help!.............thank you
Moderator message: wrong forum, please have a look in the dedicated "Web Dynpro ABAP" forum.
Edited by: Thomas Zloch on Apr 15, 2011 10:17 PMHi anushree.,
If u are using matrix layout:
In Layout Data select MatrixHeadData to display UI in next line.,
If u want to give space between UI elements in the width enter 50, 60, 70 or what ever space u want.
Also in the vGutter u can select medium , large , medium with rule to give space between UI elements.
n if u want to give space between lines ., in the height enter 30 40 or whatever spacing between lines u want.,
Matrix layout is a good layout., and u can play with colspan , hAlign, vAlign, vGutter, width and height options.,
If u dont like the layout with these options then use Grid layout., where u can give custom spacing., with the help of Left Padding, Right Padding, Top Padding, Bottom Padding.
reply if u need some more clarifications.,
Thanks & Regards
Kiran -
Floated element breaks Design view in Dreamweaver CS3
I've tried searching for this issue but haven't found a fix yet and could use some help.
I am redesigning a site and am adding a fluid box to the page. This floated element breaks Design View in Dreamweaver CS3 but appears correctly in the Firefox, Chrome, and IE. I can get the element to appear correctly in Design View after I make minor changes to the page's HTML or CSS, however it always breaks when I save the file.
I've tried many work-arounds including adding an absoutely defined container div, altering the various div sizes, adding <div class="clear"> before and after the element, to no avail.
Ideally, I would like to have page appear correctly in Design View so that others in my lab can easily update the page (and not come to me with repeated questions!).
I've included screen prints of how it looks in Design View and how it look in Chrome.
THANKS! J
Design Time error:
Web Browser - correct view:I'll try CS4; however my main reason for finding a fix is so that others updating the page (w/ CS3) will be able to do so w/ the WYSIWYG editor that we purchased. We will not be upgrading to CS4 anytime soon either.
Thanks -
List Template Always Defaluts to 'Current View' Rather than the Defaulted ' All Tasks' Veiw
I have created a task list template. I have selected all of columns and deleted all others. I have created only one view clled 'All Tasks' and set it to my defult, in addition I have deleted all of the other views. However, when I instert
the task template on another page or when it's used as part of a site template it reverts back to 'Current View' and shows a bunch of columns that I deleted. I am forced to change the view everytime I insert it on to a page. Under the List Settings
I don't even see anything called 'Current View'.
How do I avoid this default?Hi KHDMS,
According to your description, I did a test in my SharePoint 2010 as the followings:
1. Create a task list named ‘Task template’, create a custom view named ‘View1’ different from All tasks view, and set the view as the default view
2. Add some items into the tasks list
3. Delete other views except the view1
4. Create a page, add the tasks ‘Task template’ into the page
5. Then the web part displayed like All Tasks view in the tasks list
6. Create another tasks list ‘Tasks2’, create a custom view named ‘View1’ diferent from All Tasks view, and set the view as the default view
7. Reproduce the step 4, then the result is same with the above test.
8. Then I tried to set the system view like ‘My task’ as the default view, then reproduced the step 4
9. The web part displayed as My Task view.
For this issue, it seems to be happened on the custom view, if you want to display the custom view for the tasks web part on a page, you can do as Edit Web Part-> selecting the custom view under Selected View.
I hope this helps.
Thanks,
Wendy
Wendy Li
TechNet Community Support -
Alert is not working for mutiple times for list "select" function in sapui5 XML view
Hello All,
I am trying to open an alert for multiple times for list "select" function. But it's opening for only one time .
Please find code below.
View Part
<List id="contactedit" select="somefunction">
<CustomListItem id="custom1" type="Inactive" >
<content>
<Label text="this is label" />
</content>
</CustomListItem>
</List>
Controller Part
somefunction: function(oEvent){
alert("this is an alert");
Thanks in Advance
D.MohanbabuI think I saw this question in stack overflow. And I answered it :-)
I believe that it is because you can only one item in the list and once the item is selected, re-selecting it will not fire the event.
Try adding more items to the list and select different items.
Thanks
-D -
Explaination of UI elements in a view
Hi gurus,
I want to create a Pane in the webpage just like we have in BSP...when i was gng through the UI elements in the view i was bit confused what to select...
is there any doc which explains about the UI elements in detail...
or please suggest me how do i start creating the pane ...
the pane shld be in left side of the webpage and shld contain something like menu etc...
Regards
HarikaHi,
Please refer to this link: http://help.sap.com/saphelp_nw70ehp1/helpdata/en/df/da8b412bb5b35fe10000000a1550b0/frameset.htm
I hope it helps.
Regards
Arjun -
Iterate through UI elements in a view
Hi,
I would like to iterate through the UI elements in a view, to read their 'id' values, and populate an arraylist. Could you please suggest how to accomplish this ?
Thanks !Hi,
If ur requirement is just to get the ID's Noufal 's solution should be sufficient.
IWDTransparentContainer t = (IWDTransparentContainer)view.getElement("RootUIElementContainer");
IWDUIElement a[] = t.getChildren();
for(int i =0;i<a.length;i++){
wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(a<i>.getId());
IWDUIElement i1 = (IWDUIElement)view.getElement(a<i>.getId());
wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(""+i1.getClass());
If all the elements are created in design time you will know the element IDs and types. So further processing for manipulation of the UI properites will be easy.
But if elements are added dynamically you will be able to get their ID s and the class type. But i wonder if u will be able to proceed further.
Regards
Bharathwaj -
Need to add new UI elements in HAP_PMP_OVERALL_APPRAISAL view VW_MAIN
Hi,
how to add new UI elements (input field, read only field and button) on VW_MAIN view of HAP_PMP_OVERALL_APPRAISAL .
This is about ESS MSS Performance Mgmt.
I am checking for enhancement modifications, enhacement spots, dynamic programming to add new UI elements etc.
kindly provide inputs
thanks
BHi,
The following procedure explains how to add UI elements in the view of the standard component.
1. Create an Enhancement Implementation.
2. Create a new node on Component controller context.
3. Create a new method on component controller as the supply function of the new node.
4. Create new node on the view context by binding it from the controller context.
5. Create the UI elements on view.
6. Create post-exit on view method DoModifyView.--> In order to handle the events of UI element newly added.
7. Create a pre-exit on component method(Ex: SAVEAPPRAISALDATA) --> to get the static attributes of node.
Hope, the above steps will be useful .
Regards,
Abi
Maybe you are looking for
-
MBP screen black after using DVI to HDMI cable
Over a week ago I attempted to connect my MBP 2007 model to my samsung television with HDMI in. I have used this cable before but always have trouble getting it to work with this TV and my computer. Well, I plugged it in and the screen on my computer
-
[SOLVED] Cannot startup properly after recent pacman -Syu
I'm having a bit of trouble starting up my system after a recent upgrade (6-6-13). I ran into some issues beforehand with the error filesystem: /bin exists in filesystem filesystem: /sbin exists in filesystem but resolved that by following the steps
-
Having Difficulties with the Paste Board Server (PBS)
Hello! I have having difficulty with the paste board server with extensive use of QuicKeys v3.1.1. I have a repetitive process that draws data from FileMaker Pro 8.0v3 to populate variables in QucKeys via the clipboard. The data is then used by QuicK
-
Lenovo u310 /no touch/ Recently had keyboard problem. with 1 2 3 4 7 8 9 0 and F1 F2 F3 F6 F7 F8 F9 F10 F11 F12 keys not working. Had new clean install of windows 8, and windows 7 afterwards. Still these keys not working. Driver is up to date. Tried
-
Updated to windows 8.1. Don't like the changes to Exchange
I recently updated to windows 8.1 from 8.0. Now when I go on my Exchange OWA my flags are gone. Then the other folders are now in a drop down box that you can't expand. When I login at home my flags are still there, I have not updated at home. That's