How to show/hide an element in real time (Blazor)? - forms

I have an image I would like to display only after a user has filled in all text fields.
I have tried using disabled attribute, but that does not seem to work. Any other insights?
Here is my current code:
<EditForm EditContext="#EditContext" style="max-width:800px;" onkeydown="javascript: DisableEnterKey();">
<FluentValidator />
<img src="images/approval-16-grey.ico" alt="Image" disabled="#OkayDisabled">
<p class="statp">How many families and/or individuals are living on your land?</p><br />
<label class="statlabel" for="amountOfFamilies">Amount of families:</label><br />
<InputNumber id="fams" for="indivNum" class="input" #bind-Value="#familyData.IndividualAmount" onwheel="this.blur()" placeholder="Families..." autofocus />
<ValidationMessage For="() => familyData.IndividualAmount" />
<br /><hr class="statHR" />
<label class="statlabel" for="amountOfIndividuals">Amount of single individuals: </label><br />
<InputNumber id="individuals" for="famNum" class="input" #bind-Value="#familyData.FamilyAmount" onwheel="this.blur()" placeholder="Individuals..."/>
<ValidationMessage For="() => familyData.FamilyAmount" />
<br /><hr class="statHR" />
<label class="statlabel" for="names"> Please enter all of the names here:</label><br />
<InputTextArea id="names" class="textArea" rows="4" cols="18" #bind-Value="#PersonName" placeholder="Names of all individuals..." />
<ValidationMessage For="() => familyData.PersonName" />
</EditForm>
</div>
</ul>
#code
{
private EditContext? EditContext;
public FamilyData Model = new FamilyData();
protected string OkayDisabled { get; set; } = "disabled";
protected override void OnInitialized()
{
EditContext = new EditContext(Model);
EditContext.OnFieldChanged += EditContext_OnFieldChanged;
base.OnInitialized();
}
protected override void OnAfterRender(bool firstRender)
{
base.OnAfterRender(firstRender);
SetOkDisabledStatus();
}
private void EditContext_OnFieldChanged(object? sender, FieldChangedEventArgs e)
{
SetOkDisabledStatus();
}
private void SetOkDisabledStatus()
{
if(EditContext.Validate())
{
OkayDisabled = null;
}
else
{
OkayDisabled = "disabled";
}
}
}

The hidden html attribute also works to hide an element.
<p hidden>This paragraph should be hidden.</p>
To bind to Model:
<p hidden="#HideLabel">I am Hidden When HideLabel == true</p>
<p hidden="#(!HideLabel)">I am Hidden when Hidelabel == false</p>
<button #onclick="#Toggle">Show/Hide</button>
#code {
private bool HideLabel {get;set;} = false;
private void Toggle()
{
HideLabel = !HideLabel;
}
}
Edit: You can also use a CSS class to hide/show an element:
<div class="font-italic #(HideLabel ? "d-none" : "d-show")">
I am Hidden When HideLabel == true
</div>

Change OkayDisabled to a bool, and then around your image do this
#if (!OkayDisabled)
{
<img src=".....whatever" etc />
}
You might also want to add #bind:event="oninput" wherever you use an #bind.

Instead of binding your flag to the disabled attribute (an image's disabled attribute just grays it out), I would bind it to a css class that has display: none;
.hidden {
display: none;
}
<img class="#(ShouldShowImage? "hidden" : string.Empty)">

didn't used it within editform but should work
#if(OkayDisabled)
{
<img src="images/approval-16-grey.ico" >

Related

Redirecting from RedirectToLogin.razor gives error

I have the following code:
App.razor
#using DorpshuisManager.Areas.Identity.Components
<CascadingAuthenticationState>
<Router AppAssembly="#typeof(App).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="#routeData" DefaultLayout="#typeof(MainLayout)">
<NotAuthorized>
#if (!context.User.Identity.IsAuthenticated)
{
<RedirectToLogin ReturnUrl="#NavigationManager.ToBaseRelativePath(NavigationManager.Uri)" />
}
else
{
<p role="alert">Sorry, you're not authorized to view this page.</p>
}
</NotAuthorized>
</AuthorizeRouteView>
<FocusOnNavigate RouteData="#routeData" Selector="h1" />
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="#typeof(MainLayout)">
<div class="d-flex vw-100 vh-100 align-items-center justify-content-center text-center">
<div>
<iconify-icon icon="tabler:face-id-error" style="color: black;" width="100" height="100"></iconify-icon>
<h1>Pagina niet gevonden ...</h1>
<a href="/">
<button class="btn btn-primary mt-3 btn-rounded py-3 px-4">Ga naar home pagina</button>
</a>
</div>
</div>
</LayoutView>
</NotFound>
</Router>
</CascadingAuthenticationState>
RedirectToLogin.razor
#code {
[Parameter]
public string ReturnUrl { get; set; }
protected override async Task OnInitializedAsync()
{
ReturnUrl = "~/" + ReturnUrl;
NavigationManager.NavigateTo("Identity/Account/Login?returnUrl=" + ReturnUrl, true);
await base.OnInitializedAsync();
}
}
But I get the following error:
I searched on Google and Stack Overflow, but all given anwsers are not working...
I also tried aspnetcore blazor navigation from razor component to razor page but this also didn't work
Try this:
Redirect component:
#inject NavigationManager NavManager
#if(IsAuthenticated)
{
<div class="alert alert-danger">Sorry, you're not authorized to view this page.</div>
}
else
{
<div class="alert alert-info">Redirecting to the Log In Page.</div>
}
#code {
[Parameter] public bool IsAuthenticated { get; set; }
[Parameter] public string ReturnUrl { get; set; } = string.Empty;
protected async override Task OnAfterRenderAsync(bool firstRender)
{
// added to show the messsge
await Task.Delay(2000);
ReturnUrl = "/" + ReturnUrl;
if (!IsAuthenticated)
this.NavManager.NavigateTo("Identity/Account/Login?returnUrl=" + ReturnUrl, true);
}
}
And App:
<AuthorizeRouteView RouteData="#routeData" DefaultLayout="#typeof(MainLayout)">
<NotAuthorized>
<ReturnToLogin IsAuthenticated="context.User.Identity?.IsAuthenticated ?? false" />
</NotAuthorized>
</AuthorizeRouteView>

Blazor form validation to readonly fields

I am developing an application using C# in Blazor Framework. I have designed some forms like the following, where the grey areas are populated with the button below which triggers a pop up window for selection. Then after selection is done the selected item description will populated into the gray area. This grey area is an InputText element.
If the grey InputTexts are marked as required & readonly, then the areas are grey and users cannot insert manually their values but only though selection window. This is good, but if the user did not populate the window for selection it can also submit the form.
If the grey InputTexts are marked as required and beeing readonly though css, then the validation works, so the user should populate the window selection first, but if he did not, then the grey area becomes editable for manual input.
Any ideas how I can protect the application from manual input but at the same time make the validation work?
Any ideas how I can protect the application from manual input but at the same time make the validation work?
If I'm reading the question correctly, the demo below shows how to link the selector (in this case a select control) and the display and show the correct validation information and UX without access to the readonly control.
As you show no code, I don't know whether this fits with your model and form.
#page "/"
#using System.ComponentModel.DataAnnotations;
<PageTitle>Index</PageTitle>
<h1>Demo</h1>
<EditForm Model="model" OnValidSubmit=#OnSubmit class="border border-dark p-3 m-2">
<DataAnnotationsValidator />
<div class="mb-2">
<label class="form-label">Country</label>
<InputText class="form-control" disabled #bind-Value="#model.Value" />
<ValidationMessage For="() => model.Value" />
</div>
#if (!show)
{
<div class="mb-2">
<button type="button" class="btn btn-dark" #onclick=OnShow>Select Country</button>
</div>
}
else
{
<div class="mb-2">
<InputSelect class="form-select" #bind-Value:get=#model.Value #bind-Value:set="this.OnSetCountry">
<option value="">-- Select a Country -- </option>
<option value="UK">UK</option>
<option value="France">France</option>
<option value="Portugal">Portugal</option>
</InputSelect>
</div>
}
<div class="col=12 mt-2 text-end">
<button class="btn btn-success" type="submit">Submit</button>
</div>
</EditForm>
<h3 class="mt-4">Hides the -- Select a Country -- once a value is selected</h3>
<EditForm Model="model2" OnValidSubmit=#OnSubmit class="border border-dark p-3 m-2">
<DataAnnotationsValidator />
<div class="mb-2">
<label class="form-label">Country</label>
<InputText class="form-control" disabled #bind-Value="#model2.Value" />
<ValidationMessage For="() => model2.Value" />
</div>
#if (!show2)
{
<div class="mb-2">
<button type="button" class="btn btn-dark" #onclick=OnShow2>Select Country</button>
</div>
}
else
{
<div class="mb-2">
<InputSelect class="form-select" #bind-Value:get=#model2.Value #bind-Value:set="this.OnSetCountry2">
#if (model2.Value is null)
{
<option selected disabled value="">-- Select a Country -- </option>
}
<option value="UK">UK</option>
<option value="France">France</option>
<option value="Portugal">Portugal</option>
</InputSelect>
</div>
}
<div class="col=12 mt-2 text-end">
<button class="btn btn-success" type="submit">Submit</button>
</div>
</EditForm>
#code {
private Model model = new();
private bool show = false;
private Model model2 = new();
private bool show2 = false;
private void OnSetCountry(string? value)
{
model.Value = null;
if (value is not null || value != string.Empty)
model.Value = value;
show = false;
}
private void OnSetCountry2(string? value)
{
model2.Value = null;
if (value is not null || value != string.Empty)
model2.Value = value;
show2 = false;
}
private void OnShow()
=> show = !show;
private void OnShow2()
=> show2 = !show2;
public void OnSubmit()
{ }
public class Model
{
[Required]
public string? Value { get; set; }
}
}

How to set default dropdown value from in Blazor

recently i am playing around with blazor-pizza shops tutorial.
I think of something to fix here.
Current:
American bacon is my first selection, after i selected it, the dropdownlist is selecting Artichoke hearts
Outcome I want:
Dropdownlist to reset default selecting "(select)" after i select the American bacon
My code like this:
#inject HttpClient HttpClient
#code {
List<Topping> toppings;
[Parameter] public Pizza Pizza { get; set; }
[Parameter] public EventCallback OnCancel { get; set; }
[Parameter] public EventCallback OnConfirm { get; set; }
protected async override Task OnInitializedAsync()
{
toppings = await HttpClient.GetFromJsonAsync<List<Topping>>("toppings");
}
void ToppingSelected(ChangeEventArgs e)
{
if (int.TryParse((string)e.Value, out var index) && index >= 0)
{
AddTopping(toppings[index]);
toppings.Remove(toppings[index]);
}
}
void AddTopping(Topping topping)
{
if (Pizza.Toppings.Find(pt => pt.Topping == topping) == null)
{
Pizza.Toppings.Add(new PizzaTopping() { Topping = topping });
}
}
void RemoveTopping(Topping topping)
{
Pizza.Toppings.RemoveAll(pt => pt.Topping == topping);
toppings.Add(topping);
toppings = toppings.OrderBy(p=>p.Name).ToList();
}
}
<div class="dialog-container">
<div class="dialog">
<div class="dialog-title">
<h2>#Pizza.Special.Name</h2>
#Pizza.Special.Description
</div>
<form class="dialog-body">
<div>
<label>Size:</label>
<input type="range" min="#Pizza.MinimumSize" max="#Pizza.MaximumSize" step="1" #bind="Pizza.Size" #bind:event="oninput" />
<span class="size-label">
#(Pizza.Size)" (£#(Pizza.GetFormattedTotalPrice()))
</span>
</div>
<div>
<label>Extra Toppings:</label>
#if (toppings == null)
{
<select class="custom-select" disabled>
<option>(loading...)</option>
</select>
}
else if (Pizza.Toppings.Count >= 6)
{
<div>(maximum reached)</div>
}
else
{
<select id="ToppingSelection" class="custom-select" #onchange="ToppingSelected">
<option value="-1" disabled selected>(select)</option>
#for (var i = 0; i < toppings.Count; i++)
{
<option value="#i">#toppings[i].Name - (£#(toppings[i].GetFormattedPrice()))</option>
}
</select>
}
</div>
<div class="toppings">
#foreach (var topping in Pizza.Toppings)
{
<div class="topping">
#topping.Topping.Name
<span class="topping-price">#topping.Topping.GetFormattedPrice()</span>
<button type="button" class="delete-topping" #onclick="#(() => RemoveTopping(topping.Topping))">x</button>
</div>
}
</div>
</form>
<div class="dialog-buttons">
<button class="btn btn-secondary mr-auto" #onclick="OnCancel">Cancel</button>
<span class="mr-center">
Price: <span class="price">#(Pizza.GetFormattedTotalPrice())</span>
</span>
<button class="btn btn-success ml-auto" #onclick="OnConfirm">Order ></button>
</div>
</div>
I would recommend rewriting the form to use the built-in Blazor components like InputSelect with proper two-way binding etc.
However, a "quick" fix could be something like a static binding. First, create a field that always has a value of -1 which is your code for (select)
#code {
private readonly Int32 _toppingsIndex = -1;
}
In the next step, set the value to the select control.
<select id="ToppingSelection" class="custom-select"
#onchange="ToppingSelected"
value="#_toppingsIndex">
<option value="-1" disabled>(select)</option>
#for (var i = 0; i < toppings.Count; i++)
{
<option value="#i">#toppings[i].Name - (£#(toppings[i].GetFormattedPrice()))</option>
}
</select>
Explanation
As soon as you select something, your method ToppingSelected is executed, and the topping is removed from the list. As soon as the method has finished, a new render cycle is started. The value is still -1, so the option with the value -1 will be selected after the rendering is finished.

Getting CheckList data in MVC6 post

I am doing user roles in MVC6 (using EF7), and I am think I am just missing something, but on a form used to define a user roles I get nothing in the posted back Model to the controller
This is my Model
public class UserRoleItem
{
public int Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public IdentityUserRole<int> userRole { get; set; }
public bool HasRole { get; set; }
}
public class UsersRolesViewModel
{
public int UserId { get; set; }
public string FullName { get; internal set; }
public List<UserRoleItem> UserRoles;
}
This is the view
#model Skill.ViewModels.Manage.UsersRolesViewModel
<br />
<h3>Set Roles for user - #Model.FullName</h3>
<form asp-action="ChangeUsersRoles" >
<div class="form-horizontal">
<hr />
<input type="hidden" asp-for="UserId" />
#foreach (var userRole in Model.UserRoles)
{
<input type="hidden" asp-for="#userRole.Id" />
<div class="form-group">
<div class="inline-block col-md-8">
<span class="col-md-1" align="center">
<input type="checkbox" asp-for="#userRole.HasRole" />
</span>
<div class="col-md-7">
#userRole.Name (#userRole.Description)
</div>
</div>
</div>
}
<hr />
<div class="form-group">
<div class="col-md-10">
<input type="submit" value="Save" class="btn btn-default" />
</div>
</div>
</div>
</form>
This is the Controller
// GET: Users/ChangeUserRoles/5
public async Task<IActionResult> ChangeUserRoles(int? id)
{
if (id == null)
{
return HttpNotFound();
}
var model = new UsersRolesViewModel();
ApplicationUser appUser = await _context.ApplicationUsers.SingleAsync(m => m.Id == id);
if (appUser == null)
{
return HttpNotFound();
}
else
{
model.UserId = (int)id;
model.FullName = appUser.FullName;
var some = from r in _context.Roles
from ur in _context.UserRoles
.Where(inner => r.Id == inner.RoleId && inner.UserId == id)
.DefaultIfEmpty()
select new UserRoleItem
{
Id = (int)r.Id,
Name = r.Name,
Description = r.NormalizedName,
userRole = ur, // this is needed else it has a hissy fit
HasRole = (ur != null)
};
// get all of the Roles and then also link to the ones the user currently has
model.UserRoles = (some).ToList();
}
return View(model);
}
// POST: Users/ChangeUserRoles/5
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> ChangeUserRoles([Bind(include:"UserId,UserRoles")]UsersRolesViewModel userModel)
{
if (ModelState.IsValid)
{
// update based on the changes
// return RedirectToAction("Edit", new { userModel.UserId });
}
return View(userModel);
}
So when I get the post back on Save, the UserRoles list is null, so I assume I am just missing an obvious thing here?
Also another small issue is the EF Linq statement. If I remove the
userRole = ur,
statement from the Select portion of the Linq query, the system has a fit and says my schema is out of date (which it isn't). I think it is due to the following statement where I am testing the outer join value
HasRole = (ur != null)
Although this seems perfectly reasonable and works if the ur variable is used prior to testing for null (or not)
After entering this question - I further investigated the issue and found that I could do what I needed using an EditorTemplate
So I created the EditorTemplate Folder under my Users View folder as it was a UsersController and then added the following UserRoleItem.cshtml file
#model UserRoleItem
<input type="hidden" asp-for="Id" />
<div class="form-group">
<div class="inline-block col-md-8">
<span class="col-md-1" align="center">
<input type="checkbox" asp-for="HasRole" />
</span>
<div class="col-md-7">
#Model.Name (#Model.Description)
</div>
</div>
</div>
I then changed the view (called ChangeUsersRole.cshtml) to be
#model Skill.ViewModels.Manage.UsersRolesViewModel
<br />
<h3>Set Roles for user - #Model.FullName</h3>
<hr />
<form asp-action="ChangeUsersRoles">
<div class="form-horizontal">
<input type="hidden" asp-for="UserId" />
#Html.EditorFor(m => m.UserRoles)
<hr />
<div class="form-group">
<div class="col-md-10">
<input type="submit" value="Save" class="btn btn-default" />
</div>
</div>
</div>
</form>
Note also: that I tried using the new format
<input asp-for="UserRoles" />
instead of this line in the view
#Html.EditorFor(m => m.UserRoles)
But it did not work as expected. Again maybe I am still doing something wrong - or maybe that feature isn't working yet?

Sakai Site page tools alignment

i want to customize sakai site tool configuration like this format using layouts. but by default in sakai layout is possible by double layout or single layout. actually i need combination of both first row is double column layout and remaining single column layouts.
please tell me is there any option to do like this.or provide me guidance how to customize .here i am inserted image i want tool alignment like this
Thanks In Advance
http://i.stack.imgur.com/Xjy17.png
finally its working i did this. Please provide any suggestions if required for more flexibility or any other way to do this.
Kernel
Sitepage.java :-
Add
public static final int LAYOUT_MY_CUSTOM = 2;
BaseSitepage.java:-
Change this in
protected BaseSitePage(BaseSiteService siteService, Site site, String id, String title, String layout,
boolean popup)
{}
if (layout.equals(String.valueOf(LAYOUT_SINGLE_COL)))
{
m_layout = LAYOUT_SINGLE_COL;
}
else if (layout.equals(String.valueOf(LAYOUT_DOUBLE_COL)))
{
m_layout = LAYOUT_DOUBLE_COL;
}
else if(layout.equals(String.valueOf(LAYOUT_MY_CUSTOM))){
m_layout = LAYOUT_MY_CUSTOM;
}
And
protected BaseSitePage(BaseSiteService siteService, Site site, String id, String title, String layout,
boolean popup)
{} method
else if(layout.equals(String.valueOf(LAYOUT_MY_CUSTOM))){
m_layout = LAYOUT_MY_CUSTOM;
}
And
public void setLayout(int layout)
{
if ((layout == LAYOUT_SINGLE_COL) || (layout == LAYOUT_DOUBLE_COL) || (layout == LAYOUT_MY_CUSTOM))
{
m_layout = layout;
}
else
M_log.warn("setLayout(): set to invalid value: " + layout);
}
BaseSiteService.java:-
public String[] getLayoutNames()
{
String[] rv = new String[3];
rv[0] = rb.getString("sitpag.lay_sngl");
rv[1] = rb.getString("sitpag.lay_dbl");
rv[2] = rb.getString("sitpag.lay_cust1");
return rv; }
Portal:-
Comment following code in the method
public void includePage(PortalRenderContext rcontext, HttpServletResponse res,
HttpServletRequest req, Session session, SitePage page,
String toolContextPath, String wrapperClass) throws IOException
{
rcontext.put("pageColumnLayout", (page.getLayout()==SitePage.LAYOUT_DOUBLE_COL) ? "col1of2": "col1");
and replace the code
if(page.getLayout() == SitePage.LAYOUT_DOUBLE_COL){
rcontext.put("pageColumnLayout","col1of2");
}
else if(page.getLayout() == SitePage.LAYOUT_MY_CUSTOM){
rcontext.put("pageColumnLayout","SingleDouble");
}
else{
rcontext.put("pageColumnLayout","col1");
}
And change
rcontext.put("pageTwoColumn", Boolean
.valueOf(page.getLayout() == SitePage.LAYOUT_DOUBLE_COL || page.getLayout() == SitePage.LAYOUT_MY_CUSTOM));
And
// do the second column if needed
if (page.getLayout() == SitePage.LAYOUT_DOUBLE_COL ||page.getLayout() == SitePage.LAYOUT_MY_CUSTOM)
Site Manage:-
SiteAction.java
Add custom layout to following method 8990 line
private void addSynopticTool(SitePage page, String toolId,
String toolTitle, String layoutHint) {
if (page.getContainingSite() != null) {
if (page.getLayout() != SitePage.LAYOUT_SINGLE_COL || page.getLayout() != SitePage.LAYOUT_MY_CUSTOM|| !page.getContainingSite().isCustomPageOrdered() ) {
page.setLayout(SitePage.LAYOUT_DOUBLE_COL);
}
}
}
OSP Tool
XSltcharon portal:-
XsltrenderContext.java:-
Comment the following
/*pageElement.setAttribute("layout", (context.get("pageColumnLayout")
.equals("col1")) ? "0" : "1");*/
And replace with
String selectedLayout="0";
//context.put("pageColumnLayout","SingleDouble");
if(context.get("pageColumnLayout").equals("col1of2")){
selectedLayout="1";
}
else if(context.get("pageColumnLayout").equals("SingleDouble")){
selectedLayout="2";
}
else{
selectedLayout="0";
}
And add following statements in if (selected)
if(context.get("pageColumnLayout").equals("SingleDouble")){
Element column3 = doc.createElement("column");
Element column4 = doc.createElement("column");
Element column5 = doc.createElement("column");
column3.setAttribute("index","3");
column4.setAttribute("index","4");
column5.setAttribute("index","5");
LinkedList l1=new LinkedList();
LinkedList l2=new LinkedList();
LinkedList all=new LinkedList();
List column0Tools=(List)context.get("pageColumn0Tools");
List column1Tools=(List)context.get("pageColumn1Tools");
if(column0Tools !=null){
l1.add(column0Tools.get(0));
column3.appendChild(createColumnToolsXml(doc,l1, page));
column0Tools.remove(0);
if(column0Tools !=null)
{
all.addAll(column0Tools);
}
columns.appendChild(column3);
if(column1Tools !=null && column1Tools.size()>0 )
{ l2.add(column1Tools.get(0)); column4.appendChild(createColumnToolsXml(doc,l2, page));
column1Tools.remove(0);
if(column1Tools !=null){
all.addAll(column1Tools);
}
}
columns.appendChild(column4);
if(all !=null){
column5.appendChild(createColumnToolsXml(doc,all, page));
}
columns.appendChild(column5);
}
Osp-Portal
osp-portal.xsl:-
Add the following into portal.xslt and osp-portal.xsl
<!--
===============match single and Double============
process a selected page with two column layouts
param:content - "true" or "false" if rendering tool content or tool list
=========================================================
-->
<xsl:template match="page[#layout='2' and #selected='true']">
<xsl:param name="content"/>
<xsl:if test="$content='true'">
<xsl:call-template name="page-content-custom">
<xsl:with-param name="page" select="."/>
</xsl:call-template>
</xsl:if>
<xsl:if test="$content='false'">
<li>
<a accesskey="1" class="selected" href="#">
<xsl:attribute name="accesskey">
<xsl:value-of select="../../#order"/>
</xsl:attribute>
<xsl:value-of select="title"/>
</a>
</li>
</xsl:if>
</xsl:template>
<!--Custom Sarath -->
<xsl:template name="page-content-custom">
<xsl:param name="page" />
<h1 class="skip">
<xsl:value-of select="$externalized/entry[#key='sit.contentshead']" />
</h1>
<a id="tocontent" class="skip" name="tocontent"></a>
<div id="content">
<div id="col1of2">
<div class="portlet">
<p class="pageId">$page</p>
<xsl:for-each select="$page/columns/column[#index='3']/tools/tool">
<xsl:call-template name="tool">
<xsl:with-param name="tool" select="." />
</xsl:call-template>
</xsl:for-each>
</div>
</div>
<div id="col2of2">
<div class="portlet">
<xsl:for-each select="$page/columns/column[#index='4']/tools/tool">
<xsl:call-template name="tool">
<xsl:with-param name="tool" select="." />
</xsl:call-template>
</xsl:for-each>
</div>
</div>
<div id="col1">
<div class="portlet">
<xsl:for-each select="$page/columns/column[#index='5']/tools/tool">
<xsl:call-template name="tool">
<xsl:with-param name="tool" select="." />
</xsl:call-template>
</xsl:for-each>
</div>
</div>
</div>
</xsl:template>
in Portal.css file
#col1_new{
padding-right: .0em;
clear:both;
}
#col1of2_new{
width: 51%;
*/width: 48%;
float: left;
margin: 0;
margin-left: 0.3em;
}
#col2of2_new{
width: 48%;
*/width: 48%;
float: right;
}